From bd4105be88c159f74b8e4f155bf12461d7d86dab Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 May 2021 07:37:07 +0800 Subject: [PATCH] first commit --- build.gradle | 129 + ...发成长计划系列教程-第十章.pptx | Bin 0 -> 408285 bytes encrypt.xml | 13 + lib/gson-2.3.1.jar | Bin 0 -> 210856 bytes lib/report/.gitkeep | 0 plugin.xml | 25 + readme.md | 3 + .../java/com/fr/plugin/WaterChartConfig.java | 60 + .../com/fr/plugin/WaterChartProvider.java | 15 + src/main/java/com/fr/plugin/WaterChartUI.java | 46 + src/main/java/com/fr/plugin/WaterChat.java | 67 + .../plugin/pane/WaterChartTableDataPane.java | 52 + .../pane/WaterChatReportDataContentPane.java | 54 + .../resources/com/fr/plugin/web/icon/icon.png | Bin 0 -> 368 bytes .../com/fr/plugin/web/icon/preview.PNG | Bin 0 -> 84901 bytes .../fr/plugin/web/js/echarts-liquidfill.js | 991 + .../plugin/web/js/echarts-liquidfill.min.js | 2 + .../resources/com/fr/plugin/web/js/echarts.js | 92839 ++++++++++++++++ .../resources/com/fr/plugin/web/js/water.js | 15 + 19 files changed, 94311 insertions(+) create mode 100644 build.gradle create mode 100644 doc/插件开发成长计划系列教程-第十章.pptx create mode 100644 encrypt.xml create mode 100644 lib/gson-2.3.1.jar create mode 100644 lib/report/.gitkeep create mode 100644 plugin.xml create mode 100644 readme.md create mode 100644 src/main/java/com/fr/plugin/WaterChartConfig.java create mode 100644 src/main/java/com/fr/plugin/WaterChartProvider.java create mode 100644 src/main/java/com/fr/plugin/WaterChartUI.java create mode 100644 src/main/java/com/fr/plugin/WaterChat.java create mode 100644 src/main/java/com/fr/plugin/pane/WaterChartTableDataPane.java create mode 100644 src/main/java/com/fr/plugin/pane/WaterChatReportDataContentPane.java create mode 100644 src/main/resources/com/fr/plugin/web/icon/icon.png create mode 100644 src/main/resources/com/fr/plugin/web/icon/preview.PNG create mode 100644 src/main/resources/com/fr/plugin/web/js/echarts-liquidfill.js create mode 100644 src/main/resources/com/fr/plugin/web/js/echarts-liquidfill.min.js create mode 100644 src/main/resources/com/fr/plugin/web/js/echarts.js create mode 100644 src/main/resources/com/fr/plugin/web/js/water.js diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..c571700 --- /dev/null +++ b/build.gradle @@ -0,0 +1,129 @@ + +apply plugin: 'java' + + +ext { + /** + * 项目中依赖的jar的路径 + * 1.如果依赖的jar需要打包到zip中,放置在lib根目录下 + * 2.如果依赖的jar仅仅是编译时需要,防止在lib下子目录下即可 + */ + libPath = "$projectDir/../webroot/WEB-INF/lib" + + /** + * 是否对插件的class进行加密保护,防止反编译 + */ + guard = false + + def pluginInfo = getPluginInfo() + pluginPre = "fine-plugin" + pluginName = pluginInfo.id + pluginVersion = pluginInfo.version + + outputPath = "$projectDir/../webroot/WEB-INF/plugins/plugin-" + pluginName + "-1.0/classes" +} + +group = 'com.fr.plugin' +version = '10.0' +sourceCompatibility = '8' + +sourceSets { + main { + java.outputDir = file(outputPath) + output.resourcesDir = file(outputPath) + } +} + +ant.importBuild("encrypt.xml") +//定义ant变量 +ant.projectDir = projectDir +ant.references["compile.classpath"] = ant.path { + fileset(dir: libPath, includes: '**/*.jar') + fileset(dir: ".",includes:"**/*.jar" ) +} + +classes.dependsOn('clean') + +task copyFiles(type: Copy,dependsOn: 'classes'){ + from outputPath + into "$projectDir/classes" +} + +task preJar(type:Copy,dependsOn: guard ? 'compile_encrypt_javas' : 'compile_plain_javas'){ + from "$projectDir/classes" + into "$projectDir/transform-classes" + include "**/*.*" +} +jar.dependsOn("preJar") + +classes.dependsOn("copyPluginXML") + +task copyPluginXML(type: Copy) { + print "copyed plugin.xml file" + from "$projectDir/plugin.xml" + into file("$projectDir/../webroot/WEB-INF/plugins/plugin-" + pluginName + "-1.0/") +} +task makeJar(type: Jar,dependsOn: preJar){ + from fileTree(dir: "$projectDir/transform-classes") + baseName pluginPre + appendix pluginName + version pluginVersion + destinationDir = file("$buildDir/libs") + + doLast(){ + delete file("$projectDir/classes") + delete file("$projectDir/transform-classes") + } +} + +task copyFile(type: Copy,dependsOn: ["makeJar"]){ + from "$buildDir/libs" + from("$projectDir/lib") { + include "*.jar" + } + from "$projectDir/plugin.xml" + into file("$buildDir/temp/plugin") +} + +task zip(type:Zip,dependsOn:["copyFile"]){ + from "$buildDir/temp/plugin" + destinationDir file("$buildDir/install") + baseName pluginPre + appendix pluginName + version pluginVersion +} + +//控制build时包含哪些文件,排除哪些文件 +processResources { +// exclude everything +// 用*.css没效果 +// exclude '**/*.css' +// except this file +// include 'xx.xml' +} + +/*读取plugin.xml中的version*/ +def getPluginInfo(){ + def xmlFile = file("plugin.xml") + if (!xmlFile.exists()) { + return ["id":"none", "version":"1.0.0"] + } + def plugin = new XmlParser().parse(xmlFile) + def version = plugin.version[0].text() + def id = plugin.id[0].text() + return ["id":id,"version":version] +} + +repositories { + mavenLocal() + maven { + url = uri('http://mvn.finedevelop.com/repository/maven-public/') + } +} + +dependencies { + //使用本地jar + implementation fileTree(dir: 'lib', include: ['**/*.jar']) + implementation fileTree(dir: libPath, include: ['**/*.jar']) +} + diff --git a/doc/插件开发成长计划系列教程-第十章.pptx b/doc/插件开发成长计划系列教程-第十章.pptx new file mode 100644 index 0000000000000000000000000000000000000000..4c44a3c8879541fb9552dbb407515505167c51cd GIT binary patch literal 408285 zcma&NW0WS{(k)uHZQHhO+qP}nw%KLdc2$?v#i!V1yZZKizk9|#dyjL+KKUmzM@Ft+ zE9ROpV}_C}C>RXTzphAyL!p1&|JMcf_rb}@jZx|UHv;+pjc~QIHZzwq_I7l4bNweA z?e7Pue->nsiVRcuyAmn_5D@YIDg1x?mzlxK-fm2DCIMF*ZHM#@v2NG%GN41(RPuGq z;x_K~2-K!~#v?XBS)aoL3ARjXgiZoE7A!0YOUVd42R%j!#4z;gh_O?B^%xS)7*BC> z{JOs0_xG-=;*PGnlV{H8G*~Lh^ip^AUR5=WLMUC_lCgfD=h7;lIyIGyD4Hd8eGRML z4^P~ie%GWAaXf+&ZH@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b(p%cn0^g`tEnl&j(1JNN4=h&*m2gNZ{prAR(ZkD1o1)kRito z>4Xb8)EGruR2T-4xITrZ9!kOaB_i+r6qsHSU+>4e_~}Slrv_6lurOJ zq66Lc#6XG{H9uAZvQf^Sft?>g(x?{*b3%h0DMH4Hqd~+$mJYmt>Qq-Dbci^}!4-J% z(J4*^10oJ`LiRz3j;bBxNtpqU|ID8yzF@fgUppR9*|=WSdY&$OhPYUTo?}x-&>4(2m~)d;^5t4tn@46LRGrwqStEy zlLi4{)%lYYG>u;o7it1$Wnl3GK)JGwp1Se!!q2Koomk3P$~35f=t? zNYw6bWq=gEzbHa#`YYnX050a6yW10>OQe7z^qKh>N{KS9{(>X{p; z*g2US*#1-c>m(WhNXN&E7LtDfj14RdemTqCei8^14GaTLAmBZJ9QEv6J3CP83#TV! z!d(2>J0BA+9MM~{y4N2=1C9n5Pd_8m6Gub$;)LK}V({op<`3A!1D6Hx$BqIDN`(aU G&;JKWB!aa7 literal 0 HcmV?d00001 diff --git a/encrypt.xml b/encrypt.xml new file mode 100644 index 0000000..1401cd1 --- /dev/null +++ b/encrypt.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/lib/gson-2.3.1.jar b/lib/gson-2.3.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..250132c197467d7ddef3b7f40a98fdc036163b66 GIT binary patch literal 210856 zcmb??V|=CSvt>HA(_zQ9Z5tiic6Q8;ZQHhO+eSwn+Z|5Mx#!-wbLafeo!`uCf2jKK zu3A;QYCZMJOM!qw1O4&vfN~W1^T%HwP@ms2B1!@@60)Ln@}Fj?K#-qL_y1ys`k&2Y z1Y{*dMHH22Wkdtxe%kcmqYhoB-+glhl6phgoHIs0nLtKKHX&`-MvO|7$o0>kZN_U_ zQ$gSRX6NncdALWNl4NOz;pOWzcNB1E#s+H=+@}`teW;n*Kfo@2ej-Ks%VfqZ-AkDF z`TUo2C!6sEbL$v=3`B%hv4+4#;HXE2YQLc31FbQ;ct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RK%8_HTm&6n4_(B;{;Q**=$Q?&m7dlK=Y?!c8>%42LgKQL4K0*PVSe34hO-k+pbao)lduG@u1$1ILdUnNoJNp4S60zjV*TK==qswF3JZ^u9 z1rw3!44T?qKWDBrNyM&cSz|4$a~V|^70UH<=8mlPSU@4sG0~hcq^UeYSv8Gzq1d4F! z+SX;!b1=f+5q7@17cU|(v#k!}%O2wXWJ#=FE?`dsHiR?&)qD{)!DgMvIadF5rdJ|D zH#4u=kVHJV@eS|6iP91_xLKVdjQRpHt1CBh`%kbORYK7}GE_T};T6moA*hpOM&uO{(h-Q@HFR_*}p z$9(t+ybW)>xj!pu#;W=JlDqxd&zJC+bINovb$qJ5kd-(7^d4PIz5ZhDb)NisDeV*q zs&})iyC<}FX7Zz+@ta7%7Q&k2C2AgMudm}b4W}cw-9zRMN?g9_K633PKYXE$hAw#^ zkxw=4ohW>%m{To*yw_n!IYN6iKzmLXoR@V0<>S-7O3#T9}i-0cD*;vYoX8w_jl OZ$92#YJ45aW%wUD7hlN$ literal 0 HcmV?d00001 diff --git a/lib/report/.gitkeep b/lib/report/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..c9adcb2 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,25 @@ + + + com.fr.plugin.water.plugin + + yes + 1.0 + 10.0 + 2018-07-31 + author + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..b998877 --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# 控件开发 + +。 \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/WaterChartConfig.java b/src/main/java/com/fr/plugin/WaterChartConfig.java new file mode 100644 index 0000000..f6f0143 --- /dev/null +++ b/src/main/java/com/fr/plugin/WaterChartConfig.java @@ -0,0 +1,60 @@ +package com.fr.plugin; + +import com.fr.extended.chart.AbstractDataConfig; +import com.fr.extended.chart.ExtendedField; +import com.fr.stable.AssistUtils; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLableReader; + +/** + * 后台图表对象用于:数据保存和界面交换数据的model + */ +public class WaterChartConfig extends AbstractDataConfig { + + /** + * 数据字段,有一个字段保存一个 + */ + private ExtendedField value = new ExtendedField(); + + public ExtendedField getValue() { + return value; + } + + public void setValue(ExtendedField value) { + this.value = value; + } + + @Override + protected void readAttr(XMLableReader xmLableReader) { + readExtendedField(value,"value",xmLableReader); + } + + @Override + protected void writeAttr(XMLPrintWriter xmlPrintWriter) { + writeExtendedField(value,"value",xmlPrintWriter); + } + + @Override + public ExtendedField[] dataSetFields() { + return new ExtendedField[]{ + value + }; + } + + @Override + public WaterChartConfig clone() throws CloneNotSupportedException { + WaterChartConfig result = new WaterChartConfig(); + result.setValue(this.getValue().clone()); + return result; + } + + @Override + public int hashCode() { + return super.hashCode() + AssistUtils.hashCode(this.getValue()); + } + + @Override + public boolean equals(Object obj) { + return obj instanceof WaterChartConfig && AssistUtils.equals(this.getValue(), ((WaterChartConfig) obj).getValue()); + } +} diff --git a/src/main/java/com/fr/plugin/WaterChartProvider.java b/src/main/java/com/fr/plugin/WaterChartProvider.java new file mode 100644 index 0000000..d305978 --- /dev/null +++ b/src/main/java/com/fr/plugin/WaterChartProvider.java @@ -0,0 +1,15 @@ +package com.fr.plugin; + +import com.fr.extended.chart.AbstractChart; +import com.fr.extended.chart.AbstractExtentChartProvider; +import com.fr.plugin.transform.ExecuteFunctionRecord; +import com.fr.plugin.transform.FunctionRecorder; + +@FunctionRecorder +public class WaterChartProvider extends AbstractExtentChartProvider { + @Override + @ExecuteFunctionRecord + protected AbstractChart createChart() { + return new WaterChat(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/WaterChartUI.java b/src/main/java/com/fr/plugin/WaterChartUI.java new file mode 100644 index 0000000..1237fc2 --- /dev/null +++ b/src/main/java/com/fr/plugin/WaterChartUI.java @@ -0,0 +1,46 @@ +package com.fr.plugin; + +import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; +import com.fr.extended.chart.AbstractExtendedChartTableDataPane; +import com.fr.extended.chart.AbstractExtendedChartUIProvider; +import com.fr.plugin.pane.WaterChartTableDataPane; +import com.fr.plugin.pane.WaterChatReportDataContentPane; + +/** + * 写这写按照plugin顺序写,按照文档写,按照idea提示写,不要自己硬 + */ +public class WaterChartUI extends AbstractExtendedChartUIProvider { + + /** + * 数据来选为数据集数据时使用的界面 + */ + @Override + protected AbstractExtendedChartTableDataPane getTableDataSourcePane() { + return new WaterChartTableDataPane(); + } + /** + * 数据来选为单元格时下方的数据 + */ + @Override + protected AbstractReportDataContentPane getReportDataSourcePane() { + return new WaterChatReportDataContentPane(); + } + + /** + * 预览图 + */ + @Override + public String[] getDemoImagePath() { + return new String[]{ + "com/fr/plugin/web/icon/preview.PNG" + }; + } + + /* + 32*32 + */ + @Override + public String getIconPath() { + return "com/fr/plugin/web/icon/icon.png"; + } +} diff --git a/src/main/java/com/fr/plugin/WaterChat.java b/src/main/java/com/fr/plugin/WaterChat.java new file mode 100644 index 0000000..7084eb8 --- /dev/null +++ b/src/main/java/com/fr/plugin/WaterChat.java @@ -0,0 +1,67 @@ +package com.fr.plugin; + +import com.fr.extended.chart.AbstractChart; +import com.fr.extended.chart.HyperLinkPara; +import com.fr.extended.chart.StringFormula; +import com.fr.json.JSONException; +import com.fr.json.JSONObject; +import com.fr.plugin.transform.ExecuteFunctionRecord; +import com.fr.stable.web.Repository; + +import java.util.List; + +public class WaterChat extends AbstractChart { + @Override + @ExecuteFunctionRecord + /** + * plotID 对应 + */ + protected String getChartID() { + return "echart.water.chart"; + } + + @Override + public String getChartName() { + return "水球图"; + } + /** + * 数据源获取并解析成对应类型 + */ + @Override + protected void addJSON(WaterChartConfig waterChartConfig, JSONObject jsonObject, Repository repository, JSONPara jsonPara) throws JSONException { + List values = waterChartConfig.getValue().getValues(); + jsonObject.put("value", values); + } + + @Override + protected String[] requiredJS() { + return new String[]{ + "com/fr/plugin/web/js/echarts.js", + "com/fr/plugin/web/js/echarts-liquidfill.js", + "com/fr/plugin/web/js/water.js" + }; + } + + @Override + protected String wrapperName() { + return "demoWrapper"; + } + + + @Override + protected String demoImagePath() { + return "com/fr/plugin/web/icon/preview.PNG"; + } + + + @Override + protected HyperLinkPara[] hyperLinkParas() { + return new HyperLinkPara[0]; + } + + @Override + protected List formulas() { + return null; + } + +} diff --git a/src/main/java/com/fr/plugin/pane/WaterChartTableDataPane.java b/src/main/java/com/fr/plugin/pane/WaterChartTableDataPane.java new file mode 100644 index 0000000..785edd3 --- /dev/null +++ b/src/main/java/com/fr/plugin/pane/WaterChartTableDataPane.java @@ -0,0 +1,52 @@ +package com.fr.plugin.pane; + +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.extended.chart.AbstractExtendedChartTableDataPane; +import com.fr.plugin.WaterChartConfig; + +/** + * 使用这个界面时,fr会自动生成一个数据集选择器(意味着只能单一数据源), + * 然后根据我们有多少个字段,编写多少个(1)和(2),然后渲染出来就自动生成 + */ +public class WaterChartTableDataPane extends AbstractExtendedChartTableDataPane { + private UIComboBox xComboBox; + private UIComboBox xComboBox1; + /** + * (1) 说明标签 + * @return + */ + @Override + protected String[] fieldLabels() { + return new String[]{ + "百分比数据集选择", + "第二个字段" + }; + } + /** + * (2) + * 字段选择器 + */ + @Override + protected UIComboBox[] filedComboBoxes() { + if (xComboBox == null) { + xComboBox=new UIComboBox(); + xComboBox1=new UIComboBox(); + } + return new UIComboBox[]{ + xComboBox, + xComboBox1 + }; + } + + @Override + protected void populate(WaterChartConfig waterChartConfig) { + populateField(xComboBox, waterChartConfig.getValue()); + } + + @Override + protected WaterChartConfig update() { + WaterChartConfig waterChartConfig = new WaterChartConfig(); + updateField(xComboBox, waterChartConfig.getValue()); + return waterChartConfig; + } +} diff --git a/src/main/java/com/fr/plugin/pane/WaterChatReportDataContentPane.java b/src/main/java/com/fr/plugin/pane/WaterChatReportDataContentPane.java new file mode 100644 index 0000000..5338ebc --- /dev/null +++ b/src/main/java/com/fr/plugin/pane/WaterChatReportDataContentPane.java @@ -0,0 +1,54 @@ +package com.fr.plugin.pane; + +import com.fr.design.formula.TinyFormulaPane; +import com.fr.extended.chart.AbstractExtendedChartReportDataPane; +import com.fr.plugin.WaterChartConfig; + +/** + * 选中单元格数据集时使用本类来执行 + */ +public class WaterChatReportDataContentPane extends AbstractExtendedChartReportDataPane { + + private TinyFormulaPane xPane; + + /** + * 返回标签数量 + */ + @Override + protected String[] fieldLabel() { + return new String[]{ + "百分比:(小数)" + }; + } + + /** + * 返回公式选择器 + */ + @Override + protected TinyFormulaPane[] formulaPanes() { + if (xPane == null) { + xPane = new TinyFormulaPane(); + } + return new TinyFormulaPane[]{ + xPane + }; + } + + /** + * 更新界面 + */ + @Override + protected void populate(WaterChartConfig waterChartConfig) { + populateField(xPane, waterChartConfig.getValue()); + } + + @Override + /** + * 更新图表模型 + */ + protected WaterChartConfig update() { + WaterChartConfig waterChartConfig = new WaterChartConfig(); + updateField(xPane, waterChartConfig.getValue()); + return waterChartConfig; + } +} diff --git a/src/main/resources/com/fr/plugin/web/icon/icon.png b/src/main/resources/com/fr/plugin/web/icon/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..506db178d756f1b60b17ccb79a58de983b10edca GIT binary patch literal 368 zcmV-$0gwKPP)bF5XQgR6uyCPAVM+$L98t9d1s%Y5_W+xbJ7Gf3;1`3}H>b58O+Kb*y6<_iGpny;#AP?qJZ2RHy5 z095eNVXEKgZUJnHNYVzJ15iOS1yHz;V*mppI(5#SOaO5l_ndPH5$#%QZ)Q1&qG+3l z_5ch;|aU365Yp?t}48s*;%;lFRGII*xUH8Bkvzleu(|4m}X5EQ#GwZrODvILSkL_AS z_L+GEV5#dobkxlJ0$^u)6SeM9MAkZP;ogrm2!iD_O-GYO`s-274fq5Lo2wD%=~W#7 O0000TvLXmtUwzJc^aGkM_RwM?+5*iwM zCJ5!sDy{5l4~@hI?>dlH_LWKMSsNk*k$nNzjQQ@fudc*aY~8#9$<6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A}I&b=`233UDMKB%Z(l z#IEp+A{}{%gbp~P2Zd`tgsO8z`lGsp{`rU@2kEC`k}iF$z(55Gr>Moi1J#U>xiNAt zlEF*>I2xLx1?aMbYr?hFHh|;*;J?M=|3Vt5?G3PXNddqE1uCcDit#3vcyz{qH@ZMp zS0Ns#Y83!HP@r-uaNu=AD5w#hjOFJX06b8jK!F@WA&qXN0l;gyP?e5HHx?*RWfe)< zhucSA?ZEX%Uje`?DJ0%t8rVQ}Rch*6_dX-^dJ5w1RiiQij#5)~J&WC&j|5axePsdg zpsQD)x+;Vj%1ZlS2nO3!rvt||*)Kk*tqK4hC{UnUrvTuAszoRutJ9g-inq8uuD7PH zxu%{`ZB|XD{o0}c;597NZfauEAUKnFnkE6@M!dBqYFeoNV*peDo9GJZKA5(la*7(j z0Rn_F;>FeBI??bbF+4q!Vol6y1~}A2cnZ%eR=P;x9+Wj9k^Q_}`>RrTK4o2BpzQ*!~(^-z=rDPLnOZ$girzn3KXae)x_JmU}|72 zUHgn`HNX+G#7&6zYMQAn)b>&>O32TNIh2(#s!9g5r9DePxV+C=rIGS~ zFP0Tc?KCbS4OO=749}}Fg>Dc+sU`tlS;tP*7&vNLC`hZj3hELH&{%(q3jkl%=*GGr zfGv~n1wiiFUmJu13Nk07*qoM6N<$f`&mrz5oCK literal 0 HcmV?d00001 diff --git a/src/main/resources/com/fr/plugin/web/js/echarts-liquidfill.js b/src/main/resources/com/fr/plugin/web/js/echarts-liquidfill.js new file mode 100644 index 0000000..90d1fb6 --- /dev/null +++ b/src/main/resources/com/fr/plugin/web/js/echarts-liquidfill.js @@ -0,0 +1,991 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("echarts")); + else if(typeof define === 'function' && define.amd) + define(["echarts"], factory); + else if(typeof exports === 'object') + exports["echarts-liquidfill"] = factory(require("echarts")); + else + root["echarts-liquidfill"] = factory(root["echarts"]); +})(window, function(__WEBPACK_EXTERNAL_MODULE_echarts_lib_echarts__) { +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] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = 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; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./index.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "../../../../Users/zhangwenli01/.nvm/versions/node/v10.10.0/lib/node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function(\"return this\")() || (1, eval)(\"this\");\r\n} catch (e) {\r\n\t// This works if the window reference is available\r\n\tif (typeof window === \"object\") g = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it's\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi4vLi4vLi4vLi4vVXNlcnMvemhhbmd3ZW5saTAxLy5udm0vdmVyc2lvbnMvbm9kZS92MTAuMTAuMC9saWIvbm9kZV9tb2R1bGVzL3dlYnBhY2svYnVpbGRpbi9nbG9iYWwuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVp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lib/node_modules/webpack/buildin/global.js\n"); + +/***/ }), + +/***/ "./index.js": +/*!******************!*\ + !*** ./index.js ***! + \******************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("module.exports = __webpack_require__(/*! ./src/liquidFill */ \"./src/liquidFill.js\");\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9pbmRleC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL2luZGV4LmpzPzQxZjUiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL3NyYy9saXF1aWRGaWxsJyk7XG4iXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./index.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/config.js": +/*!********************************************!*\ + !*** ./node_modules/echarts/lib/config.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("/* WEBPACK VAR INJECTION */(function(global) {\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// (1) The code `if (__DEV__) ...` can be removed by build tool.\n// (2) If intend to use `__DEV__`, this module should be imported. Use a global\n// variable `__DEV__` may cause that miss the declaration (see #6535), or the\n// declaration is behind of the using position (for example in `Model.extent`,\n// And tools like rollup can not analysis the dependency if not import).\nvar dev; // In browser\n\nif (typeof window !== 'undefined') {\n dev = window.__DEV__;\n} // In node\nelse if (typeof global !== 'undefined') {\n dev = global.__DEV__;\n }\n\nif (typeof dev === 'undefined') {\n dev = true;\n}\n\nvar __DEV__ = dev;\nexports.__DEV__ = __DEV__;\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../../../../Users/zhangwenli01/.nvm/versions/node/v10.10.0/lib/node_modules/webpack/buildin/global.js */ \"../../../../Users/zhangwenli01/.nvm/versions/node/v10.10.0/lib/node_modules/webpack/buildin/global.js\")))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvY29uZmlnLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL2VjaGFydHMvbGliL2NvbmZpZy5qcz80ZTA4Il0sInNvdXJjZXNDb250ZW50IjpbIlxuLypcbiogTGljZW5zZWQgdG8gdGhlIEFwYWNoZSBTb2Z0d2FyZSBGb3VuZGF0aW9uIChBU0YpIHVuZGVyIG9uZVxuKiBvciBtb3JlIGNvbnRyaWJ1dG9yIGxpY2Vuc2UgYWdyZWVtZW50cy4gIFNlZ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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/config.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/data/Source.js": +/*!*************************************************!*\ + !*** ./node_modules/echarts/lib/data/Source.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _util = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar createHashMap = _util.createHashMap;\nvar isTypedArray = _util.isTypedArray;\n\nvar _clazz = __webpack_require__(/*! ../util/clazz */ \"./node_modules/echarts/lib/util/clazz.js\");\n\nvar enableClassCheck = _clazz.enableClassCheck;\n\nvar _sourceType = __webpack_require__(/*! ./helper/sourceType */ \"./node_modules/echarts/lib/data/helper/sourceType.js\");\n\nvar SOURCE_FORMAT_ORIGINAL = _sourceType.SOURCE_FORMAT_ORIGINAL;\nvar SERIES_LAYOUT_BY_COLUMN = _sourceType.SERIES_LAYOUT_BY_COLUMN;\nvar SOURCE_FORMAT_UNKNOWN = _sourceType.SOURCE_FORMAT_UNKNOWN;\nvar SOURCE_FORMAT_TYPED_ARRAY = _sourceType.SOURCE_FORMAT_TYPED_ARRAY;\nvar SOURCE_FORMAT_KEYED_COLUMNS = _sourceType.SOURCE_FORMAT_KEYED_COLUMNS;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * [sourceFormat]\n *\n * + \"original\":\n * This format is only used in series.data, where\n * itemStyle can be specified in data item.\n *\n * + \"arrayRows\":\n * [\n * ['product', 'score', 'amount'],\n * ['Matcha Latte', 89.3, 95.8],\n * ['Milk Tea', 92.1, 89.4],\n * ['Cheese Cocoa', 94.4, 91.2],\n * ['Walnut Brownie', 85.4, 76.9]\n * ]\n *\n * + \"objectRows\":\n * [\n * {product: 'Matcha Latte', score: 89.3, amount: 95.8},\n * {product: 'Milk Tea', score: 92.1, amount: 89.4},\n * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2},\n * {product: 'Walnut Brownie', score: 85.4, amount: 76.9}\n * ]\n *\n * + \"keyedColumns\":\n * {\n * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'],\n * 'count': [823, 235, 1042, 988],\n * 'score': [95.8, 81.4, 91.2, 76.9]\n * }\n *\n * + \"typedArray\"\n *\n * + \"unknown\"\n */\n\n/**\n * @constructor\n * @param {Object} fields\n * @param {string} fields.sourceFormat\n * @param {Array|Object} fields.fromDataset\n * @param {Array|Object} [fields.data]\n * @param {string} [seriesLayoutBy='column']\n * @param {Array.} [dimensionsDefine]\n * @param {Objet|HashMap} [encodeDefine]\n * @param {number} [startIndex=0]\n * @param {number} [dimensionsDetectCount]\n */\nfunction Source(fields) {\n /**\n * @type {boolean}\n */\n this.fromDataset = fields.fromDataset;\n /**\n * Not null/undefined.\n * @type {Array|Object}\n */\n\n this.data = fields.data || (fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : []);\n /**\n * See also \"detectSourceFormat\".\n * Not null/undefined.\n * @type {string}\n */\n\n this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN;\n /**\n * 'row' or 'column'\n * Not null/undefined.\n * @type {string} seriesLayoutBy\n */\n\n this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN;\n /**\n * dimensions definition in option.\n * can be null/undefined.\n * @type {Array.}\n */\n\n this.dimensionsDefine = fields.dimensionsDefine;\n /**\n * encode definition in option.\n * can be null/undefined.\n * @type {Objet|HashMap}\n */\n\n this.encodeDefine = fields.encodeDefine && createHashMap(fields.encodeDefine);\n /**\n * Not null/undefined, uint.\n * @type {number}\n */\n\n this.startIndex = fields.startIndex || 0;\n /**\n * Can be null/undefined (when unknown), uint.\n * @type {number}\n */\n\n this.dimensionsDetectCount = fields.dimensionsDetectCount;\n}\n/**\n * Wrap original series data for some compatibility cases.\n */\n\n\nSource.seriesDataToSource = function (data) {\n return new Source({\n data: data,\n sourceFormat: isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL,\n fromDataset: false\n });\n};\n\nenableClassCheck(Source);\nvar _default = Source;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvZGF0YS9Tb3VyY2UuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZH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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/data/Source.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/data/helper/completeDimensions.js": +/*!********************************************************************!*\ + !*** ./node_modules/echarts/lib/data/helper/completeDimensions.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _util = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar createHashMap = _util.createHashMap;\nvar each = _util.each;\nvar isString = _util.isString;\nvar defaults = _util.defaults;\nvar extend = _util.extend;\nvar isObject = _util.isObject;\nvar clone = _util.clone;\n\nvar _model = __webpack_require__(/*! ../../util/model */ \"./node_modules/echarts/lib/util/model.js\");\n\nvar normalizeToArray = _model.normalizeToArray;\n\nvar _sourceHelper = __webpack_require__(/*! ./sourceHelper */ \"./node_modules/echarts/lib/data/helper/sourceHelper.js\");\n\nvar guessOrdinal = _sourceHelper.guessOrdinal;\n\nvar Source = __webpack_require__(/*! ../Source */ \"./node_modules/echarts/lib/data/Source.js\");\n\nvar _dimensionHelper = __webpack_require__(/*! ./dimensionHelper */ \"./node_modules/echarts/lib/data/helper/dimensionHelper.js\");\n\nvar OTHER_DIMENSIONS = _dimensionHelper.OTHER_DIMENSIONS;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * @deprecated\n * Use `echarts/data/helper/createDimensions` instead.\n */\n\n/**\n * @see {module:echarts/test/ut/spec/data/completeDimensions}\n *\n * Complete the dimensions array, by user defined `dimension` and `encode`,\n * and guessing from the data structure.\n * If no 'value' dimension specified, the first no-named dimension will be\n * named as 'value'.\n *\n * @param {Array.} sysDims Necessary dimensions, like ['x', 'y'], which\n * provides not only dim template, but also default order.\n * properties: 'name', 'type', 'displayName'.\n * `name` of each item provides default coord name.\n * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and\n * provide dims count that the sysDim required.\n * [{ordinalMeta}] can be specified.\n * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious)\n * @param {Object} [opt]\n * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions\n * For example: ['asdf', {name, type}, ...].\n * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3}\n * @param {string} [opt.generateCoord] Generate coord dim with the given name.\n * If not specified, extra dim names will be:\n * 'value', 'value0', 'value1', ...\n * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`.\n * If `generateCoordCount` specified, the generated dim names will be:\n * `generateCoord` + 0, `generateCoord` + 1, ...\n * can be Infinity, indicate that use all of the remain columns.\n * @param {number} [opt.dimCount] If not specified, guess by the first data item.\n * @param {number} [opt.encodeDefaulter] If not specified, auto find the next available data dim.\n * @return {Array.} [{\n * name: string mandatory,\n * displayName: string, the origin name in dimsDef, see source helper.\n * If displayName given, the tooltip will displayed vertically.\n * coordDim: string mandatory,\n * coordDimIndex: number mandatory,\n * type: string optional,\n * otherDims: { never null/undefined\n * tooltip: number optional,\n * label: number optional,\n * itemName: number optional,\n * seriesName: number optional,\n * },\n * isExtraCoord: boolean true if coord is generated\n * (not specified in encode and not series specified)\n * other props ...\n * }]\n */\nfunction completeDimensions(sysDims, source, opt) {\n if (!Source.isInstance(source)) {\n source = Source.seriesDataToSource(source);\n }\n\n opt = opt || {};\n sysDims = (sysDims || []).slice();\n var dimsDef = (opt.dimsDef || []).slice();\n var encodeDef = createHashMap(opt.encodeDef);\n var dataDimNameMap = createHashMap();\n var coordDimNameMap = createHashMap(); // var valueCandidate;\n\n var result = [];\n var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount); // Apply user defined dims (`name` and `type`) and init result.\n\n for (var i = 0; i < dimCount; i++) {\n var dimDefItem = dimsDef[i] = extend({}, isObject(dimsDef[i]) ? dimsDef[i] : {\n name: dimsDef[i]\n });\n var userDimName = dimDefItem.name;\n var resultItem = result[i] = {\n otherDims: {}\n }; // Name will be applied later for avoiding duplication.\n\n if (userDimName != null && dataDimNameMap.get(userDimName) == null) {\n // Only if `series.dimensions` is defined in option\n // displayName, will be set, and dimension will be diplayed vertically in\n // tooltip by default.\n resultItem.name = resultItem.displayName = userDimName;\n dataDimNameMap.set(userDimName, i);\n }\n\n dimDefItem.type != null && (resultItem.type = dimDefItem.type);\n dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName);\n } // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`.\n\n\n encodeDef.each(function (dataDims, coordDim) {\n dataDims = normalizeToArray(dataDims).slice(); // Note: It is allowed that `dataDims.length` is `0`, e.g., options is\n // `{encode: {x: -1, y: 1}}`. Should not filter anything in\n // this case.\n\n if (dataDims.length === 1 && dataDims[0] < 0) {\n encodeDef.set(coordDim, false);\n return;\n }\n\n var validDataDims = encodeDef.set(coordDim, []);\n each(dataDims, function (resultDimIdx, idx) {\n // The input resultDimIdx can be dim name or index.\n isString(resultDimIdx) && (resultDimIdx = dataDimNameMap.get(resultDimIdx));\n\n if (resultDimIdx != null && resultDimIdx < dimCount) {\n validDataDims[idx] = resultDimIdx;\n applyDim(result[resultDimIdx], coordDim, idx);\n }\n });\n }); // Apply templetes and default order from `sysDims`.\n\n var availDimIdx = 0;\n each(sysDims, function (sysDimItem, sysDimIndex) {\n var coordDim;\n var sysDimItem;\n var sysDimItemDimsDef;\n var sysDimItemOtherDims;\n\n if (isString(sysDimItem)) {\n coordDim = sysDimItem;\n sysDimItem = {};\n } else {\n coordDim = sysDimItem.name;\n var ordinalMeta = sysDimItem.ordinalMeta;\n sysDimItem.ordinalMeta = null;\n sysDimItem = clone(sysDimItem);\n sysDimItem.ordinalMeta = ordinalMeta; // `coordDimIndex` should not be set directly.\n\n sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemOtherDims = sysDimItem.otherDims;\n sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex = sysDimItem.dimsDef = sysDimItem.otherDims = null;\n }\n\n var dataDims = encodeDef.get(coordDim); // negative resultDimIdx means no need to mapping.\n\n if (dataDims === false) {\n return;\n }\n\n var dataDims = normalizeToArray(dataDims); // dimensions provides default dim sequences.\n\n if (!dataDims.length) {\n for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) {\n while (availDimIdx < result.length && result[availDimIdx].coordDim != null) {\n availDimIdx++;\n }\n\n availDimIdx < result.length && dataDims.push(availDimIdx++);\n }\n } // Apply templates.\n\n\n each(dataDims, function (resultDimIdx, coordDimIndex) {\n var resultItem = result[resultDimIdx];\n applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex);\n\n if (resultItem.name == null && sysDimItemDimsDef) {\n var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex];\n !isObject(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {\n name: sysDimItemDimsDefItem\n });\n resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name;\n resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip;\n } // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}}\n\n\n sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims);\n });\n });\n\n function applyDim(resultItem, coordDim, coordDimIndex) {\n if (OTHER_DIMENSIONS.get(coordDim) != null) {\n resultItem.otherDims[coordDim] = coordDimIndex;\n } else {\n resultItem.coordDim = coordDim;\n resultItem.coordDimIndex = coordDimIndex;\n coordDimNameMap.set(coordDim, true);\n }\n } // Make sure the first extra dim is 'value'.\n\n\n var generateCoord = opt.generateCoord;\n var generateCoordCount = opt.generateCoordCount;\n var fromZero = generateCoordCount != null;\n generateCoordCount = generateCoord ? generateCoordCount || 1 : 0;\n var extra = generateCoord || 'value'; // Set dim `name` and other `coordDim` and other props.\n\n for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) {\n var resultItem = result[resultDimIdx] = result[resultDimIdx] || {};\n var coordDim = resultItem.coordDim;\n\n if (coordDim == null) {\n resultItem.coordDim = genName(extra, coordDimNameMap, fromZero);\n resultItem.coordDimIndex = 0;\n\n if (!generateCoord || generateCoordCount <= 0) {\n resultItem.isExtraCoord = true;\n }\n\n generateCoordCount--;\n }\n\n resultItem.name == null && (resultItem.name = genName(resultItem.coordDim, dataDimNameMap));\n\n if (resultItem.type == null && guessOrdinal(source, resultDimIdx, resultItem.name)) {\n resultItem.type = 'ordinal';\n }\n }\n\n return result;\n} // ??? TODO\n// Originally detect dimCount by data[0]. Should we\n// optimize it to only by sysDims and dimensions and encode.\n// So only necessary dims will be initialized.\n// But\n// (1) custom series should be considered. where other dims\n// may be visited.\n// (2) sometimes user need to calcualte bubble size or use visualMap\n// on other dimensions besides coordSys needed.\n// So, dims that is not used by system, should be shared in storage?\n\n\nfunction getDimCount(source, sysDims, dimsDef, optDimCount) {\n // Note that the result dimCount should not small than columns count\n // of data, otherwise `dataDimNameMap` checking will be incorrect.\n var dimCount = Math.max(source.dimensionsDetectCount || 1, sysDims.length, dimsDef.length, optDimCount || 0);\n each(sysDims, function (sysDimItem) {\n var sysDimItemDimsDef = sysDimItem.dimsDef;\n sysDimItemDimsDef && (dimCount = Math.max(dimCount, sysDimItemDimsDef.length));\n });\n return dimCount;\n}\n\nfunction genName(name, map, fromZero) {\n if (fromZero || map.get(name) != null) {\n var i = 0;\n\n while (map.get(name + i) != null) {\n i++;\n }\n\n name += i;\n }\n\n map.set(name, true);\n return name;\n}\n\nvar _default = completeDimensions;\nmodule.exports = _default;//# sourceURL=[module]\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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/data/helper/completeDimensions.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/data/helper/dimensionHelper.js": +/*!*****************************************************************!*\ + !*** ./node_modules/echarts/lib/data/helper/dimensionHelper.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _util = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar each = _util.each;\nvar createHashMap = _util.createHashMap;\nvar assert = _util.assert;\n\nvar _config = __webpack_require__(/*! ../../config */ \"./node_modules/echarts/lib/config.js\");\n\nvar __DEV__ = _config.__DEV__;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar OTHER_DIMENSIONS = createHashMap(['tooltip', 'label', 'itemName', 'itemId', 'seriesName']);\n\nfunction summarizeDimensions(data) {\n var summary = {};\n var encode = summary.encode = {};\n var notExtraCoordDimMap = createHashMap();\n var defaultedLabel = [];\n var defaultedTooltip = [];\n each(data.dimensions, function (dimName) {\n var dimItem = data.getDimensionInfo(dimName);\n var coordDim = dimItem.coordDim;\n\n if (coordDim) {\n var coordDimArr = encode[coordDim];\n\n if (!encode.hasOwnProperty(coordDim)) {\n coordDimArr = encode[coordDim] = [];\n }\n\n coordDimArr[dimItem.coordDimIndex] = dimName;\n\n if (!dimItem.isExtraCoord) {\n notExtraCoordDimMap.set(coordDim, 1); // Use the last coord dim (and label friendly) as default label,\n // because when dataset is used, it is hard to guess which dimension\n // can be value dimension. If both show x, y on label is not look good,\n // and conventionally y axis is focused more.\n\n if (mayLabelDimType(dimItem.type)) {\n defaultedLabel[0] = dimName;\n }\n }\n\n if (dimItem.defaultTooltip) {\n defaultedTooltip.push(dimName);\n }\n }\n\n OTHER_DIMENSIONS.each(function (v, otherDim) {\n var otherDimArr = encode[otherDim];\n\n if (!encode.hasOwnProperty(otherDim)) {\n otherDimArr = encode[otherDim] = [];\n }\n\n var dimIndex = dimItem.otherDims[otherDim];\n\n if (dimIndex != null && dimIndex !== false) {\n otherDimArr[dimIndex] = dimItem.name;\n }\n });\n });\n var dataDimsOnCoord = [];\n var encodeFirstDimNotExtra = {};\n notExtraCoordDimMap.each(function (v, coordDim) {\n var dimArr = encode[coordDim]; // ??? FIXME extra coord should not be set in dataDimsOnCoord.\n // But should fix the case that radar axes: simplify the logic\n // of `completeDimension`, remove `extraPrefix`.\n\n encodeFirstDimNotExtra[coordDim] = dimArr[0]; // Not necessary to remove duplicate, because a data\n // dim canot on more than one coordDim.\n\n dataDimsOnCoord = dataDimsOnCoord.concat(dimArr);\n });\n summary.dataDimsOnCoord = dataDimsOnCoord;\n summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra;\n var encodeLabel = encode.label; // FIXME `encode.label` is not recommanded, because formatter can not be set\n // in this way. Use label.formatter instead. May be remove this approach someday.\n\n if (encodeLabel && encodeLabel.length) {\n defaultedLabel = encodeLabel.slice();\n }\n\n var encodeTooltip = encode.tooltip;\n\n if (encodeTooltip && encodeTooltip.length) {\n defaultedTooltip = encodeTooltip.slice();\n } else if (!defaultedTooltip.length) {\n defaultedTooltip = defaultedLabel.slice();\n }\n\n encode.defaultedLabel = defaultedLabel;\n encode.defaultedTooltip = defaultedTooltip;\n return summary;\n}\n\nfunction getDimensionTypeByAxis(axisType) {\n return axisType === 'category' ? 'ordinal' : axisType === 'time' ? 'time' : 'float';\n}\n\nfunction mayLabelDimType(dimType) {\n // In most cases, ordinal and time do not suitable for label.\n // Ordinal info can be displayed on axis. Time is too long.\n return !(dimType === 'ordinal' || dimType === 'time');\n} // function findTheLastDimMayLabel(data) {\n// // Get last value dim\n// var dimensions = data.dimensions.slice();\n// var valueType;\n// var valueDim;\n// while (dimensions.length && (\n// valueDim = dimensions.pop(),\n// valueType = data.getDimensionInfo(valueDim).type,\n// valueType === 'ordinal' || valueType === 'time'\n// )) {} // jshint ignore:line\n// return valueDim;\n// }\n\n\nexports.OTHER_DIMENSIONS = OTHER_DIMENSIONS;\nexports.summarizeDimensions = summarizeDimensions;\nexports.getDimensionTypeByAxis = getDimensionTypeByAxis;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvZGF0YS9oZWxwZXIvZGltZW5zaW9uSGVscGVyLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL2VjaGFydHMvbGliL2RhdGEvaGVscGVyL2RpbWVuc2lvbkhlbHBlci5qcz8yZjQ1Il0sInNvdXJjZXNDb250ZW50IjpbIlxuLypcbiogTGljZW5zZWQgdG8gdGhlIEFwYWNoZSBTb2Z0d2FyZSBGb3VuZGF0aW9uIChBU0YpIHVuZGVyIG9uZVxuKiBvciBtb3JlIGNvbnRyaWJ1dG9yIGxpY2Vuc2UgYWdyZWVtZW50cy4gIFNlZSB0aGUgTk9USUNFIGZpbGVcbiogZGlzdHJpYnV0ZWQgd2l0aCB0aGlzIHdvcmsgZm9yIGFkZGl0aW9uYWwgaW5mb3JtYXRpb25cbiogcmVnYXJkaW5nIGNvcHlyaWdodCBvd25lcnNoaXAuICBUaGUgQVNGIGxpY2Vuc2VzIHRoaXMgZmlsZVxuKiB0byB5b3UgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlXG4qIFwiTGljZW5zZVwiKTsgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZVxuKiB3aXRoIHRoZSBMaWNlbnNlLiAgWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0XG4qXG4qICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wXG4qXG4qIFVubGVzcyByZXF1aX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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/data/helper/dimensionHelper.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/data/helper/sourceHelper.js": +/*!**************************************************************!*\ + !*** ./node_modules/echarts/lib/data/helper/sourceHelper.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = __webpack_require__(/*! ../../config */ \"./node_modules/echarts/lib/config.js\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar _model = __webpack_require__(/*! ../../util/model */ \"./node_modules/echarts/lib/util/model.js\");\n\nvar makeInner = _model.makeInner;\nvar getDataItemValue = _model.getDataItemValue;\n\nvar _referHelper = __webpack_require__(/*! ../../model/referHelper */ \"./node_modules/echarts/lib/model/referHelper.js\");\n\nvar getCoordSysDefineBySeries = _referHelper.getCoordSysDefineBySeries;\n\nvar _util = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar createHashMap = _util.createHashMap;\nvar each = _util.each;\nvar map = _util.map;\nvar isArray = _util.isArray;\nvar isString = _util.isString;\nvar isObject = _util.isObject;\nvar isTypedArray = _util.isTypedArray;\nvar isArrayLike = _util.isArrayLike;\nvar extend = _util.extend;\nvar assert = _util.assert;\n\nvar Source = __webpack_require__(/*! ../Source */ \"./node_modules/echarts/lib/data/Source.js\");\n\nvar _sourceType = __webpack_require__(/*! ./sourceType */ \"./node_modules/echarts/lib/data/helper/sourceType.js\");\n\nvar SOURCE_FORMAT_ORIGINAL = _sourceType.SOURCE_FORMAT_ORIGINAL;\nvar SOURCE_FORMAT_ARRAY_ROWS = _sourceType.SOURCE_FORMAT_ARRAY_ROWS;\nvar SOURCE_FORMAT_OBJECT_ROWS = _sourceType.SOURCE_FORMAT_OBJECT_ROWS;\nvar SOURCE_FORMAT_KEYED_COLUMNS = _sourceType.SOURCE_FORMAT_KEYED_COLUMNS;\nvar SOURCE_FORMAT_UNKNOWN = _sourceType.SOURCE_FORMAT_UNKNOWN;\nvar SOURCE_FORMAT_TYPED_ARRAY = _sourceType.SOURCE_FORMAT_TYPED_ARRAY;\nvar SERIES_LAYOUT_BY_ROW = _sourceType.SERIES_LAYOUT_BY_ROW;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar inner = makeInner();\n/**\n * @see {module:echarts/data/Source}\n * @param {module:echarts/component/dataset/DatasetModel} datasetModel\n * @return {string} sourceFormat\n */\n\nfunction detectSourceFormat(datasetModel) {\n var data = datasetModel.option.source;\n var sourceFormat = SOURCE_FORMAT_UNKNOWN;\n\n if (isTypedArray(data)) {\n sourceFormat = SOURCE_FORMAT_TYPED_ARRAY;\n } else if (isArray(data)) {\n // FIXME Whether tolerate null in top level array?\n if (data.length === 0) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n }\n\n for (var i = 0, len = data.length; i < len; i++) {\n var item = data[i];\n\n if (item == null) {\n continue;\n } else if (isArray(item)) {\n sourceFormat = SOURCE_FORMAT_ARRAY_ROWS;\n break;\n } else if (isObject(item)) {\n sourceFormat = SOURCE_FORMAT_OBJECT_ROWS;\n break;\n }\n }\n } else if (isObject(data)) {\n for (var key in data) {\n if (data.hasOwnProperty(key) && isArrayLike(data[key])) {\n sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS;\n break;\n }\n }\n } else if (data != null) {\n throw new Error('Invalid data');\n }\n\n inner(datasetModel).sourceFormat = sourceFormat;\n}\n/**\n * [Scenarios]:\n * (1) Provide source data directly:\n * series: {\n * encode: {...},\n * dimensions: [...]\n * seriesLayoutBy: 'row',\n * data: [[...]]\n * }\n * (2) Refer to datasetModel.\n * series: [{\n * encode: {...}\n * // Ignore datasetIndex means `datasetIndex: 0`\n * // and the dimensions defination in dataset is used\n * }, {\n * encode: {...},\n * seriesLayoutBy: 'column',\n * datasetIndex: 1\n * }]\n *\n * Get data from series itself or datset.\n * @return {module:echarts/data/Source} source\n */\n\n\nfunction getSource(seriesModel) {\n return inner(seriesModel).source;\n}\n/**\n * MUST be called before mergeOption of all series.\n * @param {module:echarts/model/Global} ecModel\n */\n\n\nfunction resetSourceDefaulter(ecModel) {\n // `datasetMap` is used to make default encode.\n inner(ecModel).datasetMap = createHashMap();\n}\n/**\n * [Caution]:\n * MUST be called after series option merged and\n * before \"series.getInitailData()\" called.\n *\n * [The rule of making default encode]:\n * Category axis (if exists) alway map to the first dimension.\n * Each other axis occupies a subsequent dimension.\n *\n * [Why make default encode]:\n * Simplify the typing of encode in option, avoiding the case like that:\n * series: [{encode: {x: 0, y: 1}}, {encode: {x: 0, y: 2}}, {encode: {x: 0, y: 3}}],\n * where the \"y\" have to be manually typed as \"1, 2, 3, ...\".\n *\n * @param {module:echarts/model/Series} seriesModel\n */\n\n\nfunction prepareSource(seriesModel) {\n var seriesOption = seriesModel.option;\n var data = seriesOption.data;\n var sourceFormat = isTypedArray(data) ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL;\n var fromDataset = false;\n var seriesLayoutBy = seriesOption.seriesLayoutBy;\n var sourceHeader = seriesOption.sourceHeader;\n var dimensionsDefine = seriesOption.dimensions;\n var datasetModel = getDatasetModel(seriesModel);\n\n if (datasetModel) {\n var datasetOption = datasetModel.option;\n data = datasetOption.source;\n sourceFormat = inner(datasetModel).sourceFormat;\n fromDataset = true; // These settings from series has higher priority.\n\n seriesLayoutBy = seriesLayoutBy || datasetOption.seriesLayoutBy;\n sourceHeader == null && (sourceHeader = datasetOption.sourceHeader);\n dimensionsDefine = dimensionsDefine || datasetOption.dimensions;\n }\n\n var completeResult = completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine); // Note: dataset option does not have `encode`.\n\n var encodeDefine = seriesOption.encode;\n\n if (!encodeDefine && datasetModel) {\n encodeDefine = makeDefaultEncode(seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult);\n }\n\n inner(seriesModel).source = new Source({\n data: data,\n fromDataset: fromDataset,\n seriesLayoutBy: seriesLayoutBy,\n sourceFormat: sourceFormat,\n dimensionsDefine: completeResult.dimensionsDefine,\n startIndex: completeResult.startIndex,\n dimensionsDetectCount: completeResult.dimensionsDetectCount,\n encodeDefine: encodeDefine\n });\n} // return {startIndex, dimensionsDefine, dimensionsCount}\n\n\nfunction completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) {\n if (!data) {\n return {\n dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine)\n };\n }\n\n var dimensionsDetectCount;\n var startIndex;\n var findPotentialName;\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n // Rule: Most of the first line are string: it is header.\n // Caution: consider a line with 5 string and 1 number,\n // it still can not be sure it is a head, because the\n // 5 string may be 5 values of category columns.\n if (sourceHeader === 'auto' || sourceHeader == null) {\n arrayRowsTravelFirst(function (val) {\n // '-' is regarded as null/undefined.\n if (val != null && val !== '-') {\n if (isString(val)) {\n startIndex == null && (startIndex = 1);\n } else {\n startIndex = 0;\n }\n } // 10 is an experience number, avoid long loop.\n\n }, seriesLayoutBy, data, 10);\n } else {\n startIndex = sourceHeader ? 1 : 0;\n }\n\n if (!dimensionsDefine && startIndex === 1) {\n dimensionsDefine = [];\n arrayRowsTravelFirst(function (val, index) {\n dimensionsDefine[index] = val != null ? val : '';\n }, seriesLayoutBy, data);\n }\n\n dimensionsDetectCount = dimensionsDefine ? dimensionsDefine.length : seriesLayoutBy === SERIES_LAYOUT_BY_ROW ? data.length : data[0] ? data[0].length : null;\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n if (!dimensionsDefine) {\n dimensionsDefine = objectRowsCollectDimensions(data);\n findPotentialName = true;\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimensionsDefine) {\n dimensionsDefine = [];\n findPotentialName = true;\n each(data, function (colArr, key) {\n dimensionsDefine.push(key);\n });\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n var value0 = getDataItemValue(data[0]);\n dimensionsDetectCount = isArray(value0) && value0.length || 1;\n } else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) {}\n\n var potentialNameDimIndex;\n\n if (findPotentialName) {\n each(dimensionsDefine, function (dim, idx) {\n if ((isObject(dim) ? dim.name : dim) === 'name') {\n potentialNameDimIndex = idx;\n }\n });\n }\n\n return {\n startIndex: startIndex,\n dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine),\n dimensionsDetectCount: dimensionsDetectCount,\n potentialNameDimIndex: potentialNameDimIndex // TODO: potentialIdDimIdx\n\n };\n} // Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'],\n// which is reasonable. But dimension name is duplicated.\n// Returns undefined or an array contains only object without null/undefiend or string.\n\n\nfunction normalizeDimensionsDefine(dimensionsDefine) {\n if (!dimensionsDefine) {\n // The meaning of null/undefined is different from empty array.\n return;\n }\n\n var nameMap = createHashMap();\n return map(dimensionsDefine, function (item, index) {\n item = extend({}, isObject(item) ? item : {\n name: item\n }); // User can set null in dimensions.\n // We dont auto specify name, othewise a given name may\n // cause it be refered unexpectedly.\n\n if (item.name == null) {\n return item;\n } // Also consider number form like 2012.\n\n\n item.name += ''; // User may also specify displayName.\n // displayName will always exists except user not\n // specified or dim name is not specified or detected.\n // (A auto generated dim name will not be used as\n // displayName).\n\n if (item.displayName == null) {\n item.displayName = item.name;\n }\n\n var exist = nameMap.get(item.name);\n\n if (!exist) {\n nameMap.set(item.name, {\n count: 1\n });\n } else {\n item.name += '-' + exist.count++;\n }\n\n return item;\n });\n}\n\nfunction arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) {\n maxLoop == null && (maxLoop = Infinity);\n\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n cb(data[i] ? data[i][0] : null, i);\n }\n } else {\n var value0 = data[0] || [];\n\n for (var i = 0; i < value0.length && i < maxLoop; i++) {\n cb(value0[i], i);\n }\n }\n}\n\nfunction objectRowsCollectDimensions(data) {\n var firstIndex = 0;\n var obj;\n\n while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line\n\n\n if (obj) {\n var dimensions = [];\n each(obj, function (value, key) {\n dimensions.push(key);\n });\n return dimensions;\n }\n} // ??? TODO merge to completedimensions, where also has\n// default encode making logic. And the default rule\n// should depends on series? consider 'map'.\n\n\nfunction makeDefaultEncode(seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult) {\n var coordSysDefine = getCoordSysDefineBySeries(seriesModel);\n var encode = {}; // var encodeTooltip = [];\n // var encodeLabel = [];\n\n var encodeItemName = [];\n var encodeSeriesName = [];\n var seriesType = seriesModel.subType; // ??? TODO refactor: provide by series itself.\n // Consider the case: 'map' series is based on geo coordSys,\n // 'graph', 'heatmap' can be based on cartesian. But can not\n // give default rule simply here.\n\n var nSeriesMap = createHashMap(['pie', 'map', 'funnel']);\n var cSeriesMap = createHashMap(['line', 'bar', 'pictorialBar', 'scatter', 'effectScatter', 'candlestick', 'boxplot']); // Usually in this case series will use the first data\n // dimension as the \"value\" dimension, or other default\n // processes respectively.\n\n if (coordSysDefine && cSeriesMap.get(seriesType) != null) {\n var ecModel = seriesModel.ecModel;\n var datasetMap = inner(ecModel).datasetMap;\n var key = datasetModel.uid + '_' + seriesLayoutBy;\n var datasetRecord = datasetMap.get(key) || datasetMap.set(key, {\n categoryWayDim: 1,\n valueWayDim: 0\n }); // TODO\n // Auto detect first time axis and do arrangement.\n\n each(coordSysDefine.coordSysDims, function (coordDim) {\n // In value way.\n if (coordSysDefine.firstCategoryDimIndex == null) {\n var dataDim = datasetRecord.valueWayDim++;\n encode[coordDim] = dataDim; // ??? TODO give a better default series name rule?\n // especially when encode x y specified.\n // consider: when mutiple series share one dimension\n // category axis, series name should better use\n // the other dimsion name. On the other hand, use\n // both dimensions name.\n\n encodeSeriesName.push(dataDim); // encodeTooltip.push(dataDim);\n // encodeLabel.push(dataDim);\n } // In category way, category axis.\n else if (coordSysDefine.categoryAxisMap.get(coordDim)) {\n encode[coordDim] = 0;\n encodeItemName.push(0);\n } // In category way, non-category axis.\n else {\n var dataDim = datasetRecord.categoryWayDim++;\n encode[coordDim] = dataDim; // encodeTooltip.push(dataDim);\n // encodeLabel.push(dataDim);\n\n encodeSeriesName.push(dataDim);\n }\n });\n } // Do not make a complex rule! Hard to code maintain and not necessary.\n // ??? TODO refactor: provide by series itself.\n // [{name: ..., value: ...}, ...] like:\n else if (nSeriesMap.get(seriesType) != null) {\n // Find the first not ordinal. (5 is an experience value)\n var firstNotOrdinal;\n\n for (var i = 0; i < 5 && firstNotOrdinal == null; i++) {\n if (!doGuessOrdinal(data, sourceFormat, seriesLayoutBy, completeResult.dimensionsDefine, completeResult.startIndex, i)) {\n firstNotOrdinal = i;\n }\n }\n\n if (firstNotOrdinal != null) {\n encode.value = firstNotOrdinal;\n var nameDimIndex = completeResult.potentialNameDimIndex || Math.max(firstNotOrdinal - 1, 0); // By default, label use itemName in charts.\n // So we dont set encodeLabel here.\n\n encodeSeriesName.push(nameDimIndex);\n encodeItemName.push(nameDimIndex); // encodeTooltip.push(firstNotOrdinal);\n }\n } // encodeTooltip.length && (encode.tooltip = encodeTooltip);\n // encodeLabel.length && (encode.label = encodeLabel);\n\n\n encodeItemName.length && (encode.itemName = encodeItemName);\n encodeSeriesName.length && (encode.seriesName = encodeSeriesName);\n return encode;\n}\n/**\n * If return null/undefined, indicate that should not use datasetModel.\n */\n\n\nfunction getDatasetModel(seriesModel) {\n var option = seriesModel.option; // Caution: consider the scenario:\n // A dataset is declared and a series is not expected to use the dataset,\n // and at the beginning `setOption({series: { noData })` (just prepare other\n // option but no data), then `setOption({series: {data: [...]}); In this case,\n // the user should set an empty array to avoid that dataset is used by default.\n\n var thisData = option.data;\n\n if (!thisData) {\n return seriesModel.ecModel.getComponent('dataset', option.datasetIndex || 0);\n }\n}\n/**\n * The rule should not be complex, otherwise user might not\n * be able to known where the data is wrong.\n * The code is ugly, but how to make it neat?\n *\n * @param {module:echars/data/Source} source\n * @param {number} dimIndex\n * @return {boolean} Whether ordinal.\n */\n\n\nfunction guessOrdinal(source, dimIndex) {\n return doGuessOrdinal(source.data, source.sourceFormat, source.seriesLayoutBy, source.dimensionsDefine, source.startIndex, dimIndex);\n} // dimIndex may be overflow source data.\n\n\nfunction doGuessOrdinal(data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex) {\n var result; // Experience value.\n\n var maxLoop = 5;\n\n if (isTypedArray(data)) {\n return false;\n } // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine\n // always exists in source.\n\n\n var dimName;\n\n if (dimensionsDefine) {\n dimName = dimensionsDefine[dimIndex];\n dimName = isObject(dimName) ? dimName.name : dimName;\n }\n\n if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) {\n if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) {\n var sample = data[dimIndex];\n\n for (var i = 0; i < (sample || []).length && i < maxLoop; i++) {\n if ((result = detectValue(sample[startIndex + i])) != null) {\n return result;\n }\n }\n } else {\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n var row = data[startIndex + i];\n\n if (row && (result = detectValue(row[dimIndex])) != null) {\n return result;\n }\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) {\n if (!dimName) {\n return;\n }\n\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n var item = data[i];\n\n if (item && (result = detectValue(item[dimName])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) {\n if (!dimName) {\n return;\n }\n\n var sample = data[dimName];\n\n if (!sample || isTypedArray(sample)) {\n return false;\n }\n\n for (var i = 0; i < sample.length && i < maxLoop; i++) {\n if ((result = detectValue(sample[i])) != null) {\n return result;\n }\n }\n } else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) {\n for (var i = 0; i < data.length && i < maxLoop; i++) {\n var item = data[i];\n var val = getDataItemValue(item);\n\n if (!isArray(val)) {\n return false;\n }\n\n if ((result = detectValue(val[dimIndex])) != null) {\n return result;\n }\n }\n }\n\n function detectValue(val) {\n // Consider usage convenience, '1', '2' will be treated as \"number\".\n // `isFinit('')` get `true`.\n if (val != null && isFinite(val) && val !== '') {\n return false;\n } else if (isString(val) && val !== '-') {\n return true;\n }\n }\n\n return false;\n}\n\nexports.detectSourceFormat = detectSourceFormat;\nexports.getSource = getSource;\nexports.resetSourceDefaulter = resetSourceDefaulter;\nexports.prepareSource = prepareSource;\nexports.guessOrdinal = guessOrdinal;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvZGF0YS9oZWxwZXIvc291cmNlSGVscGVyLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL2VjaGFydHMvbGliL2RhdGEvaGVscGVyL3NvdXJjZUhlbHBlci5qcz8wZjk5Il0sInNvdXJjZXNDb250ZW50IjpbIlxuLypcbiogTGljZW5zZWQgdG8gdGhlIEFwYWNoZSBTb2Z0d2FyZSBGb3VuZGF0aW9uIChBU0YpIHVuZGVyIG9uZVxuKiBvciBtb3JlIGNvbnRyaWJ1dG9yIGxpY2Vuc2UgYWdyZWVtZW50cy4gIFNlZSB0aGUgTk9USUNFIGZpbGVcbiogZGlzdHJpYnV0ZWQgd2l0aCB0aGlzIHdvcmsgZm9yIGFkZGl0aW9uYWwgaW5mb3JtYXRpb25cbiogcmVnYXJkaW5nIGNvcHlyaWdodCBvd25lcnNoaXAuICBUaGUgQVNGIGxpY2Vuc2VzIHRoaXMgZmlsZVx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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/data/helper/sourceHelper.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/data/helper/sourceType.js": +/*!************************************************************!*\ + !*** ./node_modules/echarts/lib/data/helper/sourceType.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Avoid typo.\nvar SOURCE_FORMAT_ORIGINAL = 'original';\nvar SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows';\nvar SOURCE_FORMAT_OBJECT_ROWS = 'objectRows';\nvar SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns';\nvar SOURCE_FORMAT_UNKNOWN = 'unknown'; // ??? CHANGE A NAME\n\nvar SOURCE_FORMAT_TYPED_ARRAY = 'typedArray';\nvar SERIES_LAYOUT_BY_COLUMN = 'column';\nvar SERIES_LAYOUT_BY_ROW = 'row';\nexports.SOURCE_FORMAT_ORIGINAL = SOURCE_FORMAT_ORIGINAL;\nexports.SOURCE_FORMAT_ARRAY_ROWS = SOURCE_FORMAT_ARRAY_ROWS;\nexports.SOURCE_FORMAT_OBJECT_ROWS = SOURCE_FORMAT_OBJECT_ROWS;\nexports.SOURCE_FORMAT_KEYED_COLUMNS = SOURCE_FORMAT_KEYED_COLUMNS;\nexports.SOURCE_FORMAT_UNKNOWN = SOURCE_FORMAT_UNKNOWN;\nexports.SOURCE_FORMAT_TYPED_ARRAY = SOURCE_FORMAT_TYPED_ARRAY;\nexports.SERIES_LAYOUT_BY_COLUMN = SERIES_LAYOUT_BY_COLUMN;\nexports.SERIES_LAYOUT_BY_ROW = SERIES_LAYOUT_BY_ROW;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvZGF0YS9oZWxwZXIvc291cmNlVHlwZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy9lY2hhcnRzL2xpYi9kYXRhL2hlbHBlci9zb3VyY2VUeXBlLmpzPzkzZDAiXSwic291cmNlc0NvbnRlbnQiOlsiXG4vKlxuKiBMaWNlbnNlZCB0byB0aGUgQXBhY2hlIFNvZn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JRVNfTEFZT1VUX0JZX0NPTFVNTjtcbmV4cG9ydHMuU0VSSUVTX0xBWU9VVF9CWV9ST1cgPSBTRVJJRVNfTEFZT1VUX0JZX1JPVzsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/data/helper/sourceType.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/model/referHelper.js": +/*!*******************************************************!*\ + !*** ./node_modules/echarts/lib/model/referHelper.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = __webpack_require__(/*! ../config */ \"./node_modules/echarts/lib/config.js\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar _util = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar createHashMap = _util.createHashMap;\nvar retrieve = _util.retrieve;\nvar each = _util.each;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\n/**\n * Helper for model references.\n * There are many manners to refer axis/coordSys.\n */\n// TODO\n// merge relevant logic to this file?\n// check: \"modelHelper\" of tooltip and \"BrushTargetManager\".\n\n/**\n * @return {Object} For example:\n * {\n * coordSysName: 'cartesian2d',\n * coordSysDims: ['x', 'y', ...],\n * axisMap: HashMap({\n * x: xAxisModel,\n * y: yAxisModel\n * }),\n * categoryAxisMap: HashMap({\n * x: xAxisModel,\n * y: undefined\n * }),\n * // It also indicate that whether there is category axis.\n * firstCategoryDimIndex: 1,\n * // To replace user specified encode.\n * }\n */\nfunction getCoordSysDefineBySeries(seriesModel) {\n var coordSysName = seriesModel.get('coordinateSystem');\n var result = {\n coordSysName: coordSysName,\n coordSysDims: [],\n axisMap: createHashMap(),\n categoryAxisMap: createHashMap()\n };\n var fetch = fetchers[coordSysName];\n\n if (fetch) {\n fetch(seriesModel, result, result.axisMap, result.categoryAxisMap);\n return result;\n }\n}\n\nvar fetchers = {\n cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) {\n var xAxisModel = seriesModel.getReferringComponents('xAxis')[0];\n var yAxisModel = seriesModel.getReferringComponents('yAxis')[0];\n result.coordSysDims = ['x', 'y'];\n axisMap.set('x', xAxisModel);\n axisMap.set('y', yAxisModel);\n\n if (isCategory(xAxisModel)) {\n categoryAxisMap.set('x', xAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n\n if (isCategory(yAxisModel)) {\n categoryAxisMap.set('y', yAxisModel);\n result.firstCategoryDimIndex = 1;\n }\n },\n singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) {\n var singleAxisModel = seriesModel.getReferringComponents('singleAxis')[0];\n result.coordSysDims = ['single'];\n axisMap.set('single', singleAxisModel);\n\n if (isCategory(singleAxisModel)) {\n categoryAxisMap.set('single', singleAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n },\n polar: function (seriesModel, result, axisMap, categoryAxisMap) {\n var polarModel = seriesModel.getReferringComponents('polar')[0];\n var radiusAxisModel = polarModel.findAxisModel('radiusAxis');\n var angleAxisModel = polarModel.findAxisModel('angleAxis');\n result.coordSysDims = ['radius', 'angle'];\n axisMap.set('radius', radiusAxisModel);\n axisMap.set('angle', angleAxisModel);\n\n if (isCategory(radiusAxisModel)) {\n categoryAxisMap.set('radius', radiusAxisModel);\n result.firstCategoryDimIndex = 0;\n }\n\n if (isCategory(angleAxisModel)) {\n categoryAxisMap.set('angle', angleAxisModel);\n result.firstCategoryDimIndex = 1;\n }\n },\n geo: function (seriesModel, result, axisMap, categoryAxisMap) {\n result.coordSysDims = ['lng', 'lat'];\n },\n parallel: function (seriesModel, result, axisMap, categoryAxisMap) {\n var ecModel = seriesModel.ecModel;\n var parallelModel = ecModel.getComponent('parallel', seriesModel.get('parallelIndex'));\n var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice();\n each(parallelModel.parallelAxisIndex, function (axisIndex, index) {\n var axisModel = ecModel.getComponent('parallelAxis', axisIndex);\n var axisDim = coordSysDims[index];\n axisMap.set(axisDim, axisModel);\n\n if (isCategory(axisModel) && result.firstCategoryDimIndex == null) {\n categoryAxisMap.set(axisDim, axisModel);\n result.firstCategoryDimIndex = index;\n }\n });\n }\n};\n\nfunction isCategory(axisModel) {\n return axisModel.get('type') === 'category';\n}\n\nexports.getCoordSysDefineBySeries = getCoordSysDefineBySeries;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvbW9kZWwvcmVmZXJIZWxwZXIuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvbW9kZWwvcmVmZXJIZWxwZXIuanM/OGI3ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJcbi8qXG4qIExpY2Vuc2VkIHRvIHRoZSBBcGFjaGUgU29mdHdhcmUgRm91bmRhdGlvbiAoQVNGKSB1bmRlciBvbmVcbiogb3IgbW9yZSBjb250cmlidXRvciBsaWNlbnNlIGFncmVlbWVudHMuICBTZWUgdGhlIE5PVElDRSBmaWxlXG4qIGRpc3RyaWJ1dGVkIHdpdGggdGhpcyB3b3JrIGZvciBhZGRpdGlvbmFsIGluZm9ybWF0aW9uXG4qIHJlZ2FyZGluZyBjb3B5cmlnaHQgb3duZXJzaGlwLiAgVGhlIEFTRiBsaWNlbnNlcyB0aGlzIGZpbGVcbiogdG8geW91IHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZVxuKiBcIkxpY2Vuc2VcIik7IHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Vcbiogd2l0aCB0aGUgTGljZW5zZS4gIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdFxuKlxuKiAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMFxuKlxuKiBVbmxlc3M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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/model/referHelper.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/util/clazz.js": +/*!************************************************!*\ + !*** ./node_modules/echarts/lib/util/clazz.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _config = __webpack_require__(/*! ../config */ \"./node_modules/echarts/lib/config.js\");\n\nvar __DEV__ = _config.__DEV__;\n\nvar zrUtil = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar TYPE_DELIMITER = '.';\nvar IS_CONTAINER = '___EC__COMPONENT__CONTAINER___';\n/**\n * Notice, parseClassType('') should returns {main: '', sub: ''}\n * @public\n */\n\nfunction parseClassType(componentType) {\n var ret = {\n main: '',\n sub: ''\n };\n\n if (componentType) {\n componentType = componentType.split(TYPE_DELIMITER);\n ret.main = componentType[0] || '';\n ret.sub = componentType[1] || '';\n }\n\n return ret;\n}\n/**\n * @public\n */\n\n\nfunction checkClassType(componentType) {\n zrUtil.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), 'componentType \"' + componentType + '\" illegal');\n}\n/**\n * @public\n */\n\n\nfunction enableClassExtend(RootClass, mandatoryMethods) {\n RootClass.$constructor = RootClass;\n\n RootClass.extend = function (proto) {\n var superClass = this;\n\n var ExtendedClass = function () {\n if (!proto.$constructor) {\n superClass.apply(this, arguments);\n } else {\n proto.$constructor.apply(this, arguments);\n }\n };\n\n zrUtil.extend(ExtendedClass.prototype, proto);\n ExtendedClass.extend = this.extend;\n ExtendedClass.superCall = superCall;\n ExtendedClass.superApply = superApply;\n zrUtil.inherits(ExtendedClass, this);\n ExtendedClass.superClass = superClass;\n return ExtendedClass;\n };\n}\n\nvar classBase = 0;\n/**\n * Can not use instanceof, consider different scope by\n * cross domain or es module import in ec extensions.\n * Mount a method \"isInstance()\" to Clz.\n */\n\nfunction enableClassCheck(Clz) {\n var classAttr = ['__\\0is_clz', classBase++, Math.random().toFixed(3)].join('_');\n Clz.prototype[classAttr] = true;\n\n Clz.isInstance = function (obj) {\n return !!(obj && obj[classAttr]);\n };\n} // superCall should have class info, which can not be fetch from 'this'.\n// Consider this case:\n// class A has method f,\n// class B inherits class A, overrides method f, f call superApply('f'),\n// class C inherits class B, do not overrides method f,\n// then when method of class C is called, dead loop occured.\n\n\nfunction superCall(context, methodName) {\n var args = zrUtil.slice(arguments, 2);\n return this.superClass.prototype[methodName].apply(context, args);\n}\n\nfunction superApply(context, methodName, args) {\n return this.superClass.prototype[methodName].apply(context, args);\n}\n/**\n * @param {Object} entity\n * @param {Object} options\n * @param {boolean} [options.registerWhenExtend]\n * @public\n */\n\n\nfunction enableClassManagement(entity, options) {\n options = options || {};\n /**\n * Component model classes\n * key: componentType,\n * value:\n * componentClass, when componentType is 'xxx'\n * or Object., when componentType is 'xxx.yy'\n * @type {Object}\n */\n\n var storage = {};\n\n entity.registerClass = function (Clazz, componentType) {\n if (componentType) {\n checkClassType(componentType);\n componentType = parseClassType(componentType);\n\n if (!componentType.sub) {\n storage[componentType.main] = Clazz;\n } else if (componentType.sub !== IS_CONTAINER) {\n var container = makeContainer(componentType);\n container[componentType.sub] = Clazz;\n }\n }\n\n return Clazz;\n };\n\n entity.getClass = function (componentMainType, subType, throwWhenNotFound) {\n var Clazz = storage[componentMainType];\n\n if (Clazz && Clazz[IS_CONTAINER]) {\n Clazz = subType ? Clazz[subType] : null;\n }\n\n if (throwWhenNotFound && !Clazz) {\n throw new Error(!subType ? componentMainType + '.' + 'type should be specified.' : 'Component ' + componentMainType + '.' + (subType || '') + ' not exists. Load it first.');\n }\n\n return Clazz;\n };\n\n entity.getClassesByMainType = function (componentType) {\n componentType = parseClassType(componentType);\n var result = [];\n var obj = storage[componentType.main];\n\n if (obj && obj[IS_CONTAINER]) {\n zrUtil.each(obj, function (o, type) {\n type !== IS_CONTAINER && result.push(o);\n });\n } else {\n result.push(obj);\n }\n\n return result;\n };\n\n entity.hasClass = function (componentType) {\n // Just consider componentType.main.\n componentType = parseClassType(componentType);\n return !!storage[componentType.main];\n };\n /**\n * @return {Array.} Like ['aa', 'bb'], but can not be ['aa.xx']\n */\n\n\n entity.getAllClassMainTypes = function () {\n var types = [];\n zrUtil.each(storage, function (obj, type) {\n types.push(type);\n });\n return types;\n };\n /**\n * If a main type is container and has sub types\n * @param {string} mainType\n * @return {boolean}\n */\n\n\n entity.hasSubTypes = function (componentType) {\n componentType = parseClassType(componentType);\n var obj = storage[componentType.main];\n return obj && obj[IS_CONTAINER];\n };\n\n entity.parseClassType = parseClassType;\n\n function makeContainer(componentType) {\n var container = storage[componentType.main];\n\n if (!container || !container[IS_CONTAINER]) {\n container = storage[componentType.main] = {};\n container[IS_CONTAINER] = true;\n }\n\n return container;\n }\n\n if (options.registerWhenExtend) {\n var originalExtend = entity.extend;\n\n if (originalExtend) {\n entity.extend = function (proto) {\n var ExtendedClass = originalExtend.call(this, proto);\n return entity.registerClass(ExtendedClass, proto.type);\n };\n }\n }\n\n return entity;\n}\n/**\n * @param {string|Array.} properties\n */\n\n\nfunction setReadOnly(obj, properties) {// FIXME It seems broken in IE8 simulation of IE11\n // if (!zrUtil.isArray(properties)) {\n // properties = properties != null ? [properties] : [];\n // }\n // zrUtil.each(properties, function (prop) {\n // var value = obj[prop];\n // Object.defineProperty\n // && Object.defineProperty(obj, prop, {\n // value: value, writable: false\n // });\n // zrUtil.isArray(obj[prop])\n // && Object.freeze\n // && Object.freeze(obj[prop]);\n // });\n}\n\nexports.parseClassType = parseClassType;\nexports.enableClassExtend = enableClassExtend;\nexports.enableClassCheck = enableClassCheck;\nexports.enableClassManagement = enableClassManagement;\nexports.setReadOnly = setReadOnly;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=ut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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/util/clazz.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/util/graphic.js": +/*!**************************************************!*\ + !*** ./node_modules/echarts/lib/util/graphic.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar pathTool = __webpack_require__(/*! zrender/lib/tool/path */ \"./node_modules/zrender/lib/tool/path.js\");\n\nvar colorTool = __webpack_require__(/*! zrender/lib/tool/color */ \"./node_modules/zrender/lib/tool/color.js\");\n\nvar matrix = __webpack_require__(/*! zrender/lib/core/matrix */ \"./node_modules/zrender/lib/core/matrix.js\");\n\nvar vector = __webpack_require__(/*! zrender/lib/core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar Path = __webpack_require__(/*! zrender/lib/graphic/Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar Transformable = __webpack_require__(/*! zrender/lib/mixin/Transformable */ \"./node_modules/zrender/lib/mixin/Transformable.js\");\n\nvar ZImage = __webpack_require__(/*! zrender/lib/graphic/Image */ \"./node_modules/zrender/lib/graphic/Image.js\");\n\nexports.Image = ZImage;\n\nvar Group = __webpack_require__(/*! zrender/lib/container/Group */ \"./node_modules/zrender/lib/container/Group.js\");\n\nexports.Group = Group;\n\nvar Text = __webpack_require__(/*! zrender/lib/graphic/Text */ \"./node_modules/zrender/lib/graphic/Text.js\");\n\nexports.Text = Text;\n\nvar Circle = __webpack_require__(/*! zrender/lib/graphic/shape/Circle */ \"./node_modules/zrender/lib/graphic/shape/Circle.js\");\n\nexports.Circle = Circle;\n\nvar Sector = __webpack_require__(/*! zrender/lib/graphic/shape/Sector */ \"./node_modules/zrender/lib/graphic/shape/Sector.js\");\n\nexports.Sector = Sector;\n\nvar Ring = __webpack_require__(/*! zrender/lib/graphic/shape/Ring */ \"./node_modules/zrender/lib/graphic/shape/Ring.js\");\n\nexports.Ring = Ring;\n\nvar Polygon = __webpack_require__(/*! zrender/lib/graphic/shape/Polygon */ \"./node_modules/zrender/lib/graphic/shape/Polygon.js\");\n\nexports.Polygon = Polygon;\n\nvar Polyline = __webpack_require__(/*! zrender/lib/graphic/shape/Polyline */ \"./node_modules/zrender/lib/graphic/shape/Polyline.js\");\n\nexports.Polyline = Polyline;\n\nvar Rect = __webpack_require__(/*! zrender/lib/graphic/shape/Rect */ \"./node_modules/zrender/lib/graphic/shape/Rect.js\");\n\nexports.Rect = Rect;\n\nvar Line = __webpack_require__(/*! zrender/lib/graphic/shape/Line */ \"./node_modules/zrender/lib/graphic/shape/Line.js\");\n\nexports.Line = Line;\n\nvar BezierCurve = __webpack_require__(/*! zrender/lib/graphic/shape/BezierCurve */ \"./node_modules/zrender/lib/graphic/shape/BezierCurve.js\");\n\nexports.BezierCurve = BezierCurve;\n\nvar Arc = __webpack_require__(/*! zrender/lib/graphic/shape/Arc */ \"./node_modules/zrender/lib/graphic/shape/Arc.js\");\n\nexports.Arc = Arc;\n\nvar CompoundPath = __webpack_require__(/*! zrender/lib/graphic/CompoundPath */ \"./node_modules/zrender/lib/graphic/CompoundPath.js\");\n\nexports.CompoundPath = CompoundPath;\n\nvar LinearGradient = __webpack_require__(/*! zrender/lib/graphic/LinearGradient */ \"./node_modules/zrender/lib/graphic/LinearGradient.js\");\n\nexports.LinearGradient = LinearGradient;\n\nvar RadialGradient = __webpack_require__(/*! zrender/lib/graphic/RadialGradient */ \"./node_modules/zrender/lib/graphic/RadialGradient.js\");\n\nexports.RadialGradient = RadialGradient;\n\nvar BoundingRect = __webpack_require__(/*! zrender/lib/core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\nexports.BoundingRect = BoundingRect;\n\nvar IncrementalDisplayable = __webpack_require__(/*! zrender/lib/graphic/IncrementalDisplayable */ \"./node_modules/zrender/lib/graphic/IncrementalDisplayable.js\");\n\nexports.IncrementalDisplayable = IncrementalDisplayable;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar round = Math.round;\nvar mathMax = Math.max;\nvar mathMin = Math.min;\nvar EMPTY_OBJ = {};\nvar Z2_EMPHASIS_LIFT = 1;\n/**\n * Extend shape with parameters\n */\n\nfunction extendShape(opts) {\n return Path.extend(opts);\n}\n/**\n * Extend path\n */\n\n\nfunction extendPath(pathData, opts) {\n return pathTool.extendFromString(pathData, opts);\n}\n/**\n * Create a path element from path data string\n * @param {string} pathData\n * @param {Object} opts\n * @param {module:zrender/core/BoundingRect} rect\n * @param {string} [layout=cover] 'center' or 'cover'\n */\n\n\nfunction makePath(pathData, opts, rect, layout) {\n var path = pathTool.createFromString(pathData, opts);\n\n if (rect) {\n if (layout === 'center') {\n rect = centerGraphic(rect, path.getBoundingRect());\n }\n\n resizePath(path, rect);\n }\n\n return path;\n}\n/**\n * Create a image element from image url\n * @param {string} imageUrl image url\n * @param {Object} opts options\n * @param {module:zrender/core/BoundingRect} rect constrain rect\n * @param {string} [layout=cover] 'center' or 'cover'\n */\n\n\nfunction makeImage(imageUrl, rect, layout) {\n var path = new ZImage({\n style: {\n image: imageUrl,\n x: rect.x,\n y: rect.y,\n width: rect.width,\n height: rect.height\n },\n onload: function (img) {\n if (layout === 'center') {\n var boundingRect = {\n width: img.width,\n height: img.height\n };\n path.setStyle(centerGraphic(rect, boundingRect));\n }\n }\n });\n return path;\n}\n/**\n * Get position of centered element in bounding box.\n *\n * @param {Object} rect element local bounding box\n * @param {Object} boundingRect constraint bounding box\n * @return {Object} element position containing x, y, width, and height\n */\n\n\nfunction centerGraphic(rect, boundingRect) {\n // Set rect to center, keep width / height ratio.\n var aspect = boundingRect.width / boundingRect.height;\n var width = rect.height * aspect;\n var height;\n\n if (width <= rect.width) {\n height = rect.height;\n } else {\n width = rect.width;\n height = width / aspect;\n }\n\n var cx = rect.x + rect.width / 2;\n var cy = rect.y + rect.height / 2;\n return {\n x: cx - width / 2,\n y: cy - height / 2,\n width: width,\n height: height\n };\n}\n\nvar mergePath = pathTool.mergePath;\n/**\n * Resize a path to fit the rect\n * @param {module:zrender/graphic/Path} path\n * @param {Object} rect\n */\n\nfunction resizePath(path, rect) {\n if (!path.applyTransform) {\n return;\n }\n\n var pathRect = path.getBoundingRect();\n var m = pathRect.calculateTransform(rect);\n path.applyTransform(m);\n}\n/**\n * Sub pixel optimize line for canvas\n *\n * @param {Object} param\n * @param {Object} [param.shape]\n * @param {number} [param.shape.x1]\n * @param {number} [param.shape.y1]\n * @param {number} [param.shape.x2]\n * @param {number} [param.shape.y2]\n * @param {Object} [param.style]\n * @param {number} [param.style.lineWidth]\n * @return {Object} Modified param\n */\n\n\nfunction subPixelOptimizeLine(param) {\n var shape = param.shape;\n var lineWidth = param.style.lineWidth;\n\n if (round(shape.x1 * 2) === round(shape.x2 * 2)) {\n shape.x1 = shape.x2 = subPixelOptimize(shape.x1, lineWidth, true);\n }\n\n if (round(shape.y1 * 2) === round(shape.y2 * 2)) {\n shape.y1 = shape.y2 = subPixelOptimize(shape.y1, lineWidth, true);\n }\n\n return param;\n}\n/**\n * Sub pixel optimize rect for canvas\n *\n * @param {Object} param\n * @param {Object} [param.shape]\n * @param {number} [param.shape.x]\n * @param {number} [param.shape.y]\n * @param {number} [param.shape.width]\n * @param {number} [param.shape.height]\n * @param {Object} [param.style]\n * @param {number} [param.style.lineWidth]\n * @return {Object} Modified param\n */\n\n\nfunction subPixelOptimizeRect(param) {\n var shape = param.shape;\n var lineWidth = param.style.lineWidth;\n var originX = shape.x;\n var originY = shape.y;\n var originWidth = shape.width;\n var originHeight = shape.height;\n shape.x = subPixelOptimize(shape.x, lineWidth, true);\n shape.y = subPixelOptimize(shape.y, lineWidth, true);\n shape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - shape.x, originWidth === 0 ? 0 : 1);\n shape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - shape.y, originHeight === 0 ? 0 : 1);\n return param;\n}\n/**\n * Sub pixel optimize for canvas\n *\n * @param {number} position Coordinate, such as x, y\n * @param {number} lineWidth Should be nonnegative integer.\n * @param {boolean=} positiveOrNegative Default false (negative).\n * @return {number} Optimized position.\n */\n\n\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n\nfunction hasFillOrStroke(fillOrStroke) {\n return fillOrStroke != null && fillOrStroke !== 'none';\n} // Most lifted color are duplicated.\n\n\nvar liftedColorMap = zrUtil.createHashMap();\nvar liftedColorCount = 0;\n\nfunction liftColor(color) {\n if (typeof color !== 'string') {\n return color;\n }\n\n var liftedColor = liftedColorMap.get(color);\n\n if (!liftedColor) {\n liftedColor = colorTool.lift(color, -0.1);\n\n if (liftedColorCount < 10000) {\n liftedColorMap.set(color, liftedColor);\n liftedColorCount++;\n }\n }\n\n return liftedColor;\n}\n\nfunction cacheElementStl(el) {\n if (!el.__hoverStlDirty) {\n return;\n }\n\n el.__hoverStlDirty = false;\n var hoverStyle = el.__hoverStl;\n\n if (!hoverStyle) {\n el.__cachedNormalStl = el.__cachedNormalZ2 = null;\n return;\n }\n\n var normalStyle = el.__cachedNormalStl = {};\n el.__cachedNormalZ2 = el.z2;\n var elStyle = el.style;\n\n for (var name in hoverStyle) {\n // See comment in `doSingleEnterHover`.\n if (hoverStyle[name] != null) {\n normalStyle[name] = elStyle[name];\n }\n } // Always cache fill and stroke to normalStyle for lifting color.\n\n\n normalStyle.fill = elStyle.fill;\n normalStyle.stroke = elStyle.stroke;\n}\n\nfunction doSingleEnterHover(el) {\n var hoverStl = el.__hoverStl;\n\n if (!hoverStl || el.__highlighted) {\n return;\n }\n\n var useHoverLayer = el.useHoverLayer;\n el.__highlighted = useHoverLayer ? 'layer' : 'plain';\n var zr = el.__zr;\n\n if (!zr && useHoverLayer) {\n return;\n }\n\n var elTarget = el;\n var targetStyle = el.style;\n\n if (useHoverLayer) {\n elTarget = zr.addHover(el);\n targetStyle = elTarget.style;\n }\n\n rollbackDefaultTextStyle(targetStyle);\n\n if (!useHoverLayer) {\n cacheElementStl(elTarget);\n } // styles can be:\n // {\n // label: {\n // show: false,\n // position: 'outside',\n // fontSize: 18\n // },\n // emphasis: {\n // label: {\n // show: true\n // }\n // }\n // },\n // where properties of `emphasis` may not appear in `normal`. We previously use\n // module:echarts/util/model#defaultEmphasis to merge `normal` to `emphasis`.\n // But consider rich text and setOption in merge mode, it is impossible to cover\n // all properties in merge. So we use merge mode when setting style here, where\n // only properties that is not `null/undefined` can be set. The disadventage:\n // null/undefined can not be used to remove style any more in `emphasis`.\n\n\n targetStyle.extendFrom(hoverStl);\n setDefaultHoverFillStroke(targetStyle, hoverStl, 'fill');\n setDefaultHoverFillStroke(targetStyle, hoverStl, 'stroke');\n applyDefaultTextStyle(targetStyle);\n\n if (!useHoverLayer) {\n el.dirty(false);\n el.z2 += Z2_EMPHASIS_LIFT;\n }\n}\n\nfunction setDefaultHoverFillStroke(targetStyle, hoverStyle, prop) {\n if (!hasFillOrStroke(hoverStyle[prop]) && hasFillOrStroke(targetStyle[prop])) {\n targetStyle[prop] = liftColor(targetStyle[prop]);\n }\n}\n\nfunction doSingleLeaveHover(el) {\n var highlighted = el.__highlighted;\n\n if (!highlighted) {\n return;\n }\n\n el.__highlighted = false;\n\n if (highlighted === 'layer') {\n el.__zr && el.__zr.removeHover(el);\n } else if (highlighted) {\n var style = el.style;\n var normalStl = el.__cachedNormalStl;\n\n if (normalStl) {\n rollbackDefaultTextStyle(style); // Consider null/undefined value, should use\n // `setStyle` but not `extendFrom(stl, true)`.\n\n el.setStyle(normalStl);\n applyDefaultTextStyle(style);\n } // `__cachedNormalZ2` will not be reset if calling `setElementHoverStyle`\n // when `el` is on emphasis state. So here by comparing with 1, we try\n // hard to make the bug case rare.\n\n\n var normalZ2 = el.__cachedNormalZ2;\n\n if (normalZ2 != null && el.z2 - normalZ2 === Z2_EMPHASIS_LIFT) {\n el.z2 = normalZ2;\n }\n }\n}\n\nfunction traverseCall(el, method) {\n el.isGroup ? el.traverse(function (child) {\n !child.isGroup && method(child);\n }) : method(el);\n}\n/**\n * Set hover style (namely \"emphasis style\") of element, based on the current\n * style of the given `el`.\n * This method should be called after all of the normal styles have been adopted\n * to the `el`. See the reason on `setHoverStyle`.\n *\n * @param {module:zrender/Element} el Should not be `zrender/container/Group`.\n * @param {Object|boolean} [hoverStl] The specified hover style.\n * If set as `false`, disable the hover style.\n * Similarly, The `el.hoverStyle` can alse be set\n * as `false` to disable the hover style.\n * Otherwise, use the default hover style if not provided.\n * @param {Object} [opt]\n * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`\n */\n\n\nfunction setElementHoverStyle(el, hoverStl) {\n // For performance consideration, it might be better to make the \"hover style\" only the\n // difference properties from the \"normal style\", but not a entire copy of all styles.\n hoverStl = el.__hoverStl = hoverStl !== false && (hoverStl || {});\n el.__hoverStlDirty = true; // FIXME\n // It is not completely right to save \"normal\"/\"emphasis\" flag on elements.\n // It probably should be saved on `data` of series. Consider the cases:\n // (1) A highlighted elements are moved out of the view port and re-enter\n // again by dataZoom.\n // (2) call `setOption` and replace elements totally when they are highlighted.\n\n if (el.__highlighted) {\n // Consider the case:\n // The styles of a highlighted `el` is being updated. The new \"emphasis style\"\n // should be adapted to the `el`. Notice here new \"normal styles\" should have\n // been set outside and the cached \"normal style\" is out of date.\n el.__cachedNormalStl = null; // Do not clear `__cachedNormalZ2` here, because setting `z2` is not a constraint\n // of this method. In most cases, `z2` is not set and hover style should be able\n // to rollback. Of course, that would bring bug, but only in a rare case, see\n // `doSingleLeaveHover` for details.\n\n doSingleLeaveHover(el);\n doSingleEnterHover(el);\n }\n}\n/**\n * Emphasis (called by API) has higher priority than `mouseover`.\n * When element has been called to be entered emphasis, mouse over\n * should not trigger the highlight effect (for example, animation\n * scale) again, and `mouseout` should not downplay the highlight\n * effect. So the listener of `mouseover` and `mouseout` should\n * check `isInEmphasis`.\n *\n * @param {module:zrender/Element} el\n * @return {boolean}\n */\n\n\nfunction isInEmphasis(el) {\n return el && el.__isEmphasisEntered;\n}\n\nfunction onElementMouseOver(e) {\n if (this.__hoverSilentOnTouch && e.zrByTouch) {\n return;\n } // Only if element is not in emphasis status\n\n\n !this.__isEmphasisEntered && traverseCall(this, doSingleEnterHover);\n}\n\nfunction onElementMouseOut(e) {\n if (this.__hoverSilentOnTouch && e.zrByTouch) {\n return;\n } // Only if element is not in emphasis status\n\n\n !this.__isEmphasisEntered && traverseCall(this, doSingleLeaveHover);\n}\n\nfunction enterEmphasis() {\n this.__isEmphasisEntered = true;\n traverseCall(this, doSingleEnterHover);\n}\n\nfunction leaveEmphasis() {\n this.__isEmphasisEntered = false;\n traverseCall(this, doSingleLeaveHover);\n}\n/**\n * Set hover style (namely \"emphasis style\") of element,\n * based on the current style of the given `el`.\n *\n * (1)\n * **CONSTRAINTS** for this method:\n * This method MUST be called after all of the normal styles having been adopted\n * to the `el`.\n * The input `hoverStyle` (that is, \"emphasis style\") MUST be the subset of the\n * \"normal style\" having been set to the el.\n * `color` MUST be one of the \"normal styles\" (because color might be lifted as\n * a default hover style).\n *\n * The reason: this method treat the current style of the `el` as the \"normal style\"\n * and cache them when enter/update the \"emphasis style\". Consider the case: the `el`\n * is in \"emphasis\" state and `setOption`/`dispatchAction` trigger the style updating\n * logic, where the el should shift from the original emphasis style to the new\n * \"emphasis style\" and should be able to \"downplay\" back to the new \"normal style\".\n *\n * Indeed, it is error-prone to make a interface has so many constraints, but I have\n * not found a better solution yet to fit the backward compatibility, performance and\n * the current programming style.\n *\n * (2)\n * Call the method for a \"root\" element once. Do not call it for each descendants.\n * If the descendants elemenets of a group has itself hover style different from the\n * root group, we can simply mount the style on `el.hoverStyle` for them, but should\n * not call this method for them.\n *\n * @param {module:zrender/Element} el\n * @param {Object|boolean} [hoverStyle] See `graphic.setElementHoverStyle`.\n * @param {Object} [opt]\n * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`.\n */\n\n\nfunction setHoverStyle(el, hoverStyle, opt) {\n el.isGroup ? el.traverse(function (child) {\n // If element has sepcified hoverStyle, then use it instead of given hoverStyle\n // Often used when item group has a label element and it's hoverStyle is different\n !child.isGroup && setElementHoverStyle(child, child.hoverStyle || hoverStyle);\n }) : setElementHoverStyle(el, el.hoverStyle || hoverStyle);\n setAsHoverStyleTrigger(el, opt);\n}\n/**\n * @param {Object|boolean} [opt] If `false`, means disable trigger.\n * @param {boolean} [opt.hoverSilentOnTouch=false]\n * In touch device, mouseover event will be trigger on touchstart event\n * (see module:zrender/dom/HandlerProxy). By this mechanism, we can\n * conveniently use hoverStyle when tap on touch screen without additional\n * code for compatibility.\n * But if the chart/component has select feature, which usually also use\n * hoverStyle, there might be conflict between 'select-highlight' and\n * 'hover-highlight' especially when roam is enabled (see geo for example).\n * In this case, hoverSilentOnTouch should be used to disable hover-highlight\n * on touch device.\n */\n\n\nfunction setAsHoverStyleTrigger(el, opt) {\n var disable = opt === false;\n el.__hoverSilentOnTouch = opt != null && opt.hoverSilentOnTouch; // Simple optimize, since this method might be\n // called for each elements of a group in some cases.\n\n if (!disable || el.__hoverStyleTrigger) {\n var method = disable ? 'off' : 'on'; // Duplicated function will be auto-ignored, see Eventful.js.\n\n el[method]('mouseover', onElementMouseOver)[method]('mouseout', onElementMouseOut); // Emphasis, normal can be triggered manually\n\n el[method]('emphasis', enterEmphasis)[method]('normal', leaveEmphasis);\n el.__hoverStyleTrigger = !disable;\n }\n}\n/**\n * See more info in `setTextStyleCommon`.\n * @param {Object|module:zrender/graphic/Style} normalStyle\n * @param {Object} emphasisStyle\n * @param {module:echarts/model/Model} normalModel\n * @param {module:echarts/model/Model} emphasisModel\n * @param {Object} opt Check `opt` of `setTextStyleCommon` to find other props.\n * @param {string|Function} [opt.defaultText]\n * @param {module:echarts/model/Model} [opt.labelFetcher] Fetch text by\n * `opt.labelFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`\n * @param {module:echarts/model/Model} [opt.labelDataIndex] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`\n * @param {module:echarts/model/Model} [opt.labelDimIndex] Fetch text by\n * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)`\n * @param {Object} [normalSpecified]\n * @param {Object} [emphasisSpecified]\n */\n\n\nfunction setLabelStyle(normalStyle, emphasisStyle, normalModel, emphasisModel, opt, normalSpecified, emphasisSpecified) {\n opt = opt || EMPTY_OBJ;\n var labelFetcher = opt.labelFetcher;\n var labelDataIndex = opt.labelDataIndex;\n var labelDimIndex = opt.labelDimIndex; // This scenario, `label.normal.show = true; label.emphasis.show = false`,\n // is not supported util someone requests.\n\n var showNormal = normalModel.getShallow('show');\n var showEmphasis = emphasisModel.getShallow('show'); // Consider performance, only fetch label when necessary.\n // If `normal.show` is `false` and `emphasis.show` is `true` and `emphasis.formatter` is not set,\n // label should be displayed, where text is fetched by `normal.formatter` or `opt.defaultText`.\n\n var baseText;\n\n if (showNormal || showEmphasis) {\n if (labelFetcher) {\n baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex);\n }\n\n if (baseText == null) {\n baseText = zrUtil.isFunction(opt.defaultText) ? opt.defaultText(labelDataIndex, opt) : opt.defaultText;\n }\n }\n\n var normalStyleText = showNormal ? baseText : null;\n var emphasisStyleText = showEmphasis ? zrUtil.retrieve2(labelFetcher ? labelFetcher.getFormattedLabel(labelDataIndex, 'emphasis', null, labelDimIndex) : null, baseText) : null; // Optimize: If style.text is null, text will not be drawn.\n\n if (normalStyleText != null || emphasisStyleText != null) {\n // Always set `textStyle` even if `normalStyle.text` is null, because default\n // values have to be set on `normalStyle`.\n // If we set default values on `emphasisStyle`, consider case:\n // Firstly, `setOption(... label: {normal: {text: null}, emphasis: {show: true}} ...);`\n // Secondly, `setOption(... label: {noraml: {show: true, text: 'abc', color: 'red'} ...);`\n // Then the 'red' will not work on emphasis.\n setTextStyle(normalStyle, normalModel, normalSpecified, opt);\n setTextStyle(emphasisStyle, emphasisModel, emphasisSpecified, opt, true);\n }\n\n normalStyle.text = normalStyleText;\n emphasisStyle.text = emphasisStyleText;\n}\n/**\n * Set basic textStyle properties.\n * See more info in `setTextStyleCommon`.\n * @param {Object|module:zrender/graphic/Style} textStyle\n * @param {module:echarts/model/Model} model\n * @param {Object} [specifiedTextStyle] Can be overrided by settings in model.\n * @param {Object} [opt] See `opt` of `setTextStyleCommon`.\n * @param {boolean} [isEmphasis]\n */\n\n\nfunction setTextStyle(textStyle, textStyleModel, specifiedTextStyle, opt, isEmphasis) {\n setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis);\n specifiedTextStyle && zrUtil.extend(textStyle, specifiedTextStyle); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n\n return textStyle;\n}\n/**\n * Set text option in the style.\n * See more info in `setTextStyleCommon`.\n * @deprecated\n * @param {Object} textStyle\n * @param {module:echarts/model/Model} labelModel\n * @param {string|boolean} defaultColor Default text color.\n * If set as false, it will be processed as a emphasis style.\n */\n\n\nfunction setText(textStyle, labelModel, defaultColor) {\n var opt = {\n isRectText: true\n };\n var isEmphasis;\n\n if (defaultColor === false) {\n isEmphasis = true;\n } else {\n // Support setting color as 'auto' to get visual color.\n opt.autoColor = defaultColor;\n }\n\n setTextStyleCommon(textStyle, labelModel, opt, isEmphasis); // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false);\n}\n/**\n * The uniform entry of set text style, that is, retrieve style definitions\n * from `model` and set to `textStyle` object.\n *\n * Never in merge mode, but in overwrite mode, that is, all of the text style\n * properties will be set. (Consider the states of normal and emphasis and\n * default value can be adopted, merge would make the logic too complicated\n * to manage.)\n *\n * The `textStyle` object can either be a plain object or an instance of\n * `zrender/src/graphic/Style`, and either be the style of normal or emphasis.\n * After this mothod called, the `textStyle` object can then be used in\n * `el.setStyle(textStyle)` or `el.hoverStyle = textStyle`.\n *\n * Default value will be adopted and `insideRollbackOpt` will be created.\n * See `applyDefaultTextStyle` `rollbackDefaultTextStyle` for more details.\n *\n * opt: {\n * disableBox: boolean, Whether diable drawing box of block (outer most).\n * isRectText: boolean,\n * autoColor: string, specify a color when color is 'auto',\n * for textFill, textStroke, textBackgroundColor, and textBorderColor.\n * If autoColor specified, it is used as default textFill.\n * useInsideStyle:\n * `true`: Use inside style (textFill, textStroke, textStrokeWidth)\n * if `textFill` is not specified.\n * `false`: Do not use inside style.\n * `null/undefined`: use inside style if `isRectText` is true and\n * `textFill` is not specified and textPosition contains `'inside'`.\n * forceRich: boolean\n * }\n */\n\n\nfunction setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis) {\n // Consider there will be abnormal when merge hover style to normal style if given default value.\n opt = opt || EMPTY_OBJ;\n\n if (opt.isRectText) {\n var textPosition = textStyleModel.getShallow('position') || (isEmphasis ? null : 'inside'); // 'outside' is not a valid zr textPostion value, but used\n // in bar series, and magric type should be considered.\n\n textPosition === 'outside' && (textPosition = 'top');\n textStyle.textPosition = textPosition;\n textStyle.textOffset = textStyleModel.getShallow('offset');\n var labelRotate = textStyleModel.getShallow('rotate');\n labelRotate != null && (labelRotate *= Math.PI / 180);\n textStyle.textRotation = labelRotate;\n textStyle.textDistance = zrUtil.retrieve2(textStyleModel.getShallow('distance'), isEmphasis ? null : 5);\n }\n\n var ecModel = textStyleModel.ecModel;\n var globalTextStyle = ecModel && ecModel.option.textStyle; // Consider case:\n // {\n // data: [{\n // value: 12,\n // label: {\n // rich: {\n // // no 'a' here but using parent 'a'.\n // }\n // }\n // }],\n // rich: {\n // a: { ... }\n // }\n // }\n\n var richItemNames = getRichItemNames(textStyleModel);\n var richResult;\n\n if (richItemNames) {\n richResult = {};\n\n for (var name in richItemNames) {\n if (richItemNames.hasOwnProperty(name)) {\n // Cascade is supported in rich.\n var richTextStyle = textStyleModel.getModel(['rich', name]); // In rich, never `disableBox`.\n\n setTokenTextStyle(richResult[name] = {}, richTextStyle, globalTextStyle, opt, isEmphasis);\n }\n }\n }\n\n textStyle.rich = richResult;\n setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEmphasis, true);\n\n if (opt.forceRich && !opt.textStyle) {\n opt.textStyle = {};\n }\n\n return textStyle;\n} // Consider case:\n// {\n// data: [{\n// value: 12,\n// label: {\n// rich: {\n// // no 'a' here but using parent 'a'.\n// }\n// }\n// }],\n// rich: {\n// a: { ... }\n// }\n// }\n\n\nfunction getRichItemNames(textStyleModel) {\n // Use object to remove duplicated names.\n var richItemNameMap;\n\n while (textStyleModel && textStyleModel !== textStyleModel.ecModel) {\n var rich = (textStyleModel.option || EMPTY_OBJ).rich;\n\n if (rich) {\n richItemNameMap = richItemNameMap || {};\n\n for (var name in rich) {\n if (rich.hasOwnProperty(name)) {\n richItemNameMap[name] = 1;\n }\n }\n }\n\n textStyleModel = textStyleModel.parentModel;\n }\n\n return richItemNameMap;\n}\n\nfunction setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEmphasis, isBlock) {\n // In merge mode, default value should not be given.\n globalTextStyle = !isEmphasis && globalTextStyle || EMPTY_OBJ;\n textStyle.textFill = getAutoColor(textStyleModel.getShallow('color'), opt) || globalTextStyle.color;\n textStyle.textStroke = getAutoColor(textStyleModel.getShallow('textBorderColor'), opt) || globalTextStyle.textBorderColor;\n textStyle.textStrokeWidth = zrUtil.retrieve2(textStyleModel.getShallow('textBorderWidth'), globalTextStyle.textBorderWidth); // Save original textPosition, because style.textPosition will be repalced by\n // real location (like [10, 30]) in zrender.\n\n textStyle.insideRawTextPosition = textStyle.textPosition;\n\n if (!isEmphasis) {\n if (isBlock) {\n textStyle.insideRollbackOpt = opt;\n applyDefaultTextStyle(textStyle);\n } // Set default finally.\n\n\n if (textStyle.textFill == null) {\n textStyle.textFill = opt.autoColor;\n }\n } // Do not use `getFont` here, because merge should be supported, where\n // part of these properties may be changed in emphasis style, and the\n // others should remain their original value got from normal style.\n\n\n textStyle.fontStyle = textStyleModel.getShallow('fontStyle') || globalTextStyle.fontStyle;\n textStyle.fontWeight = textStyleModel.getShallow('fontWeight') || globalTextStyle.fontWeight;\n textStyle.fontSize = textStyleModel.getShallow('fontSize') || globalTextStyle.fontSize;\n textStyle.fontFamily = textStyleModel.getShallow('fontFamily') || globalTextStyle.fontFamily;\n textStyle.textAlign = textStyleModel.getShallow('align');\n textStyle.textVerticalAlign = textStyleModel.getShallow('verticalAlign') || textStyleModel.getShallow('baseline');\n textStyle.textLineHeight = textStyleModel.getShallow('lineHeight');\n textStyle.textWidth = textStyleModel.getShallow('width');\n textStyle.textHeight = textStyleModel.getShallow('height');\n textStyle.textTag = textStyleModel.getShallow('tag');\n\n if (!isBlock || !opt.disableBox) {\n textStyle.textBackgroundColor = getAutoColor(textStyleModel.getShallow('backgroundColor'), opt);\n textStyle.textPadding = textStyleModel.getShallow('padding');\n textStyle.textBorderColor = getAutoColor(textStyleModel.getShallow('borderColor'), opt);\n textStyle.textBorderWidth = textStyleModel.getShallow('borderWidth');\n textStyle.textBorderRadius = textStyleModel.getShallow('borderRadius');\n textStyle.textBoxShadowColor = textStyleModel.getShallow('shadowColor');\n textStyle.textBoxShadowBlur = textStyleModel.getShallow('shadowBlur');\n textStyle.textBoxShadowOffsetX = textStyleModel.getShallow('shadowOffsetX');\n textStyle.textBoxShadowOffsetY = textStyleModel.getShallow('shadowOffsetY');\n }\n\n textStyle.textShadowColor = textStyleModel.getShallow('textShadowColor') || globalTextStyle.textShadowColor;\n textStyle.textShadowBlur = textStyleModel.getShallow('textShadowBlur') || globalTextStyle.textShadowBlur;\n textStyle.textShadowOffsetX = textStyleModel.getShallow('textShadowOffsetX') || globalTextStyle.textShadowOffsetX;\n textStyle.textShadowOffsetY = textStyleModel.getShallow('textShadowOffsetY') || globalTextStyle.textShadowOffsetY;\n}\n\nfunction getAutoColor(color, opt) {\n return color !== 'auto' ? color : opt && opt.autoColor ? opt.autoColor : null;\n}\n/**\n * Give some default value to the input `textStyle` object, based on the current settings\n * in this `textStyle` object.\n *\n * The Scenario:\n * when text position is `inside` and `textFill` is not specified, we show\n * text border by default for better view. But it should be considered that text position\n * might be changed when hovering or being emphasis, where the `insideRollback` is used to\n * restore the style.\n *\n * Usage (& NOTICE):\n * When a style object (eithor plain object or instance of `zrender/src/graphic/Style`) is\n * about to be modified on its text related properties, `rollbackDefaultTextStyle` should\n * be called before the modification and `applyDefaultTextStyle` should be called after that.\n * (For the case that all of the text related properties is reset, like `setTextStyleCommon`\n * does, `rollbackDefaultTextStyle` is not needed to be called).\n */\n\n\nfunction applyDefaultTextStyle(textStyle) {\n var opt = textStyle.insideRollbackOpt; // Only `insideRollbackOpt` created (in `setTextStyleCommon`),\n // applyDefaultTextStyle works.\n\n if (!opt || textStyle.textFill != null) {\n return;\n }\n\n var useInsideStyle = opt.useInsideStyle;\n var textPosition = textStyle.insideRawTextPosition;\n var insideRollback;\n var autoColor = opt.autoColor;\n\n if (useInsideStyle !== false && (useInsideStyle === true || opt.isRectText && textPosition // textPosition can be [10, 30]\n && typeof textPosition === 'string' && textPosition.indexOf('inside') >= 0)) {\n insideRollback = {\n textFill: null,\n textStroke: textStyle.textStroke,\n textStrokeWidth: textStyle.textStrokeWidth\n };\n textStyle.textFill = '#fff'; // Consider text with #fff overflow its container.\n\n if (textStyle.textStroke == null) {\n textStyle.textStroke = autoColor;\n textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2);\n }\n } else if (autoColor != null) {\n insideRollback = {\n textFill: null\n };\n textStyle.textFill = autoColor;\n } // Always set `insideRollback`, for clearing previous.\n\n\n if (insideRollback) {\n textStyle.insideRollback = insideRollback;\n }\n}\n/**\n * Consider the case: in a scatter,\n * label: {\n * normal: {position: 'inside'},\n * emphasis: {position: 'top'}\n * }\n * In the normal state, the `textFill` will be set as '#fff' for pretty view (see\n * `applyDefaultTextStyle`), but when switching to emphasis state, the `textFill`\n * should be retured to 'autoColor', but not keep '#fff'.\n */\n\n\nfunction rollbackDefaultTextStyle(style) {\n var insideRollback = style.insideRollback;\n\n if (insideRollback) {\n style.textFill = insideRollback.textFill;\n style.textStroke = insideRollback.textStroke;\n style.textStrokeWidth = insideRollback.textStrokeWidth;\n style.insideRollback = null;\n }\n}\n\nfunction getFont(opt, ecModel) {\n // ecModel or default text style model.\n var gTextStyleModel = ecModel || ecModel.getModel('textStyle');\n return zrUtil.trim([// FIXME in node-canvas fontWeight is before fontStyle\n opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '', opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '', (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px', opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif'].join(' '));\n}\n\nfunction animateOrSetProps(isUpdate, el, props, animatableModel, dataIndex, cb) {\n if (typeof dataIndex === 'function') {\n cb = dataIndex;\n dataIndex = null;\n } // Do not check 'animation' property directly here. Consider this case:\n // animation model is an `itemModel`, whose does not have `isAnimationEnabled`\n // but its parent model (`seriesModel`) does.\n\n\n var animationEnabled = animatableModel && animatableModel.isAnimationEnabled();\n\n if (animationEnabled) {\n var postfix = isUpdate ? 'Update' : '';\n var duration = animatableModel.getShallow('animationDuration' + postfix);\n var animationEasing = animatableModel.getShallow('animationEasing' + postfix);\n var animationDelay = animatableModel.getShallow('animationDelay' + postfix);\n\n if (typeof animationDelay === 'function') {\n animationDelay = animationDelay(dataIndex, animatableModel.getAnimationDelayParams ? animatableModel.getAnimationDelayParams(el, dataIndex) : null);\n }\n\n if (typeof duration === 'function') {\n duration = duration(dataIndex);\n }\n\n duration > 0 ? el.animateTo(props, duration, animationDelay || 0, animationEasing, cb, !!cb) : (el.stopAnimation(), el.attr(props), cb && cb());\n } else {\n el.stopAnimation();\n el.attr(props);\n cb && cb();\n }\n}\n/**\n * Update graphic element properties with or without animation according to the\n * configuration in series.\n *\n * Caution: this method will stop previous animation.\n * So if do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n *\n * @param {module:zrender/Element} el\n * @param {Object} props\n * @param {module:echarts/model/Model} [animatableModel]\n * @param {number} [dataIndex]\n * @param {Function} [cb]\n * @example\n * graphic.updateProps(el, {\n * position: [100, 100]\n * }, seriesModel, dataIndex, function () { console.log('Animation done!'); });\n * // Or\n * graphic.updateProps(el, {\n * position: [100, 100]\n * }, seriesModel, function () { console.log('Animation done!'); });\n */\n\n\nfunction updateProps(el, props, animatableModel, dataIndex, cb) {\n animateOrSetProps(true, el, props, animatableModel, dataIndex, cb);\n}\n/**\n * Init graphic element properties with or without animation according to the\n * configuration in series.\n *\n * Caution: this method will stop previous animation.\n * So if do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n *\n * @param {module:zrender/Element} el\n * @param {Object} props\n * @param {module:echarts/model/Model} [animatableModel]\n * @param {number} [dataIndex]\n * @param {Function} cb\n */\n\n\nfunction initProps(el, props, animatableModel, dataIndex, cb) {\n animateOrSetProps(false, el, props, animatableModel, dataIndex, cb);\n}\n/**\n * Get transform matrix of target (param target),\n * in coordinate of its ancestor (param ancestor)\n *\n * @param {module:zrender/mixin/Transformable} target\n * @param {module:zrender/mixin/Transformable} [ancestor]\n */\n\n\nfunction getTransform(target, ancestor) {\n var mat = matrix.identity([]);\n\n while (target && target !== ancestor) {\n matrix.mul(mat, target.getLocalTransform(), mat);\n target = target.parent;\n }\n\n return mat;\n}\n/**\n * Apply transform to an vertex.\n * @param {Array.} target [x, y]\n * @param {Array.|TypedArray.|Object} transform Can be:\n * + Transform matrix: like [1, 0, 0, 1, 0, 0]\n * + {position, rotation, scale}, the same as `zrender/Transformable`.\n * @param {boolean=} invert Whether use invert matrix.\n * @return {Array.} [x, y]\n */\n\n\nfunction applyTransform(target, transform, invert) {\n if (transform && !zrUtil.isArrayLike(transform)) {\n transform = Transformable.getLocalTransform(transform);\n }\n\n if (invert) {\n transform = matrix.invert([], transform);\n }\n\n return vector.applyTransform([], target, transform);\n}\n/**\n * @param {string} direction 'left' 'right' 'top' 'bottom'\n * @param {Array.} transform Transform matrix: like [1, 0, 0, 1, 0, 0]\n * @param {boolean=} invert Whether use invert matrix.\n * @return {string} Transformed direction. 'left' 'right' 'top' 'bottom'\n */\n\n\nfunction transformDirection(direction, transform, invert) {\n // Pick a base, ensure that transform result will not be (0, 0).\n var hBase = transform[4] === 0 || transform[5] === 0 || transform[0] === 0 ? 1 : Math.abs(2 * transform[4] / transform[0]);\n var vBase = transform[4] === 0 || transform[5] === 0 || transform[2] === 0 ? 1 : Math.abs(2 * transform[4] / transform[2]);\n var vertex = [direction === 'left' ? -hBase : direction === 'right' ? hBase : 0, direction === 'top' ? -vBase : direction === 'bottom' ? vBase : 0];\n vertex = applyTransform(vertex, transform, invert);\n return Math.abs(vertex[0]) > Math.abs(vertex[1]) ? vertex[0] > 0 ? 'right' : 'left' : vertex[1] > 0 ? 'bottom' : 'top';\n}\n/**\n * Apply group transition animation from g1 to g2.\n * If no animatableModel, no animation.\n */\n\n\nfunction groupTransition(g1, g2, animatableModel, cb) {\n if (!g1 || !g2) {\n return;\n }\n\n function getElMap(g) {\n var elMap = {};\n g.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n elMap[el.anid] = el;\n }\n });\n return elMap;\n }\n\n function getAnimatableProps(el) {\n var obj = {\n position: vector.clone(el.position),\n rotation: el.rotation\n };\n\n if (el.shape) {\n obj.shape = zrUtil.extend({}, el.shape);\n }\n\n return obj;\n }\n\n var elMap1 = getElMap(g1);\n g2.traverse(function (el) {\n if (!el.isGroup && el.anid) {\n var oldEl = elMap1[el.anid];\n\n if (oldEl) {\n var newProp = getAnimatableProps(el);\n el.attr(getAnimatableProps(oldEl));\n updateProps(el, newProp, animatableModel, el.dataIndex);\n } // else {\n // if (el.previousProps) {\n // graphic.updateProps\n // }\n // }\n\n }\n });\n}\n/**\n * @param {Array.>} points Like: [[23, 44], [53, 66], ...]\n * @param {Object} rect {x, y, width, height}\n * @return {Array.>} A new clipped points.\n */\n\n\nfunction clipPointsByRect(points, rect) {\n // FIXME: this way migth be incorrect when grpahic clipped by a corner.\n // and when element have border.\n return zrUtil.map(points, function (point) {\n var x = point[0];\n x = mathMax(x, rect.x);\n x = mathMin(x, rect.x + rect.width);\n var y = point[1];\n y = mathMax(y, rect.y);\n y = mathMin(y, rect.y + rect.height);\n return [x, y];\n });\n}\n/**\n * @param {Object} targetRect {x, y, width, height}\n * @param {Object} rect {x, y, width, height}\n * @return {Object} A new clipped rect. If rect size are negative, return undefined.\n */\n\n\nfunction clipRectByRect(targetRect, rect) {\n var x = mathMax(targetRect.x, rect.x);\n var x2 = mathMin(targetRect.x + targetRect.width, rect.x + rect.width);\n var y = mathMax(targetRect.y, rect.y);\n var y2 = mathMin(targetRect.y + targetRect.height, rect.y + rect.height); // If the total rect is cliped, nothing, including the border,\n // should be painted. So return undefined.\n\n if (x2 >= x && y2 >= y) {\n return {\n x: x,\n y: y,\n width: x2 - x,\n height: y2 - y\n };\n }\n}\n/**\n * @param {string} iconStr Support 'image://' or 'path://' or direct svg path.\n * @param {Object} [opt] Properties of `module:zrender/Element`, except `style`.\n * @param {Object} [rect] {x, y, width, height}\n * @return {module:zrender/Element} Icon path or image element.\n */\n\n\nfunction createIcon(iconStr, opt, rect) {\n opt = zrUtil.extend({\n rectHover: true\n }, opt);\n var style = opt.style = {\n strokeNoScale: true\n };\n rect = rect || {\n x: -1,\n y: -1,\n width: 2,\n height: 2\n };\n\n if (iconStr) {\n return iconStr.indexOf('image://') === 0 ? (style.image = iconStr.slice(8), zrUtil.defaults(style, rect), new ZImage(opt)) : makePath(iconStr.replace('path://', ''), opt, rect, 'center');\n }\n}\n\nexports.Z2_EMPHASIS_LIFT = Z2_EMPHASIS_LIFT;\nexports.extendShape = extendShape;\nexports.extendPath = extendPath;\nexports.makePath = makePath;\nexports.makeImage = makeImage;\nexports.mergePath = mergePath;\nexports.resizePath = resizePath;\nexports.subPixelOptimizeLine = subPixelOptimizeLine;\nexports.subPixelOptimizeRect = subPixelOptimizeRect;\nexports.subPixelOptimize = subPixelOptimize;\nexports.setElementHoverStyle = setElementHoverStyle;\nexports.isInEmphasis = isInEmphasis;\nexports.setHoverStyle = setHoverStyle;\nexports.setAsHoverStyleTrigger = setAsHoverStyleTrigger;\nexports.setLabelStyle = setLabelStyle;\nexports.setTextStyle = setTextStyle;\nexports.setText = setText;\nexports.getFont = getFont;\nexports.updateProps = updateProps;\nexports.initProps = initProps;\nexports.getTransform = getTransform;\nexports.applyTransform = applyTransform;\nexports.transformDirection = transformDirection;\nexports.groupTransition = groupTransition;\nexports.clipPointsByRect = clipPointsByRect;\nexports.clipRectByRect = clipRectByRect;\nexports.createIcon = createIcon;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvdXRpbC9ncmFwaGljLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL2VjaGFydHMvbGliL3V0aWwvZ3JhcGhpYy5qcz8yMzA2Il0sInNvdXJjZXNDb250ZW50IjpbIlxuLypcbiogTGljZW5zZWQgdG8gdGhlIEFwYWNoZSBTb2Z0d2FyZSBGb3VuZGF0aW9uIChBU0YpIHVuZGVyIG9uZVxuKiBvciBtb3JlIGNvbnRyaWJ1dG9yIGxpY2Vuc2UgYWdyZWVtZW50cy4gIFNlZSB0aGUgTk9USUNFIGZpbGVcbiogZGlzdHJpYnV0ZWQgd2l0aCB0aGlzIHdvcmsgZm9yIGFkZGl0aW9uYWwgaW5mb3JtYXRpb25cbiogcmVnYXJkaW5nIGNvcHlyaWdodCBvd25lcnNoaXAuICBUaGUgQVNGIGxpY2Vuc2VzIHRoaXMgZmlsZVxuKiB0byB5b3UgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlXG4qIFwiTGljZW5zZVwiKTsgeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZVxuKiB3aXRoIHRoZ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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/util/graphic.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/util/model.js": +/*!************************************************!*\ + !*** ./node_modules/echarts/lib/util/model.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar env = __webpack_require__(/*! zrender/lib/core/env */ \"./node_modules/zrender/lib/core/env.js\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\nvar each = zrUtil.each;\nvar isObject = zrUtil.isObject;\nvar isArray = zrUtil.isArray;\n/**\n * Make the name displayable. But we should\n * make sure it is not duplicated with user\n * specified name, so use '\\0';\n */\n\nvar DUMMY_COMPONENT_NAME_PREFIX = 'series\\0';\n/**\n * If value is not array, then translate it to array.\n * @param {*} value\n * @return {Array} [value] or value\n */\n\nfunction normalizeToArray(value) {\n return value instanceof Array ? value : value == null ? [] : [value];\n}\n/**\n * Sync default option between normal and emphasis like `position` and `show`\n * In case some one will write code like\n * label: {\n * show: false,\n * position: 'outside',\n * fontSize: 18\n * },\n * emphasis: {\n * label: { show: true }\n * }\n * @param {Object} opt\n * @param {string} key\n * @param {Array.} subOpts\n */\n\n\nfunction defaultEmphasis(opt, key, subOpts) {\n // Caution: performance sensitive.\n if (opt) {\n opt[key] = opt[key] || {};\n opt.emphasis = opt.emphasis || {};\n opt.emphasis[key] = opt.emphasis[key] || {}; // Default emphasis option from normal\n\n for (var i = 0, len = subOpts.length; i < len; i++) {\n var subOptName = subOpts[i];\n\n if (!opt.emphasis[key].hasOwnProperty(subOptName) && opt[key].hasOwnProperty(subOptName)) {\n opt.emphasis[key][subOptName] = opt[key][subOptName];\n }\n }\n }\n}\n\nvar TEXT_STYLE_OPTIONS = ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily', 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth', 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline', 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY', 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding']; // modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([\n// 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter',\n// 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily',\n// // FIXME: deprecated, check and remove it.\n// 'textStyle'\n// ]);\n\n/**\n * The method do not ensure performance.\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\n * This helper method retieves value from data.\n * @param {string|number|Date|Array|Object} dataItem\n * @return {number|string|Date|Array.}\n */\n\nfunction getDataItemValue(dataItem) {\n return isObject(dataItem) && !isArray(dataItem) && !(dataItem instanceof Date) ? dataItem.value : dataItem;\n}\n/**\n * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}]\n * This helper method determine if dataItem has extra option besides value\n * @param {string|number|Date|Array|Object} dataItem\n */\n\n\nfunction isDataItemOption(dataItem) {\n return isObject(dataItem) && !(dataItem instanceof Array); // // markLine data can be array\n // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array));\n}\n/**\n * Mapping to exists for merge.\n *\n * @public\n * @param {Array.|Array.} exists\n * @param {Object|Array.} newCptOptions\n * @return {Array.} Result, like [{exist: ..., option: ...}, {}],\n * index of which is the same as exists.\n */\n\n\nfunction mappingToExists(exists, newCptOptions) {\n // Mapping by the order by original option (but not order of\n // new option) in merge mode. Because we should ensure\n // some specified index (like xAxisIndex) is consistent with\n // original option, which is easy to understand, espatially in\n // media query. And in most case, merge option is used to\n // update partial option but not be expected to change order.\n newCptOptions = (newCptOptions || []).slice();\n var result = zrUtil.map(exists || [], function (obj, index) {\n return {\n exist: obj\n };\n }); // Mapping by id or name if specified.\n\n each(newCptOptions, function (cptOption, index) {\n if (!isObject(cptOption)) {\n return;\n } // id has highest priority.\n\n\n for (var i = 0; i < result.length; i++) {\n if (!result[i].option // Consider name: two map to one.\n && cptOption.id != null && result[i].exist.id === cptOption.id + '') {\n result[i].option = cptOption;\n newCptOptions[index] = null;\n return;\n }\n }\n\n for (var i = 0; i < result.length; i++) {\n var exist = result[i].exist;\n\n if (!result[i].option // Consider name: two map to one.\n // Can not match when both ids exist but different.\n && (exist.id == null || cptOption.id == null) && cptOption.name != null && !isIdInner(cptOption) && !isIdInner(exist) && exist.name === cptOption.name + '') {\n result[i].option = cptOption;\n newCptOptions[index] = null;\n return;\n }\n }\n }); // Otherwise mapping by index.\n\n each(newCptOptions, function (cptOption, index) {\n if (!isObject(cptOption)) {\n return;\n }\n\n var i = 0;\n\n for (; i < result.length; i++) {\n var exist = result[i].exist;\n\n if (!result[i].option // Existing model that already has id should be able to\n // mapped to (because after mapping performed model may\n // be assigned with a id, whish should not affect next\n // mapping), except those has inner id.\n && !isIdInner(exist) // Caution:\n // Do not overwrite id. But name can be overwritten,\n // because axis use name as 'show label text'.\n // 'exist' always has id and name and we dont\n // need to check it.\n && cptOption.id == null) {\n result[i].option = cptOption;\n break;\n }\n }\n\n if (i >= result.length) {\n result.push({\n option: cptOption\n });\n }\n });\n return result;\n}\n/**\n * Make id and name for mapping result (result of mappingToExists)\n * into `keyInfo` field.\n *\n * @public\n * @param {Array.} Result, like [{exist: ..., option: ...}, {}],\n * which order is the same as exists.\n * @return {Array.} The input.\n */\n\n\nfunction makeIdAndName(mapResult) {\n // We use this id to hash component models and view instances\n // in echarts. id can be specified by user, or auto generated.\n // The id generation rule ensures new view instance are able\n // to mapped to old instance when setOption are called in\n // no-merge mode. So we generate model id by name and plus\n // type in view id.\n // name can be duplicated among components, which is convenient\n // to specify multi components (like series) by one name.\n // Ensure that each id is distinct.\n var idMap = zrUtil.createHashMap();\n each(mapResult, function (item, index) {\n var existCpt = item.exist;\n existCpt && idMap.set(existCpt.id, item);\n });\n each(mapResult, function (item, index) {\n var opt = item.option;\n zrUtil.assert(!opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, 'id duplicates: ' + (opt && opt.id));\n opt && opt.id != null && idMap.set(opt.id, item);\n !item.keyInfo && (item.keyInfo = {});\n }); // Make name and id.\n\n each(mapResult, function (item, index) {\n var existCpt = item.exist;\n var opt = item.option;\n var keyInfo = item.keyInfo;\n\n if (!isObject(opt)) {\n return;\n } // name can be overwitten. Consider case: axis.name = '20km'.\n // But id generated by name will not be changed, which affect\n // only in that case: setOption with 'not merge mode' and view\n // instance will be recreated, which can be accepted.\n\n\n keyInfo.name = opt.name != null ? opt.name + '' : existCpt ? existCpt.name // Avoid diffferent series has the same name,\n // because name may be used like in color pallet.\n : DUMMY_COMPONENT_NAME_PREFIX + index;\n\n if (existCpt) {\n keyInfo.id = existCpt.id;\n } else if (opt.id != null) {\n keyInfo.id = opt.id + '';\n } else {\n // Consider this situatoin:\n // optionA: [{name: 'a'}, {name: 'a'}, {..}]\n // optionB [{..}, {name: 'a'}, {name: 'a'}]\n // Series with the same name between optionA and optionB\n // should be mapped.\n var idNum = 0;\n\n do {\n keyInfo.id = '\\0' + keyInfo.name + '\\0' + idNum++;\n } while (idMap.get(keyInfo.id));\n }\n\n idMap.set(keyInfo.id, item);\n });\n}\n\nfunction isNameSpecified(componentModel) {\n var name = componentModel.name; // Is specified when `indexOf` get -1 or > 0.\n\n return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX));\n}\n/**\n * @public\n * @param {Object} cptOption\n * @return {boolean}\n */\n\n\nfunction isIdInner(cptOption) {\n return isObject(cptOption) && cptOption.id && (cptOption.id + '').indexOf('\\0_ec_\\0') === 0;\n}\n/**\n * A helper for removing duplicate items between batchA and batchB,\n * and in themselves, and categorize by series.\n *\n * @param {Array.} batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\n * @param {Array.} batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...]\n * @return {Array., Array.>} result: [resultBatchA, resultBatchB]\n */\n\n\nfunction compressBatches(batchA, batchB) {\n var mapA = {};\n var mapB = {};\n makeMap(batchA || [], mapA);\n makeMap(batchB || [], mapB, mapA);\n return [mapToArray(mapA), mapToArray(mapB)];\n\n function makeMap(sourceBatch, map, otherMap) {\n for (var i = 0, len = sourceBatch.length; i < len; i++) {\n var seriesId = sourceBatch[i].seriesId;\n var dataIndices = normalizeToArray(sourceBatch[i].dataIndex);\n var otherDataIndices = otherMap && otherMap[seriesId];\n\n for (var j = 0, lenj = dataIndices.length; j < lenj; j++) {\n var dataIndex = dataIndices[j];\n\n if (otherDataIndices && otherDataIndices[dataIndex]) {\n otherDataIndices[dataIndex] = null;\n } else {\n (map[seriesId] || (map[seriesId] = {}))[dataIndex] = 1;\n }\n }\n }\n }\n\n function mapToArray(map, isData) {\n var result = [];\n\n for (var i in map) {\n if (map.hasOwnProperty(i) && map[i] != null) {\n if (isData) {\n result.push(+i);\n } else {\n var dataIndices = mapToArray(map[i], true);\n dataIndices.length && result.push({\n seriesId: i,\n dataIndex: dataIndices\n });\n }\n }\n }\n\n return result;\n }\n}\n/**\n * @param {module:echarts/data/List} data\n * @param {Object} payload Contains dataIndex (means rawIndex) / dataIndexInside / name\n * each of which can be Array or primary type.\n * @return {number|Array.} dataIndex If not found, return undefined/null.\n */\n\n\nfunction queryDataIndex(data, payload) {\n if (payload.dataIndexInside != null) {\n return payload.dataIndexInside;\n } else if (payload.dataIndex != null) {\n return zrUtil.isArray(payload.dataIndex) ? zrUtil.map(payload.dataIndex, function (value) {\n return data.indexOfRawIndex(value);\n }) : data.indexOfRawIndex(payload.dataIndex);\n } else if (payload.name != null) {\n return zrUtil.isArray(payload.name) ? zrUtil.map(payload.name, function (value) {\n return data.indexOfName(value);\n }) : data.indexOfName(payload.name);\n }\n}\n/**\n * Enable property storage to any host object.\n * Notice: Serialization is not supported.\n *\n * For example:\n * var inner = zrUitl.makeInner();\n *\n * function some1(hostObj) {\n * inner(hostObj).someProperty = 1212;\n * ...\n * }\n * function some2() {\n * var fields = inner(this);\n * fields.someProperty1 = 1212;\n * fields.someProperty2 = 'xx';\n * ...\n * }\n *\n * @return {Function}\n */\n\n\nfunction makeInner() {\n // Consider different scope by es module import.\n var key = '__\\0ec_inner_' + innerUniqueIndex++ + '_' + Math.random().toFixed(5);\n return function (hostObj) {\n return hostObj[key] || (hostObj[key] = {});\n };\n}\n\nvar innerUniqueIndex = 0;\n/**\n * @param {module:echarts/model/Global} ecModel\n * @param {string|Object} finder\n * If string, e.g., 'geo', means {geoIndex: 0}.\n * If Object, could contain some of these properties below:\n * {\n * seriesIndex, seriesId, seriesName,\n * geoIndex, geoId, geoName,\n * bmapIndex, bmapId, bmapName,\n * xAxisIndex, xAxisId, xAxisName,\n * yAxisIndex, yAxisId, yAxisName,\n * gridIndex, gridId, gridName,\n * ... (can be extended)\n * }\n * Each properties can be number|string|Array.|Array.\n * For example, a finder could be\n * {\n * seriesIndex: 3,\n * geoId: ['aa', 'cc'],\n * gridName: ['xx', 'rr']\n * }\n * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify)\n * If nothing or null/undefined specified, return nothing.\n * @param {Object} [opt]\n * @param {string} [opt.defaultMainType]\n * @param {Array.} [opt.includeMainTypes]\n * @return {Object} result like:\n * {\n * seriesModels: [seriesModel1, seriesModel2],\n * seriesModel: seriesModel1, // The first model\n * geoModels: [geoModel1, geoModel2],\n * geoModel: geoModel1, // The first model\n * ...\n * }\n */\n\nfunction parseFinder(ecModel, finder, opt) {\n if (zrUtil.isString(finder)) {\n var obj = {};\n obj[finder + 'Index'] = 0;\n finder = obj;\n }\n\n var defaultMainType = opt && opt.defaultMainType;\n\n if (defaultMainType && !has(finder, defaultMainType + 'Index') && !has(finder, defaultMainType + 'Id') && !has(finder, defaultMainType + 'Name')) {\n finder[defaultMainType + 'Index'] = 0;\n }\n\n var result = {};\n each(finder, function (value, key) {\n var value = finder[key]; // Exclude 'dataIndex' and other illgal keys.\n\n if (key === 'dataIndex' || key === 'dataIndexInside') {\n result[key] = value;\n return;\n }\n\n var parsedKey = key.match(/^(\\w+)(Index|Id|Name)$/) || [];\n var mainType = parsedKey[1];\n var queryType = (parsedKey[2] || '').toLowerCase();\n\n if (!mainType || !queryType || value == null || queryType === 'index' && value === 'none' || opt && opt.includeMainTypes && zrUtil.indexOf(opt.includeMainTypes, mainType) < 0) {\n return;\n }\n\n var queryParam = {\n mainType: mainType\n };\n\n if (queryType !== 'index' || value !== 'all') {\n queryParam[queryType] = value;\n }\n\n var models = ecModel.queryComponents(queryParam);\n result[mainType + 'Models'] = models;\n result[mainType + 'Model'] = models[0];\n });\n return result;\n}\n\nfunction has(obj, prop) {\n return obj && obj.hasOwnProperty(prop);\n}\n\nfunction setAttribute(dom, key, value) {\n dom.setAttribute ? dom.setAttribute(key, value) : dom[key] = value;\n}\n\nfunction getAttribute(dom, key) {\n return dom.getAttribute ? dom.getAttribute(key) : dom[key];\n}\n\nfunction getTooltipRenderMode(renderModeOption) {\n if (renderModeOption === 'auto') {\n // Using html when `document` exists, use richText otherwise\n return env.domSupported ? 'html' : 'richText';\n } else {\n return renderModeOption || 'html';\n }\n}\n/**\n * Group a list by key.\n *\n * @param {Array} array\n * @param {Function} getKey\n * param {*} Array item\n * return {string} key\n * @return {Object} Result\n * {Array}: keys,\n * {module:zrender/core/util/HashMap} buckets: {key -> Array}\n */\n\n\nfunction groupData(array, getKey) {\n var buckets = zrUtil.createHashMap();\n var keys = [];\n zrUtil.each(array, function (item) {\n var key = getKey(item);\n (buckets.get(key) || (keys.push(key), buckets.set(key, []))).push(item);\n });\n return {\n keys: keys,\n buckets: buckets\n };\n}\n\nexports.normalizeToArray = normalizeToArray;\nexports.defaultEmphasis = defaultEmphasis;\nexports.TEXT_STYLE_OPTIONS = TEXT_STYLE_OPTIONS;\nexports.getDataItemValue = getDataItemValue;\nexports.isDataItemOption = isDataItemOption;\nexports.mappingToExists = mappingToExists;\nexports.makeIdAndName = makeIdAndName;\nexports.isNameSpecified = isNameSpecified;\nexports.isIdInner = isIdInner;\nexports.compressBatches = compressBatches;\nexports.queryDataIndex = queryDataIndex;\nexports.makeInner = makeInner;\nexports.parseFinder = parseFinder;\nexports.setAttribute = setAttribute;\nexports.getAttribute = getAttribute;\nexports.getTooltipRenderMode = getTooltipRenderMode;\nexports.groupData = groupData;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvdXRpbC9tb2RlbC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy9lY2hhcnRzL2xpYi91dGlsL21vZGVsLmpzP2UwZDMiXSwic291cmNlc0NvbnRlbnQiOlsiXG4vKlxuKiBMaWNlbnNlZCB0byB0aGUgQXBhY2hlIFNvZnR3YXJlIEZvdW5kYXRpb24gKEFTRikgdW5kZXIgb25lXG4qIG9yIG1vcmUgY29udHJpYnV0b3IgbGljZW5zZSBhZ3JlZW1lbnRzLiAgU2VlIHRoZSBOT1RJQ0UgZmlsZVxuKiBkaXN0cmlidXRlZCB3aXRoIHRoaXMgd29yayBmb3IgYWRkaXRpb25hbCBpbmZvcm1hdGlvblxuKiByZWdhcmRpbmcgY29weXJpZ2h0IG93bmVyc2hpcC4gIFRoZSBBU0YgbGljZW5zZXMgdGhpcyBmaWxlXG4qIHRvIHlvdSB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGVcbiogXCJMaWNlbnNlXCIpOyB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlXG4qIHdpdGggdGhlIExpY2Vuc2UuICBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXRcbipcbiogICBodHRwOi8vd3d3LmFwYWNoZS5vc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hdGFJbmRleF0gPSAxO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9XG5cbiAgZnVuY3Rpb24gbWFwVG9BcnJheShtYXAsIGlzRGF0YSkge1xuICAgIHZhciByZXN1bHQgPSBbXTtcblxuICAgIGZvciAodmFyIGkgaW4gbWFwKSB7XG4gICAgICBpZiAobWFwLmhhc093blByb3BlcnR5KGkpICYmIG1hcFtpXSAhPSBudWxsKSB7XG4gICAgICAgIGlmIChpc0RhdGEpIHtcbiAgICAgICAgICByZXN1bHQucHVzaCgraSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdmFyIGRhdGFJbmRpY2VzID0gbWFwVG9BcnJheShtYXBbaV0sIHRydWUpO1xuICAgICAgICAgIGRhdGFJbmRpY2VzLmxlbmd0aCAmJiByZXN1bHQucHVzaCh7XG4gICAgICAgICAgICBzZXJpZXNJZDogaSxcbiAgICAgICAgICAgIGRhdGFJbmRleDogZGF0YUluZGljZXNcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiByZXN1bHQ7XG4gIH1cbn1cbi8qKlxuICogQHBhcmFtIHttb2R1bGU6ZWNoYXJ0cy9kYXRhL0xpc3R9IGRhdGFcbiAqIEBwYXJhbSB7T2JqZWN0fSBwYXlsb2FkIENvbnRhaW5zIGRhdGFJbmRleCAobWVhbnMgcmF3SW5kZXgpIC8gZGF0YUluZGV4SW5zaWRlIC8gbmFtZVxuICogICAgICAgICAgICAgICAgICAgICAgICAgZWFjaCBvZiB3aGljaCBjYW4gYmUgQXJyYXkgb3IgcHJpbWFyeSB0eXBlLlxuICogQHJldHVybiB7bnVtYmVyfEFycmF5LjxudW1iZXI+fSBkYXRhSW5kZXggSWYgbm90IGZvdW5kLCByZXR1cm4gdW5kZWZpbmVkL251bGwuXG4gKi9cblxuXG5mdW5jdGlvbiBxdWVyeURhdGFJbmRleChkYXRhLCBwYXlsb2FkKSB7XG4gIGlmIChwY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./node_modules/echarts/lib/util/symbol.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar zrUtil = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar graphic = __webpack_require__(/*! ./graphic */ \"./node_modules/echarts/lib/util/graphic.js\");\n\nvar BoundingRect = __webpack_require__(/*! zrender/lib/core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Symbol factory\n\n/**\n * Triangle shape\n * @inner\n */\nvar Triangle = graphic.extendShape({\n type: 'triangle',\n shape: {\n cx: 0,\n cy: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var width = shape.width / 2;\n var height = shape.height / 2;\n path.moveTo(cx, cy - height);\n path.lineTo(cx + width, cy + height);\n path.lineTo(cx - width, cy + height);\n path.closePath();\n }\n});\n/**\n * Diamond shape\n * @inner\n */\n\nvar Diamond = graphic.extendShape({\n type: 'diamond',\n shape: {\n cx: 0,\n cy: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var cx = shape.cx;\n var cy = shape.cy;\n var width = shape.width / 2;\n var height = shape.height / 2;\n path.moveTo(cx, cy - height);\n path.lineTo(cx + width, cy);\n path.lineTo(cx, cy + height);\n path.lineTo(cx - width, cy);\n path.closePath();\n }\n});\n/**\n * Pin shape\n * @inner\n */\n\nvar Pin = graphic.extendShape({\n type: 'pin',\n shape: {\n // x, y on the cusp\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (path, shape) {\n var x = shape.x;\n var y = shape.y;\n var w = shape.width / 5 * 3; // Height must be larger than width\n\n var h = Math.max(w, shape.height);\n var r = w / 2; // Dist on y with tangent point and circle center\n\n var dy = r * r / (h - r);\n var cy = y - h + r + dy;\n var angle = Math.asin(dy / r); // Dist on x with tangent point and circle center\n\n var dx = Math.cos(angle) * r;\n var tanX = Math.sin(angle);\n var tanY = Math.cos(angle);\n var cpLen = r * 0.6;\n var cpLen2 = r * 0.7;\n path.moveTo(x - dx, cy + dy);\n path.arc(x, cy, r, Math.PI - angle, Math.PI * 2 + angle);\n path.bezierCurveTo(x + dx - tanX * cpLen, cy + dy + tanY * cpLen, x, y - cpLen2, x, y);\n path.bezierCurveTo(x, y - cpLen2, x - dx + tanX * cpLen, cy + dy + tanY * cpLen, x - dx, cy + dy);\n path.closePath();\n }\n});\n/**\n * Arrow shape\n * @inner\n */\n\nvar Arrow = graphic.extendShape({\n type: 'arrow',\n shape: {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (ctx, shape) {\n var height = shape.height;\n var width = shape.width;\n var x = shape.x;\n var y = shape.y;\n var dx = width / 3 * 2;\n ctx.moveTo(x, y);\n ctx.lineTo(x + dx, y + height);\n ctx.lineTo(x, y + height / 4 * 3);\n ctx.lineTo(x - dx, y + height);\n ctx.lineTo(x, y);\n ctx.closePath();\n }\n});\n/**\n * Map of path contructors\n * @type {Object.}\n */\n\nvar symbolCtors = {\n line: graphic.Line,\n rect: graphic.Rect,\n roundRect: graphic.Rect,\n square: graphic.Rect,\n circle: graphic.Circle,\n diamond: Diamond,\n pin: Pin,\n arrow: Arrow,\n triangle: Triangle\n};\nvar symbolShapeMakers = {\n line: function (x, y, w, h, shape) {\n // FIXME\n shape.x1 = x;\n shape.y1 = y + h / 2;\n shape.x2 = x + w;\n shape.y2 = y + h / 2;\n },\n rect: function (x, y, w, h, shape) {\n shape.x = x;\n shape.y = y;\n shape.width = w;\n shape.height = h;\n },\n roundRect: function (x, y, w, h, shape) {\n shape.x = x;\n shape.y = y;\n shape.width = w;\n shape.height = h;\n shape.r = Math.min(w, h) / 4;\n },\n square: function (x, y, w, h, shape) {\n var size = Math.min(w, h);\n shape.x = x;\n shape.y = y;\n shape.width = size;\n shape.height = size;\n },\n circle: function (x, y, w, h, shape) {\n // Put circle in the center of square\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.r = Math.min(w, h) / 2;\n },\n diamond: function (x, y, w, h, shape) {\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n pin: function (x, y, w, h, shape) {\n shape.x = x + w / 2;\n shape.y = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n arrow: function (x, y, w, h, shape) {\n shape.x = x + w / 2;\n shape.y = y + h / 2;\n shape.width = w;\n shape.height = h;\n },\n triangle: function (x, y, w, h, shape) {\n shape.cx = x + w / 2;\n shape.cy = y + h / 2;\n shape.width = w;\n shape.height = h;\n }\n};\nvar symbolBuildProxies = {};\nzrUtil.each(symbolCtors, function (Ctor, name) {\n symbolBuildProxies[name] = new Ctor();\n});\nvar SymbolClz = graphic.extendShape({\n type: 'symbol',\n shape: {\n symbolType: '',\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n beforeBrush: function () {\n var style = this.style;\n var shape = this.shape; // FIXME\n\n if (shape.symbolType === 'pin' && style.textPosition === 'inside') {\n style.textPosition = ['50%', '40%'];\n style.textAlign = 'center';\n style.textVerticalAlign = 'middle';\n }\n },\n buildPath: function (ctx, shape, inBundle) {\n var symbolType = shape.symbolType;\n var proxySymbol = symbolBuildProxies[symbolType];\n\n if (shape.symbolType !== 'none') {\n if (!proxySymbol) {\n // Default rect\n symbolType = 'rect';\n proxySymbol = symbolBuildProxies[symbolType];\n }\n\n symbolShapeMakers[symbolType](shape.x, shape.y, shape.width, shape.height, proxySymbol.shape);\n proxySymbol.buildPath(ctx, proxySymbol.shape, inBundle);\n }\n }\n}); // Provide setColor helper method to avoid determine if set the fill or stroke outside\n\nfunction symbolPathSetColor(color, innerColor) {\n if (this.type !== 'image') {\n var symbolStyle = this.style;\n var symbolShape = this.shape;\n\n if (symbolShape && symbolShape.symbolType === 'line') {\n symbolStyle.stroke = color;\n } else if (this.__isEmptyBrush) {\n symbolStyle.stroke = color;\n symbolStyle.fill = innerColor || '#fff';\n } else {\n // FIXME 判断图形默认是填充还是描边,使用 onlyStroke ?\n symbolStyle.fill && (symbolStyle.fill = color);\n symbolStyle.stroke && (symbolStyle.stroke = color);\n }\n\n this.dirty(false);\n }\n}\n/**\n * Create a symbol element with given symbol configuration: shape, x, y, width, height, color\n * @param {string} symbolType\n * @param {number} x\n * @param {number} y\n * @param {number} w\n * @param {number} h\n * @param {string} color\n * @param {boolean} [keepAspect=false] whether to keep the ratio of w/h,\n * for path and image only.\n */\n\n\nfunction createSymbol(symbolType, x, y, w, h, color, keepAspect) {\n // TODO Support image object, DynamicImage.\n var isEmpty = symbolType.indexOf('empty') === 0;\n\n if (isEmpty) {\n symbolType = symbolType.substr(5, 1).toLowerCase() + symbolType.substr(6);\n }\n\n var symbolPath;\n\n if (symbolType.indexOf('image://') === 0) {\n symbolPath = graphic.makeImage(symbolType.slice(8), new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n } else if (symbolType.indexOf('path://') === 0) {\n symbolPath = graphic.makePath(symbolType.slice(7), {}, new BoundingRect(x, y, w, h), keepAspect ? 'center' : 'cover');\n } else {\n symbolPath = new SymbolClz({\n shape: {\n symbolType: symbolType,\n x: x,\n y: y,\n width: w,\n height: h\n }\n });\n }\n\n symbolPath.__isEmptyBrush = isEmpty;\n symbolPath.setColor = symbolPathSetColor;\n symbolPath.setColor(color);\n return symbolPath;\n}\n\nexports.createSymbol = createSymbol;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvdXRpbC9zeW1ib2wuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvZWNoYXJ0cy9saWIvdXRpbC9zeW1ib2wuanM/YTE1YSJdLCJzb3VyY2VzQ29udGVudCI6WyJcbi8qXG4qIExpY2Vuc2VkIHRvIHRoZSBBcGFjaGUgU29mdHdhcmUgRm91bmRhdGlvbiAoQVNGKSB1bmRlciBvbmVcbiogb3IgbW9yZSBjb250cmlidXRvciBsaWNlbnNlIGFncmVlbWVudHMuICBTZWUgdGhlIE5PVElDRSBmaWxlXG4qIGRpc3RyaWJ1dGVkIHdpdGggdGhpcyB3b3JrIGZvciBhZGRpdGlvbmFsIGluZm9ybWF0aW9uXG4qIHJlZ2FyZGluZyBjb3B5cmlnaHQgb3duZXJzaGlwLiAgVGhlIEFTRiBsaWNlbnNlcyB0aGlzIGZpbGVcbiogdG8geW91IHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZVxuKiBcIkxpY2Vuc2VcIik7IHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Vcbiogd2l0a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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/util/symbol.js\n"); + +/***/ }), + +/***/ "./node_modules/echarts/lib/visual/dataColor.js": +/*!******************************************************!*\ + !*** ./node_modules/echarts/lib/visual/dataColor.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n\nvar _util = __webpack_require__(/*! zrender/lib/core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar createHashMap = _util.createHashMap;\n\n/*\n* Licensed to the Apache Software Foundation (ASF) under one\n* or more contributor license agreements. See the NOTICE file\n* distributed with this work for additional information\n* regarding copyright ownership. The ASF licenses this file\n* to you under the Apache License, Version 2.0 (the\n* \"License\"); you may not use this file except in compliance\n* with the License. You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing,\n* software distributed under the License is distributed on an\n* \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n* KIND, either express or implied. See the License for the\n* specific language governing permissions and limitations\n* under the License.\n*/\n// Pick color from palette for each data item.\n// Applicable for charts that require applying color palette\n// in data level (like pie, funnel, chord).\nfunction _default(seriesType) {\n return {\n getTargetSeries: function (ecModel) {\n // Pie and funnel may use diferrent scope\n var paletteScope = {};\n var seiresModelMap = createHashMap();\n ecModel.eachSeriesByType(seriesType, function (seriesModel) {\n seriesModel.__paletteScope = paletteScope;\n seiresModelMap.set(seriesModel.uid, seriesModel);\n });\n return seiresModelMap;\n },\n reset: function (seriesModel, ecModel) {\n var dataAll = seriesModel.getRawData();\n var idxMap = {};\n var data = seriesModel.getData();\n data.each(function (idx) {\n var rawIdx = data.getRawIndex(idx);\n idxMap[rawIdx] = idx;\n });\n dataAll.each(function (rawIdx) {\n var filteredIdx = idxMap[rawIdx]; // If series.itemStyle.normal.color is a function. itemVisual may be encoded\n\n var singleDataColor = filteredIdx != null && data.getItemVisual(filteredIdx, 'color', true);\n\n if (!singleDataColor) {\n // FIXME Performance\n var itemModel = dataAll.getItemModel(rawIdx);\n var color = itemModel.get('itemStyle.color') || seriesModel.getColorFromPalette(dataAll.getName(rawIdx) || rawIdx + '', seriesModel.__paletteScope, dataAll.count()); // Legend may use the visual info in data before processed\n\n dataAll.setItemVisual(rawIdx, 'color', color); // Data is not filtered\n\n if (filteredIdx != null) {\n data.setItemVisual(filteredIdx, 'color', color);\n }\n } else {\n // Set data all color for legend\n dataAll.setItemVisual(rawIdx, 'color', singleDataColor);\n }\n });\n }\n };\n}\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJ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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/echarts/lib/visual/dataColor.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/Element.js": +/*!*********************************************!*\ + !*** ./node_modules/zrender/lib/Element.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var guid = __webpack_require__(/*! ./core/guid */ \"./node_modules/zrender/lib/core/guid.js\");\n\nvar Eventful = __webpack_require__(/*! ./mixin/Eventful */ \"./node_modules/zrender/lib/mixin/Eventful.js\");\n\nvar Transformable = __webpack_require__(/*! ./mixin/Transformable */ \"./node_modules/zrender/lib/mixin/Transformable.js\");\n\nvar Animatable = __webpack_require__(/*! ./mixin/Animatable */ \"./node_modules/zrender/lib/mixin/Animatable.js\");\n\nvar zrUtil = __webpack_require__(/*! ./core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\n/**\n * @alias module:zrender/Element\n * @constructor\n * @extends {module:zrender/mixin/Animatable}\n * @extends {module:zrender/mixin/Transformable}\n * @extends {module:zrender/mixin/Eventful}\n */\nvar Element = function (opts) {\n // jshint ignore:line\n Transformable.call(this, opts);\n Eventful.call(this, opts);\n Animatable.call(this, opts);\n /**\n * 画布元素ID\n * @type {string}\n */\n\n this.id = opts.id || guid();\n};\n\nElement.prototype = {\n /**\n * 元素类型\n * Element type\n * @type {string}\n */\n type: 'element',\n\n /**\n * 元素名字\n * Element name\n * @type {string}\n */\n name: '',\n\n /**\n * ZRender 实例对象,会在 element 添加到 zrender 实例中后自动赋值\n * ZRender instance will be assigned when element is associated with zrender\n * @name module:/zrender/Element#__zr\n * @type {module:zrender/ZRender}\n */\n __zr: null,\n\n /**\n * 图形是否忽略,为true时忽略图形的绘制以及事件触发\n * If ignore drawing and events of the element object\n * @name module:/zrender/Element#ignore\n * @type {boolean}\n * @default false\n */\n ignore: false,\n\n /**\n * 用于裁剪的路径(shape),所有 Group 内的路径在绘制时都会被这个路径裁剪\n * 该路径会继承被裁减对象的变换\n * @type {module:zrender/graphic/Path}\n * @see http://www.w3.org/TR/2dcontext/#clipping-region\n * @readOnly\n */\n clipPath: null,\n\n /**\n * 是否是 Group\n * @type {boolean}\n */\n isGroup: false,\n\n /**\n * Drift element\n * @param {number} dx dx on the global space\n * @param {number} dy dy on the global space\n */\n drift: function (dx, dy) {\n switch (this.draggable) {\n case 'horizontal':\n dy = 0;\n break;\n\n case 'vertical':\n dx = 0;\n break;\n }\n\n var m = this.transform;\n\n if (!m) {\n m = this.transform = [1, 0, 0, 1, 0, 0];\n }\n\n m[4] += dx;\n m[5] += dy;\n this.decomposeTransform();\n this.dirty(false);\n },\n\n /**\n * Hook before update\n */\n beforeUpdate: function () {},\n\n /**\n * Hook after update\n */\n afterUpdate: function () {},\n\n /**\n * Update each frame\n */\n update: function () {\n this.updateTransform();\n },\n\n /**\n * @param {Function} cb\n * @param {} context\n */\n traverse: function (cb, context) {},\n\n /**\n * @protected\n */\n attrKV: function (key, value) {\n if (key === 'position' || key === 'scale' || key === 'origin') {\n // Copy the array\n if (value) {\n var target = this[key];\n\n if (!target) {\n target = this[key] = [];\n }\n\n target[0] = value[0];\n target[1] = value[1];\n }\n } else {\n this[key] = value;\n }\n },\n\n /**\n * Hide the element\n */\n hide: function () {\n this.ignore = true;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * Show the element\n */\n show: function () {\n this.ignore = false;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * @param {string|Object} key\n * @param {*} value\n */\n attr: function (key, value) {\n if (typeof key === 'string') {\n this.attrKV(key, value);\n } else if (zrUtil.isObject(key)) {\n for (var name in key) {\n if (key.hasOwnProperty(name)) {\n this.attrKV(name, key[name]);\n }\n }\n }\n\n this.dirty(false);\n return this;\n },\n\n /**\n * @param {module:zrender/graphic/Path} clipPath\n */\n setClipPath: function (clipPath) {\n var zr = this.__zr;\n\n if (zr) {\n clipPath.addSelfToZr(zr);\n } // Remove previous clip path\n\n\n if (this.clipPath && this.clipPath !== clipPath) {\n this.removeClipPath();\n }\n\n this.clipPath = clipPath;\n clipPath.__zr = zr;\n clipPath.__clipTarget = this;\n this.dirty(false);\n },\n\n /**\n */\n removeClipPath: function () {\n var clipPath = this.clipPath;\n\n if (clipPath) {\n if (clipPath.__zr) {\n clipPath.removeSelfFromZr(clipPath.__zr);\n }\n\n clipPath.__zr = null;\n clipPath.__clipTarget = null;\n this.clipPath = null;\n this.dirty(false);\n }\n },\n\n /**\n * Add self from zrender instance.\n * Not recursively because it will be invoked when element added to storage.\n * @param {module:zrender/ZRender} zr\n */\n addSelfToZr: function (zr) {\n this.__zr = zr; // 添加动画\n\n var animators = this.animators;\n\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.addAnimator(animators[i]);\n }\n }\n\n if (this.clipPath) {\n this.clipPath.addSelfToZr(zr);\n }\n },\n\n /**\n * Remove self from zrender instance.\n * Not recursively because it will be invoked when element added to storage.\n * @param {module:zrender/ZRender} zr\n */\n removeSelfFromZr: function (zr) {\n this.__zr = null; // 移除动画\n\n var animators = this.animators;\n\n if (animators) {\n for (var i = 0; i < animators.length; i++) {\n zr.animation.removeAnimator(animators[i]);\n }\n }\n\n if (this.clipPath) {\n this.clipPath.removeSelfFromZr(zr);\n }\n }\n};\nzrUtil.mixin(Element, Animatable);\nzrUtil.mixin(Element, Transformable);\nzrUtil.mixin(Element, Eventful);\nvar _default = Element;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvRWxlbWVudC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9FbGVtZW50LmpzP2Q1YjciXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGd1aWQgPSByZXF1aXJlKFwiLi9jb3JlL2d1aWRcIik7XG5cbnZhciBFdmVudGZ1bCA9IHJlcXVpcmUoXCIuL21peGluL0V2ZW50ZnVsXCIpO1xuXG52YXIgVHJhbnNmb3JtYWJsZSA9IHJlcXVpcmUoXCIuL21peGluL1RyYW5zZm9ybWFibGVcIik7XG5cbnZhciBBbmltYXRhYmxlID0gcmVxdWlyZShcIi4vbWl4aW4vQW5pbWF0YWJsZVwiKTtcblxudmFyIHpyVXRpbCA9IHJlcXVpcmUoXCIuL2NvcmUvdXRpbFwiKTtcblxuLyoqXG4gKiBAYWxpYXMgbW9kdWxlOnpyZW5kZXIvRWxlbWVudFxuICogQGNvbnN0cnVjdG9yXG4gKiBAZXh0ZW5kcyB7bW9kdWxlOnpyZW5kZXIvbWl4aW4vQW5pbWF0YWJsZX1cbiAqIEBleHRlbmRzIHttb2R1bGU6enJlbmRlci9taXhpbi9UcmFuc2Zvcm1hYmxlfVxuICogQGV4dGVuZHMge21vZHVsZTp6cmVuZGVyL21peGluL0V2ZW50ZnVsfVxuICovXG52YXIgRWxlbWVudCA9IGZ1bmN0aW9uIChvcHRzKSB7XG4gIC8vIGpzaGludCBpZ25vcmU6bGluZVxuICBUcmFuc2Zvcm1hYmxlLmNhbGwodGhpcywgb3B0cyk7XG4gIEV2ZW50ZnVsLmNhbGwodGhpcywgb3B0cyk7XG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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/Element.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/animation/Animator.js": +/*!********************************************************!*\ + !*** ./node_modules/zrender/lib/animation/Animator.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Clip = __webpack_require__(/*! ./Clip */ \"./node_modules/zrender/lib/animation/Clip.js\");\n\nvar color = __webpack_require__(/*! ../tool/color */ \"./node_modules/zrender/lib/tool/color.js\");\n\nvar _util = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar isArrayLike = _util.isArrayLike;\n\n/**\n * @module echarts/animation/Animator\n */\nvar arraySlice = Array.prototype.slice;\n\nfunction defaultGetter(target, key) {\n return target[key];\n}\n\nfunction defaultSetter(target, key, value) {\n target[key] = value;\n}\n/**\n * @param {number} p0\n * @param {number} p1\n * @param {number} percent\n * @return {number}\n */\n\n\nfunction interpolateNumber(p0, p1, percent) {\n return (p1 - p0) * percent + p0;\n}\n/**\n * @param {string} p0\n * @param {string} p1\n * @param {number} percent\n * @return {string}\n */\n\n\nfunction interpolateString(p0, p1, percent) {\n return percent > 0.5 ? p1 : p0;\n}\n/**\n * @param {Array} p0\n * @param {Array} p1\n * @param {number} percent\n * @param {Array} out\n * @param {number} arrDim\n */\n\n\nfunction interpolateArray(p0, p1, percent, out, arrDim) {\n var len = p0.length;\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n out[i] = interpolateNumber(p0[i], p1[i], percent);\n }\n } else {\n var len2 = len && p0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n out[i][j] = interpolateNumber(p0[i][j], p1[i][j], percent);\n }\n }\n }\n} // arr0 is source array, arr1 is target array.\n// Do some preprocess to avoid error happened when interpolating from arr0 to arr1\n\n\nfunction fillArr(arr0, arr1, arrDim) {\n var arr0Len = arr0.length;\n var arr1Len = arr1.length;\n\n if (arr0Len !== arr1Len) {\n // FIXME Not work for TypedArray\n var isPreviousLarger = arr0Len > arr1Len;\n\n if (isPreviousLarger) {\n // Cut the previous\n arr0.length = arr1Len;\n } else {\n // Fill the previous\n for (var i = arr0Len; i < arr1Len; i++) {\n arr0.push(arrDim === 1 ? arr1[i] : arraySlice.call(arr1[i]));\n }\n }\n } // Handling NaN value\n\n\n var len2 = arr0[0] && arr0[0].length;\n\n for (var i = 0; i < arr0.length; i++) {\n if (arrDim === 1) {\n if (isNaN(arr0[i])) {\n arr0[i] = arr1[i];\n }\n } else {\n for (var j = 0; j < len2; j++) {\n if (isNaN(arr0[i][j])) {\n arr0[i][j] = arr1[i][j];\n }\n }\n }\n }\n}\n/**\n * @param {Array} arr0\n * @param {Array} arr1\n * @param {number} arrDim\n * @return {boolean}\n */\n\n\nfunction isArraySame(arr0, arr1, arrDim) {\n if (arr0 === arr1) {\n return true;\n }\n\n var len = arr0.length;\n\n if (len !== arr1.length) {\n return false;\n }\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n if (arr0[i] !== arr1[i]) {\n return false;\n }\n }\n } else {\n var len2 = arr0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n if (arr0[i][j] !== arr1[i][j]) {\n return false;\n }\n }\n }\n }\n\n return true;\n}\n/**\n * Catmull Rom interpolate array\n * @param {Array} p0\n * @param {Array} p1\n * @param {Array} p2\n * @param {Array} p3\n * @param {number} t\n * @param {number} t2\n * @param {number} t3\n * @param {Array} out\n * @param {number} arrDim\n */\n\n\nfunction catmullRomInterpolateArray(p0, p1, p2, p3, t, t2, t3, out, arrDim) {\n var len = p0.length;\n\n if (arrDim === 1) {\n for (var i = 0; i < len; i++) {\n out[i] = catmullRomInterpolate(p0[i], p1[i], p2[i], p3[i], t, t2, t3);\n }\n } else {\n var len2 = p0[0].length;\n\n for (var i = 0; i < len; i++) {\n for (var j = 0; j < len2; j++) {\n out[i][j] = catmullRomInterpolate(p0[i][j], p1[i][j], p2[i][j], p3[i][j], t, t2, t3);\n }\n }\n }\n}\n/**\n * Catmull Rom interpolate number\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} t\n * @param {number} t2\n * @param {number} t3\n * @return {number}\n */\n\n\nfunction catmullRomInterpolate(p0, p1, p2, p3, t, t2, t3) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;\n}\n\nfunction cloneValue(value) {\n if (isArrayLike(value)) {\n var len = value.length;\n\n if (isArrayLike(value[0])) {\n var ret = [];\n\n for (var i = 0; i < len; i++) {\n ret.push(arraySlice.call(value[i]));\n }\n\n return ret;\n }\n\n return arraySlice.call(value);\n }\n\n return value;\n}\n\nfunction rgba2String(rgba) {\n rgba[0] = Math.floor(rgba[0]);\n rgba[1] = Math.floor(rgba[1]);\n rgba[2] = Math.floor(rgba[2]);\n return 'rgba(' + rgba.join(',') + ')';\n}\n\nfunction getArrayDim(keyframes) {\n var lastValue = keyframes[keyframes.length - 1].value;\n return isArrayLike(lastValue && lastValue[0]) ? 2 : 1;\n}\n\nfunction createTrackClip(animator, easing, oneTrackDone, keyframes, propName, forceAnimate) {\n var getter = animator._getter;\n var setter = animator._setter;\n var useSpline = easing === 'spline';\n var trackLen = keyframes.length;\n\n if (!trackLen) {\n return;\n } // Guess data type\n\n\n var firstVal = keyframes[0].value;\n var isValueArray = isArrayLike(firstVal);\n var isValueColor = false;\n var isValueString = false; // For vertices morphing\n\n var arrDim = isValueArray ? getArrayDim(keyframes) : 0;\n var trackMaxTime; // Sort keyframe as ascending\n\n keyframes.sort(function (a, b) {\n return a.time - b.time;\n });\n trackMaxTime = keyframes[trackLen - 1].time; // Percents of each keyframe\n\n var kfPercents = []; // Value of each keyframe\n\n var kfValues = [];\n var prevValue = keyframes[0].value;\n var isAllValueEqual = true;\n\n for (var i = 0; i < trackLen; i++) {\n kfPercents.push(keyframes[i].time / trackMaxTime); // Assume value is a color when it is a string\n\n var value = keyframes[i].value; // Check if value is equal, deep check if value is array\n\n if (!(isValueArray && isArraySame(value, prevValue, arrDim) || !isValueArray && value === prevValue)) {\n isAllValueEqual = false;\n }\n\n prevValue = value; // Try converting a string to a color array\n\n if (typeof value === 'string') {\n var colorArray = color.parse(value);\n\n if (colorArray) {\n value = colorArray;\n isValueColor = true;\n } else {\n isValueString = true;\n }\n }\n\n kfValues.push(value);\n }\n\n if (!forceAnimate && isAllValueEqual) {\n return;\n }\n\n var lastValue = kfValues[trackLen - 1]; // Polyfill array and NaN value\n\n for (var i = 0; i < trackLen - 1; i++) {\n if (isValueArray) {\n fillArr(kfValues[i], lastValue, arrDim);\n } else {\n if (isNaN(kfValues[i]) && !isNaN(lastValue) && !isValueString && !isValueColor) {\n kfValues[i] = lastValue;\n }\n }\n }\n\n isValueArray && fillArr(getter(animator._target, propName), lastValue, arrDim); // Cache the key of last frame to speed up when\n // animation playback is sequency\n\n var lastFrame = 0;\n var lastFramePercent = 0;\n var start;\n var w;\n var p0;\n var p1;\n var p2;\n var p3;\n\n if (isValueColor) {\n var rgba = [0, 0, 0, 0];\n }\n\n var onframe = function (target, percent) {\n // Find the range keyframes\n // kf1-----kf2---------current--------kf3\n // find kf2 and kf3 and do interpolation\n var frame; // In the easing function like elasticOut, percent may less than 0\n\n if (percent < 0) {\n frame = 0;\n } else if (percent < lastFramePercent) {\n // Start from next key\n // PENDING start from lastFrame ?\n start = Math.min(lastFrame + 1, trackLen - 1);\n\n for (frame = start; frame >= 0; frame--) {\n if (kfPercents[frame] <= percent) {\n break;\n }\n } // PENDING really need to do this ?\n\n\n frame = Math.min(frame, trackLen - 2);\n } else {\n for (frame = lastFrame; frame < trackLen; frame++) {\n if (kfPercents[frame] > percent) {\n break;\n }\n }\n\n frame = Math.min(frame - 1, trackLen - 2);\n }\n\n lastFrame = frame;\n lastFramePercent = percent;\n var range = kfPercents[frame + 1] - kfPercents[frame];\n\n if (range === 0) {\n return;\n } else {\n w = (percent - kfPercents[frame]) / range;\n }\n\n if (useSpline) {\n p1 = kfValues[frame];\n p0 = kfValues[frame === 0 ? frame : frame - 1];\n p2 = kfValues[frame > trackLen - 2 ? trackLen - 1 : frame + 1];\n p3 = kfValues[frame > trackLen - 3 ? trackLen - 1 : frame + 2];\n\n if (isValueArray) {\n catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, getter(target, propName), arrDim);\n } else {\n var value;\n\n if (isValueColor) {\n value = catmullRomInterpolateArray(p0, p1, p2, p3, w, w * w, w * w * w, rgba, 1);\n value = rgba2String(rgba);\n } else if (isValueString) {\n // String is step(0.5)\n return interpolateString(p1, p2, w);\n } else {\n value = catmullRomInterpolate(p0, p1, p2, p3, w, w * w, w * w * w);\n }\n\n setter(target, propName, value);\n }\n } else {\n if (isValueArray) {\n interpolateArray(kfValues[frame], kfValues[frame + 1], w, getter(target, propName), arrDim);\n } else {\n var value;\n\n if (isValueColor) {\n interpolateArray(kfValues[frame], kfValues[frame + 1], w, rgba, 1);\n value = rgba2String(rgba);\n } else if (isValueString) {\n // String is step(0.5)\n return interpolateString(kfValues[frame], kfValues[frame + 1], w);\n } else {\n value = interpolateNumber(kfValues[frame], kfValues[frame + 1], w);\n }\n\n setter(target, propName, value);\n }\n }\n };\n\n var clip = new Clip({\n target: animator._target,\n life: trackMaxTime,\n loop: animator._loop,\n delay: animator._delay,\n onframe: onframe,\n ondestroy: oneTrackDone\n });\n\n if (easing && easing !== 'spline') {\n clip.easing = easing;\n }\n\n return clip;\n}\n/**\n * @alias module:zrender/animation/Animator\n * @constructor\n * @param {Object} target\n * @param {boolean} loop\n * @param {Function} getter\n * @param {Function} setter\n */\n\n\nvar Animator = function (target, loop, getter, setter) {\n this._tracks = {};\n this._target = target;\n this._loop = loop || false;\n this._getter = getter || defaultGetter;\n this._setter = setter || defaultSetter;\n this._clipCount = 0;\n this._delay = 0;\n this._doneList = [];\n this._onframeList = [];\n this._clipList = [];\n};\n\nAnimator.prototype = {\n /**\n * 设置动画关键帧\n * @param {number} time 关键帧时间,单位是ms\n * @param {Object} props 关键帧的属性值,key-value表示\n * @return {module:zrender/animation/Animator}\n */\n when: function (time\n /* ms */\n , props) {\n var tracks = this._tracks;\n\n for (var propName in props) {\n if (!props.hasOwnProperty(propName)) {\n continue;\n }\n\n if (!tracks[propName]) {\n tracks[propName] = []; // Invalid value\n\n var value = this._getter(this._target, propName);\n\n if (value == null) {\n // zrLog('Invalid property ' + propName);\n continue;\n } // If time is 0\n // Then props is given initialize value\n // Else\n // Initialize value from current prop value\n\n\n if (time !== 0) {\n tracks[propName].push({\n time: 0,\n value: cloneValue(value)\n });\n }\n }\n\n tracks[propName].push({\n time: time,\n value: props[propName]\n });\n }\n\n return this;\n },\n\n /**\n * 添加动画每一帧的回调函数\n * @param {Function} callback\n * @return {module:zrender/animation/Animator}\n */\n during: function (callback) {\n this._onframeList.push(callback);\n\n return this;\n },\n pause: function () {\n for (var i = 0; i < this._clipList.length; i++) {\n this._clipList[i].pause();\n }\n\n this._paused = true;\n },\n resume: function () {\n for (var i = 0; i < this._clipList.length; i++) {\n this._clipList[i].resume();\n }\n\n this._paused = false;\n },\n isPaused: function () {\n return !!this._paused;\n },\n _doneCallback: function () {\n // Clear all tracks\n this._tracks = {}; // Clear all clips\n\n this._clipList.length = 0;\n var doneList = this._doneList;\n var len = doneList.length;\n\n for (var i = 0; i < len; i++) {\n doneList[i].call(this);\n }\n },\n\n /**\n * 开始执行动画\n * @param {string|Function} [easing]\n * 动画缓动函数,详见{@link module:zrender/animation/easing}\n * @param {boolean} forceAnimate\n * @return {module:zrender/animation/Animator}\n */\n start: function (easing, forceAnimate) {\n var self = this;\n var clipCount = 0;\n\n var oneTrackDone = function () {\n clipCount--;\n\n if (!clipCount) {\n self._doneCallback();\n }\n };\n\n var lastClip;\n\n for (var propName in this._tracks) {\n if (!this._tracks.hasOwnProperty(propName)) {\n continue;\n }\n\n var clip = createTrackClip(this, easing, oneTrackDone, this._tracks[propName], propName, forceAnimate);\n\n if (clip) {\n this._clipList.push(clip);\n\n clipCount++; // If start after added to animation\n\n if (this.animation) {\n this.animation.addClip(clip);\n }\n\n lastClip = clip;\n }\n } // Add during callback on the last clip\n\n\n if (lastClip) {\n var oldOnFrame = lastClip.onframe;\n\n lastClip.onframe = function (target, percent) {\n oldOnFrame(target, percent);\n\n for (var i = 0; i < self._onframeList.length; i++) {\n self._onframeList[i](target, percent);\n }\n };\n } // This optimization will help the case that in the upper application\n // the view may be refreshed frequently, where animation will be\n // called repeatly but nothing changed.\n\n\n if (!clipCount) {\n this._doneCallback();\n }\n\n return this;\n },\n\n /**\n * 停止动画\n * @param {boolean} forwardToLast If move to last frame before stop\n */\n stop: function (forwardToLast) {\n var clipList = this._clipList;\n var animation = this.animation;\n\n for (var i = 0; i < clipList.length; i++) {\n var clip = clipList[i];\n\n if (forwardToLast) {\n // Move to last frame before stop\n clip.onframe(this._target, 1);\n }\n\n animation && animation.removeClip(clip);\n }\n\n clipList.length = 0;\n },\n\n /**\n * 设置动画延迟开始的时间\n * @param {number} time 单位ms\n * @return {module:zrender/animation/Animator}\n */\n delay: function (time) {\n this._delay = time;\n return this;\n },\n\n /**\n * 添加动画结束的回调\n * @param {Function} cb\n * @return {module:zrender/animation/Animator}\n */\n done: function (cb) {\n if (cb) {\n this._doneList.push(cb);\n }\n\n return this;\n },\n\n /**\n * @return {Array.}\n */\n getClips: function () {\n return this._clipList;\n }\n};\nvar _default = Animator;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVs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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/animation/Animator.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/animation/Clip.js": +/*!****************************************************!*\ + !*** ./node_modules/zrender/lib/animation/Clip.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var easingFuncs = __webpack_require__(/*! ./easing */ \"./node_modules/zrender/lib/animation/easing.js\");\n\n/**\n * 动画主控制器\n * @config target 动画对象,可以是数组,如果是数组的话会批量分发onframe等事件\n * @config life(1000) 动画时长\n * @config delay(0) 动画延迟时间\n * @config loop(true)\n * @config gap(0) 循环的间隔时间\n * @config onframe\n * @config easing(optional)\n * @config ondestroy(optional)\n * @config onrestart(optional)\n *\n * TODO pause\n */\nfunction Clip(options) {\n this._target = options.target; // 生命周期\n\n this._life = options.life || 1000; // 延时\n\n this._delay = options.delay || 0; // 开始时间\n // this._startTime = new Date().getTime() + this._delay;// 单位毫秒\n\n this._initialized = false; // 是否循环\n\n this.loop = options.loop == null ? false : options.loop;\n this.gap = options.gap || 0;\n this.easing = options.easing || 'Linear';\n this.onframe = options.onframe;\n this.ondestroy = options.ondestroy;\n this.onrestart = options.onrestart;\n this._pausedTime = 0;\n this._paused = false;\n}\n\nClip.prototype = {\n constructor: Clip,\n step: function (globalTime, deltaTime) {\n // Set startTime on first step, or _startTime may has milleseconds different between clips\n // PENDING\n if (!this._initialized) {\n this._startTime = globalTime + this._delay;\n this._initialized = true;\n }\n\n if (this._paused) {\n this._pausedTime += deltaTime;\n return;\n }\n\n var percent = (globalTime - this._startTime - this._pausedTime) / this._life; // 还没开始\n\n if (percent < 0) {\n return;\n }\n\n percent = Math.min(percent, 1);\n var easing = this.easing;\n var easingFunc = typeof easing === 'string' ? easingFuncs[easing] : easing;\n var schedule = typeof easingFunc === 'function' ? easingFunc(percent) : percent;\n this.fire('frame', schedule); // 结束\n\n if (percent === 1) {\n if (this.loop) {\n this.restart(globalTime); // 重新开始周期\n // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件\n\n return 'restart';\n } // 动画完成将这个控制器标识为待删除\n // 在Animation.update中进行批量删除\n\n\n this._needsRemove = true;\n return 'destroy';\n }\n\n return null;\n },\n restart: function (globalTime) {\n var remainder = (globalTime - this._startTime - this._pausedTime) % this._life;\n this._startTime = globalTime - remainder + this.gap;\n this._pausedTime = 0;\n this._needsRemove = false;\n },\n fire: function (eventType, arg) {\n eventType = 'on' + eventType;\n\n if (this[eventType]) {\n this[eventType](this._target, arg);\n }\n },\n pause: function () {\n this._paused = true;\n },\n resume: function () {\n this._paused = false;\n }\n};\nvar _default = Clip;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/animation/Clip.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/animation/easing.js": +/*!******************************************************!*\ + !*** ./node_modules/zrender/lib/animation/easing.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * 缓动代码来自 https://github.com/sole/tween.js/blob/master/src/Tween.js\n * @see http://sole.github.io/tween.js/examples/03_graphs.html\n * @exports zrender/animation/easing\n */\nvar easing = {\n /**\n * @param {number} k\n * @return {number}\n */\n linear: function (k) {\n return k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quadraticIn: function (k) {\n return k * k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quadraticOut: function (k) {\n return k * (2 - k);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quadraticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k;\n }\n\n return -0.5 * (--k * (k - 2) - 1);\n },\n // 三次方的缓动(t^3)\n\n /**\n * @param {number} k\n * @return {number}\n */\n cubicIn: function (k) {\n return k * k * k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n cubicOut: function (k) {\n return --k * k * k + 1;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n cubicInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k;\n }\n\n return 0.5 * ((k -= 2) * k * k + 2);\n },\n // 四次方的缓动(t^4)\n\n /**\n * @param {number} k\n * @return {number}\n */\n quarticIn: function (k) {\n return k * k * k * k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quarticOut: function (k) {\n return 1 - --k * k * k * k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quarticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k;\n }\n\n return -0.5 * ((k -= 2) * k * k * k - 2);\n },\n // 五次方的缓动(t^5)\n\n /**\n * @param {number} k\n * @return {number}\n */\n quinticIn: function (k) {\n return k * k * k * k * k;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quinticOut: function (k) {\n return --k * k * k * k * k + 1;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n quinticInOut: function (k) {\n if ((k *= 2) < 1) {\n return 0.5 * k * k * k * k * k;\n }\n\n return 0.5 * ((k -= 2) * k * k * k * k + 2);\n },\n // 正弦曲线的缓动(sin(t))\n\n /**\n * @param {number} k\n * @return {number}\n */\n sinusoidalIn: function (k) {\n return 1 - Math.cos(k * Math.PI / 2);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n sinusoidalOut: function (k) {\n return Math.sin(k * Math.PI / 2);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n sinusoidalInOut: function (k) {\n return 0.5 * (1 - Math.cos(Math.PI * k));\n },\n // 指数曲线的缓动(2^t)\n\n /**\n * @param {number} k\n * @return {number}\n */\n exponentialIn: function (k) {\n return k === 0 ? 0 : Math.pow(1024, k - 1);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n exponentialOut: function (k) {\n return k === 1 ? 1 : 1 - Math.pow(2, -10 * k);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n exponentialInOut: function (k) {\n if (k === 0) {\n return 0;\n }\n\n if (k === 1) {\n return 1;\n }\n\n if ((k *= 2) < 1) {\n return 0.5 * Math.pow(1024, k - 1);\n }\n\n return 0.5 * (-Math.pow(2, -10 * (k - 1)) + 2);\n },\n // 圆形曲线的缓动(sqrt(1-t^2))\n\n /**\n * @param {number} k\n * @return {number}\n */\n circularIn: function (k) {\n return 1 - Math.sqrt(1 - k * k);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n circularOut: function (k) {\n return Math.sqrt(1 - --k * k);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n circularInOut: function (k) {\n if ((k *= 2) < 1) {\n return -0.5 * (Math.sqrt(1 - k * k) - 1);\n }\n\n return 0.5 * (Math.sqrt(1 - (k -= 2) * k) + 1);\n },\n // 创建类似于弹簧在停止前来回振荡的动画\n\n /**\n * @param {number} k\n * @return {number}\n */\n elasticIn: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n\n if (k === 0) {\n return 0;\n }\n\n if (k === 1) {\n return 1;\n }\n\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n\n return -(a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n elasticOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n\n if (k === 0) {\n return 0;\n }\n\n if (k === 1) {\n return 1;\n }\n\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n\n return a * Math.pow(2, -10 * k) * Math.sin((k - s) * (2 * Math.PI) / p) + 1;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n elasticInOut: function (k) {\n var s;\n var a = 0.1;\n var p = 0.4;\n\n if (k === 0) {\n return 0;\n }\n\n if (k === 1) {\n return 1;\n }\n\n if (!a || a < 1) {\n a = 1;\n s = p / 4;\n } else {\n s = p * Math.asin(1 / a) / (2 * Math.PI);\n }\n\n if ((k *= 2) < 1) {\n return -0.5 * (a * Math.pow(2, 10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p));\n }\n\n return a * Math.pow(2, -10 * (k -= 1)) * Math.sin((k - s) * (2 * Math.PI) / p) * 0.5 + 1;\n },\n // 在某一动画开始沿指示的路径进行动画处理前稍稍收回该动画的移动\n\n /**\n * @param {number} k\n * @return {number}\n */\n backIn: function (k) {\n var s = 1.70158;\n return k * k * ((s + 1) * k - s);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n backOut: function (k) {\n var s = 1.70158;\n return --k * k * ((s + 1) * k + s) + 1;\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n backInOut: function (k) {\n var s = 1.70158 * 1.525;\n\n if ((k *= 2) < 1) {\n return 0.5 * (k * k * ((s + 1) * k - s));\n }\n\n return 0.5 * ((k -= 2) * k * ((s + 1) * k + s) + 2);\n },\n // 创建弹跳效果\n\n /**\n * @param {number} k\n * @return {number}\n */\n bounceIn: function (k) {\n return 1 - easing.bounceOut(1 - k);\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n bounceOut: function (k) {\n if (k < 1 / 2.75) {\n return 7.5625 * k * k;\n } else if (k < 2 / 2.75) {\n return 7.5625 * (k -= 1.5 / 2.75) * k + 0.75;\n } else if (k < 2.5 / 2.75) {\n return 7.5625 * (k -= 2.25 / 2.75) * k + 0.9375;\n } else {\n return 7.5625 * (k -= 2.625 / 2.75) * k + 0.984375;\n }\n },\n\n /**\n * @param {number} k\n * @return {number}\n */\n bounceInOut: function (k) {\n if (k < 0.5) {\n return easing.bounceIn(k * 2) * 0.5;\n }\n\n return easing.bounceOut(k * 2 - 1) * 0.5 + 0.5;\n }\n};\nvar _default = easing;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvYW5pbWF0aW9uL2Vhc2luZy5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9hbmltYXRpb24vZWFzaW5nLmpzPzc0Y2IiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiDnvJPliqjku6PnoIHmnaXoh6ogaHR0cHM6Ly9naXRodWIuY29tL3NvbGUvdHdlZW4uanMvYmxvYi9tYXN0ZXIvc3JjL1R3ZWVuLmpzXG4gKiBAc2VlIGh0dHA6Ly9zb2xlLmdpdGh1Yi5pby90d2Vlbi5qcy9leGFtcGxlcy8wM19ncmFwaHMuaHRtbFxuICogQGV4cG9ydHMgenJlbmRlci9hbmltYXRpb24vZWFzaW5nXG4gKi9cbnZhciBlYXNpbmcgPSB7XG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBsaW5lYXI6IGZ1bmN0aW9uIChrKSB7XG4gICAgcmV0dXJuIGs7XG4gIH0sXG5cbiAgLyoqXG4gICogQHBhcmFtIHtudW1iZXJ9IGtcbiAgKiBAcmV0dXJuIHtudW1iZXJ9XG4gICovXG4gIHF1YWRyYXRpY0luOiBmdW5jdGlvbiAoaykge1xuICAgIHJldHVybiBrICogaztcbiAgfSxcblxuICAvKipcbiAgKiBAcGFyYW0ge251bWJlcn0ga1xuICAqIEByZXR1cm4ge251bWJlcn1cbiAgKi9cbiAgcXVhZHJhdGljT3V0OiBmdW5jdGlvbiAoaykge1xuICAgIHJldHVybiBrICogKDIgLSBrKTtcbiAgfSxcblxuICAvKipcbiAgKiBAcGFyYW0ge251bWJlcn0ga1xuICAqIEByZXR1c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KflnKjlgZzmraLliY3mnaXlm57mjK/ojaHnmoTliqjnlLtcblxuICAvKipcbiAgKiBAcGFyYW0ge251bWJlcn0ga1xuICAqIEByZXR1cm4ge251bWJlcn1cbiAgKi9cbiAgZWxhc3RpY0luOiBmdW5jdGlvbiAoaykge1xuICAgIHZhciBzO1xuICAgIHZhciBhID0gMC4xO1xuICAgIHZhciBwID0gMC40O1xuXG4gICAgaWYgKGsgPT09IDApIHtcbiAgICAgIHJldHVybiAwO1xuICAgIH1cblxuICAgIGlmIChrID09PSAxKSB7XG4gICAgICByZXR1cm4gMTtcbiAgICB9XG5cbiAgICBpZiAoIWEgfHwgYSA8IDEpIHtcbiAgICAgIGEgPSAxO1xuICAgICAgcyA9IHAgLyA0O1xuICAgIH0gZWxzZSB7XG4gICAgICBzID0gcCAqIE1hdGguYXNpbigxIC8gYSkgLyAoMiAqIE1hdGguUEkpO1xuICAgIH1cblxuICAgIHJldHVybiAtKGEgKiBNYXRoLnBvdygyLCAxMCAqIChrIC09IDEpKSAqIE1hdGguc2luKChrIC0gcykgKiAoMiAqIE1hdGguUEkpIC8gcCkpO1xuICB9LFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBlbGFzdGljT3V0OiBmdW5jdGlvbiAoaykge1xuICAgIHZhciBzO1xuICAgIHZhciBhID0gMC4xO1xuICAgIHZhciBwID0gMC40O1xuXG4gICAgaWYgKGsgPT09IDApIHtcbiAgICAgIHJldHVybiAwO1xuICAgIH1cblxuICAgIGlmIChrID09PSAxKSB7XG4gICAgICByZXR1cm4gMTtcbiAgICB9XG5cbiAgICBpZiAoIWEgfHwgYSA8IDEpIHtcbiAgICAgIGEgPSAxO1xuICAgICAgcyA9IHAgLyA0O1xuICAgIH0gZWxzZSB7XG4gICAgICBzID0gcCAqIE1hdGguYXNpbigxIC8gYSkgLyAoMiAqIE1hdGguUEkpO1xuICAgIH1cblxuICAgIHJldHVybiBhICogTWF0aC5wb3coMiwgLTEwICogaykgKiBNYXRoLnNpbigoayAtIHMpICogKDIgKiBNYXRoLlBJKSAvIHApICsgMTtcbiAgfSxcblxuICAvKipcbiAgKiBAcGFyYW0ge251bWJlcn0ga1xuICAqIEByZXR1cm4ge251bWJlcn1cbiAgKi9cbiAgZWxhc3RpY0luT3V0OiBmdW5jdGlvbiAoaykge1xuICAgIHZhciBzO1xuICAgIHZhciBhID0gMC4xO1xuICAgIHZhciBwID0gMC40O1xuXG4gICAgaWYgKGsgPT09IDApIHtcbiAgICAgIHJldHVybiAwO1xuICAgIH1cblxuICAgIGlmIChrID09PSAxKSB7XG4gICAgICByZXR1cm4gMTtcbiAgICB9XG5cbiAgICBpZiAoIWEgfHwgYSA8IDEpIHtcbiAgICAgIGEgPSAxO1xuICAgICAgcyA9IHAgLyA0O1xuICAgIH0gZWxzZSB7XG4gICAgICBzID0gcCAqIE1hdGguYXNpbigxIC8gYSkgLyAoMiAqIE1hdGguUEkpO1xuICAgIH1cblxuICAgIGlmICgoayAqPSAyKSA8IDEpIHtcbiAgICAgIHJldHVybiAtMC41ICogKGEgKiBNYXRoLnBvdygyLCAxMCAqIChrIC09IDEpKSAqIE1hdGguc2luKChrIC0gcykgKiAoMiAqIE1hdGguUEkpIC8gcCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhICogTWF0aC5wb3coMiwgLTEwICogKGsgLT0gMSkpICogTWF0aC5zaW4oKGsgLSBzKSAqICgyICogTWF0aC5QSSkgLyBwKSAqIDAuNSArIDE7XG4gIH0sXG4gIC8vIOWcqOafkOS4gOWKqOeUu+W8gOWni+ayv+aMh+ekuueahOi3r+W+hOi/m+ihjOWKqOeUu+WkhOeQhuWJjeeojeeojeaUtuWbnuivpeWKqOeUu+eahOenu+WKqFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBiYWNrSW46IGZ1bmN0aW9uIChrKSB7XG4gICAgdmFyIHMgPSAxLjcwMTU4O1xuICAgIHJldHVybiBrICogayAqICgocyArIDEpICogayAtIHMpO1xuICB9LFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBiYWNrT3V0OiBmdW5jdGlvbiAoaykge1xuICAgIHZhciBzID0gMS43MDE1ODtcbiAgICByZXR1cm4gLS1rICogayAqICgocyArIDEpICogayArIHMpICsgMTtcbiAgfSxcblxuICAvKipcbiAgKiBAcGFyYW0ge251bWJlcn0ga1xuICAqIEByZXR1cm4ge251bWJlcn1cbiAgKi9cbiAgYmFja0luT3V0OiBmdW5jdGlvbiAoaykge1xuICAgIHZhciBzID0gMS43MDE1OCAqIDEuNTI1O1xuXG4gICAgaWYgKChrICo9IDIpIDwgMSkge1xuICAgICAgcmV0dXJuIDAuNSAqIChrICogayAqICgocyArIDEpICogayAtIHMpKTtcbiAgICB9XG5cbiAgICByZXR1cm4gMC41ICogKChrIC09IDIpICogayAqICgocyArIDEpICogayArIHMpICsgMik7XG4gIH0sXG4gIC8vIOWIm+W7uuW8uei3s+aViOaenFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBib3VuY2VJbjogZnVuY3Rpb24gKGspIHtcbiAgICByZXR1cm4gMSAtIGVhc2luZy5ib3VuY2VPdXQoMSAtIGspO1xuICB9LFxuXG4gIC8qKlxuICAqIEBwYXJhbSB7bnVtYmVyfSBrXG4gICogQHJldHVybiB7bnVtYmVyfVxuICAqL1xuICBib3VuY2VPdXQ6IGZ1bmN0aW9uIChrKSB7XG4gICAgaWYgKGsgPCAxIC8gMi43NSkge1xuICAgICAgcmV0dXJuIDcuNTYyNSAqIGsgKiBrO1xuICAgIH0gZWxzZSBpZiAoayA8IDIgLyAyLjc1KSB7XG4gICAgICByZXR1cm4gNy41NjI1ICogKGsgLT0gMS41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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/animation/easing.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/config.js": +/*!********************************************!*\ + !*** ./node_modules/zrender/lib/config.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var dpr = 1; // If in browser environment\n\nif (typeof window !== 'undefined') {\n dpr = Math.max(window.devicePixelRatio || 1, 1);\n}\n/**\n * config默认配置项\n * @exports zrender/config\n * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)\n */\n\n/**\n * debug日志选项:catchBrushException为true下有效\n * 0 : 不生成debug数据,发布用\n * 1 : 异常抛出,调试用\n * 2 : 控制台输出,调试用\n */\n\n\nvar debugMode = 0; // retina 屏幕优化\n\nvar devicePixelRatio = dpr;\nexports.debugMode = debugMode;\nexports.devicePixelRatio = devicePixelRatio;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29uZmlnLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvbmZpZy5qcz8yY2Y0Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBkcHIgPSAxOyAvLyBJZiBpbiBicm93c2VyIGVudmlyb25tZW50XG5cbmlmICh0eXBlb2Ygd2luZG93ICE9PSAndW5kZWZpbmVkJykge1xuICBkcHIgPSBNYXRoLm1heCh3aW5kb3cuZGV2aWNlUGl4ZWxSYXRpbyB8fCAxLCAxKTtcbn1cbi8qKlxuICogY29uZmln6buY6K6k6YWN572u6aG5XG4gKiBAZXhwb3J0cyB6cmVuZGVyL2NvbmZpZ1xuICogQGF1dGhvciBLZW5lciAoQEtlbmVyLeael+WzsCwga2VuZXIubGluZmVuZ0BnbWFpbC5jb20pXG4gKi9cblxuLyoqXG4gKiBkZWJ1Z+aXpeW/l+mAiemhue+8mmNhdGNoQnJ1c2hFeGNlcHRpb27kuLp0cnVl5LiL5pyJ5pWIXG4gKiAwIDog5LiN55Sf5oiQZGVidWfmlbDmja7vvIzlj5HluIPnlKhcbiAqIDEgOiDlvILluLjmipvlh7rvvIzosIPor5XnlKhcbiAqIDIgOiDmjqfliLblj7DovpPlh7rvvIzosIPor5XnlKhcbiAqL1xuXG5cbnZhciBkZWJ1Z01vZGUgPSAwOyAvLyByZXRpbmEg5bGP5bmV5LyY5YyWXG5cbnZhciBkZXZpY2VQaXhlbFJhdGlvID0gZHByO1xuZXhwb3J0cy5kZWJ1Z01vZGUgPSBkZWJ1Z01vZGU7XG5leHBvcnRzLmRldmljZVBpeGVsUmF0aW8gPSBkZXZpY2VQaXhlbFJhdGlvOyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/config.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/arc.js": +/*!*************************************************!*\ + !*** ./node_modules/zrender/lib/contain/arc.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var _util = __webpack_require__(/*! ./util */ \"./node_modules/zrender/lib/contain/util.js\");\n\nvar normalizeRadian = _util.normalizeRadian;\nvar PI2 = Math.PI * 2;\n/**\n * 圆弧描边包含判断\n * @param {number} cx\n * @param {number} cy\n * @param {number} r\n * @param {number} startAngle\n * @param {number} endAngle\n * @param {boolean} anticlockwise\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {Boolean}\n */\n\nfunction containStroke(cx, cy, r, startAngle, endAngle, anticlockwise, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth;\n x -= cx;\n y -= cy;\n var d = Math.sqrt(x * x + y * y);\n\n if (d - _l > r || d + _l < r) {\n return false;\n }\n\n if (Math.abs(startAngle - endAngle) % PI2 < 1e-4) {\n // Is a circle\n return true;\n }\n\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n } else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n\n var angle = Math.atan2(y, x);\n\n if (angle < 0) {\n angle += PI2;\n }\n\n return angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle;\n}\n\nexports.containStroke = containStroke;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9hcmMuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9hcmMuanM/OWY1MSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgX3V0aWwgPSByZXF1aXJlKFwiLi91dGlsXCIpO1xuXG52YXIgbm9ybWFsaXplUmFkaWFuID0gX3V0aWwubm9ybWFsaXplUmFkaWFuO1xudmFyIFBJMiA9IE1hdGguUEkgKiAy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:///./node_modules/zrender/lib/contain/arc.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/cubic.js": +/*!***************************************************!*\ + !*** ./node_modules/zrender/lib/contain/cubic.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var curve = __webpack_require__(/*! ../core/curve */ \"./node_modules/zrender/lib/core/curve.js\");\n\n/**\n * 三次贝塞尔曲线描边包含判断\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x3\n * @param {number} y3\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction containStroke(x0, y0, x1, y1, x2, y2, x3, y3, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth; // Quick reject\n\n 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) {\n return false;\n }\n\n var d = curve.cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, null);\n return d <= _l / 2;\n}\n\nexports.containStroke = containStroke;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9jdWJpYy5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9jb250YWluL2N1YmljLmpzP2U3ZDIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGN1cnZlID0gcmVxdWlyZShcIi4uL2NvcmUvY3VydmVcIik7XG5cbi8qKlxuICog5LiJ5qyh6LSd5aGe5bCU5puy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kxLCB4MiwgeTIsIHgzLCB5MywgeCwgeSwgbnVsbCk7XG4gIHJldHVybiBkIDw9IF9sIC8gMjtcbn1cblxuZXhwb3J0cy5jb250YWluU3Ryb2tlID0gY29udGFpblN0cm9rZTsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/cubic.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/line.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/contain/line.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * 线段包含判断\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction containStroke(x0, y0, x1, y1, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth;\n var _a = 0;\n var _b = x0; // Quick reject\n\n 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) {\n return false;\n }\n\n if (x0 !== x1) {\n _a = (y0 - y1) / (x0 - x1);\n _b = (x0 * y1 - x1 * y0) / (x0 - x1);\n } else {\n return Math.abs(x - x0) <= _l / 2;\n }\n\n var tmp = _a * x - y + _b;\n\n var _s = tmp * tmp / (_a * _a + 1);\n\n return _s <= _l / 2 * _l / 2;\n}\n\nexports.containStroke = containStroke;//# sourceURL=[module]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vICh4MCAtIHgxKTtcbiAgICBfYiA9ICh4MCAqIHkxIC0geDEgKiB5MCkgLyAoeDAgLSB4MSk7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIE1hdGguYWJzKHggLSB4MCkgPD0gX2wgLyAyO1xuICB9XG5cbiAgdmFyIHRtcCA9IF9hICogeCAtIHkgKyBfYjtcblxuICB2YXIgX3MgPSB0bXAgKiB0bXAgLyAoX2EgKiBfYSArIDEpO1xuXG4gIHJldHVybiBfcyA8PSBfbCAvIDIgKiBfbCAvIDI7XG59XG5cbmV4cG9ydHMuY29udGFpblN0cm9rZSA9IGNvbnRhaW5TdHJva2U7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/line.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/path.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/contain/path.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var PathProxy = __webpack_require__(/*! ../core/PathProxy */ \"./node_modules/zrender/lib/core/PathProxy.js\");\n\nvar line = __webpack_require__(/*! ./line */ \"./node_modules/zrender/lib/contain/line.js\");\n\nvar cubic = __webpack_require__(/*! ./cubic */ \"./node_modules/zrender/lib/contain/cubic.js\");\n\nvar quadratic = __webpack_require__(/*! ./quadratic */ \"./node_modules/zrender/lib/contain/quadratic.js\");\n\nvar arc = __webpack_require__(/*! ./arc */ \"./node_modules/zrender/lib/contain/arc.js\");\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/zrender/lib/contain/util.js\");\n\nvar normalizeRadian = _util.normalizeRadian;\n\nvar curve = __webpack_require__(/*! ../core/curve */ \"./node_modules/zrender/lib/core/curve.js\");\n\nvar windingLine = __webpack_require__(/*! ./windingLine */ \"./node_modules/zrender/lib/contain/windingLine.js\");\n\nvar CMD = PathProxy.CMD;\nvar PI2 = Math.PI * 2;\nvar EPSILON = 1e-4;\n\nfunction isAroundEqual(a, b) {\n return Math.abs(a - b) < EPSILON;\n} // 临时数组\n\n\nvar roots = [-1, -1, -1];\nvar extrema = [-1, -1];\n\nfunction swapExtrema() {\n var tmp = extrema[0];\n extrema[0] = extrema[1];\n extrema[1] = tmp;\n}\n\nfunction windingCubic(x0, y0, x1, y1, x2, y2, x3, y3, x, y) {\n // Quick reject\n if (y > y0 && y > y1 && y > y2 && y > y3 || y < y0 && y < y1 && y < y2 && y < y3) {\n return 0;\n }\n\n var nRoots = curve.cubicRootAt(y0, y1, y2, y3, y, roots);\n\n if (nRoots === 0) {\n return 0;\n } else {\n var w = 0;\n var nExtrema = -1;\n var y0_;\n var y1_;\n\n for (var i = 0; i < nRoots; i++) {\n var t = roots[i]; // Avoid winding error when intersection point is the connect point of two line of polygon\n\n var unit = t === 0 || t === 1 ? 0.5 : 1;\n var x_ = curve.cubicAt(x0, x1, x2, x3, t);\n\n if (x_ < x) {\n // Quick reject\n continue;\n }\n\n if (nExtrema < 0) {\n nExtrema = curve.cubicExtrema(y0, y1, y2, y3, extrema);\n\n if (extrema[1] < extrema[0] && nExtrema > 1) {\n swapExtrema();\n }\n\n y0_ = curve.cubicAt(y0, y1, y2, y3, extrema[0]);\n\n if (nExtrema > 1) {\n y1_ = curve.cubicAt(y0, y1, y2, y3, extrema[1]);\n }\n }\n\n if (nExtrema === 2) {\n // 分成三段单调函数\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n } else if (t < extrema[1]) {\n w += y1_ < y0_ ? unit : -unit;\n } else {\n w += y3 < y1_ ? unit : -unit;\n }\n } else {\n // 分成两段单调函数\n if (t < extrema[0]) {\n w += y0_ < y0 ? unit : -unit;\n } else {\n w += y3 < y0_ ? unit : -unit;\n }\n }\n }\n\n return w;\n }\n}\n\nfunction windingQuadratic(x0, y0, x1, y1, x2, y2, x, y) {\n // Quick reject\n if (y > y0 && y > y1 && y > y2 || y < y0 && y < y1 && y < y2) {\n return 0;\n }\n\n var nRoots = curve.quadraticRootAt(y0, y1, y2, y, roots);\n\n if (nRoots === 0) {\n return 0;\n } else {\n var t = curve.quadraticExtremum(y0, y1, y2);\n\n if (t >= 0 && t <= 1) {\n var w = 0;\n var y_ = curve.quadraticAt(y0, y1, y2, t);\n\n for (var i = 0; i < nRoots; i++) {\n // Remove one endpoint.\n var unit = roots[i] === 0 || roots[i] === 1 ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[i]);\n\n if (x_ < x) {\n // Quick reject\n continue;\n }\n\n if (roots[i] < t) {\n w += y_ < y0 ? unit : -unit;\n } else {\n w += y2 < y_ ? unit : -unit;\n }\n }\n\n return w;\n } else {\n // Remove one endpoint.\n var unit = roots[0] === 0 || roots[0] === 1 ? 0.5 : 1;\n var x_ = curve.quadraticAt(x0, x1, x2, roots[0]);\n\n if (x_ < x) {\n // Quick reject\n return 0;\n }\n\n return y2 < y0 ? unit : -unit;\n }\n }\n} // TODO\n// Arc 旋转\n\n\nfunction windingArc(cx, cy, r, startAngle, endAngle, anticlockwise, x, y) {\n y -= cy;\n\n if (y > r || y < -r) {\n return 0;\n }\n\n var tmp = Math.sqrt(r * r - y * y);\n roots[0] = -tmp;\n roots[1] = tmp;\n var diff = Math.abs(startAngle - endAngle);\n\n if (diff < 1e-4) {\n return 0;\n }\n\n if (diff % PI2 < 1e-4) {\n // Is a circle\n startAngle = 0;\n endAngle = PI2;\n var dir = anticlockwise ? 1 : -1;\n\n if (x >= roots[0] + cx && x <= roots[1] + cx) {\n return dir;\n } else {\n return 0;\n }\n }\n\n if (anticlockwise) {\n var tmp = startAngle;\n startAngle = normalizeRadian(endAngle);\n endAngle = normalizeRadian(tmp);\n } else {\n startAngle = normalizeRadian(startAngle);\n endAngle = normalizeRadian(endAngle);\n }\n\n if (startAngle > endAngle) {\n endAngle += PI2;\n }\n\n var w = 0;\n\n for (var i = 0; i < 2; i++) {\n var x_ = roots[i];\n\n if (x_ + cx > x) {\n var angle = Math.atan2(y, x_);\n var dir = anticlockwise ? 1 : -1;\n\n if (angle < 0) {\n angle = PI2 + angle;\n }\n\n if (angle >= startAngle && angle <= endAngle || angle + PI2 >= startAngle && angle + PI2 <= endAngle) {\n if (angle > Math.PI / 2 && angle < Math.PI * 1.5) {\n dir = -dir;\n }\n\n w += dir;\n }\n }\n }\n\n return w;\n}\n\nfunction containPath(data, lineWidth, isStroke, x, y) {\n var w = 0;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n\n for (var i = 0; i < data.length;) {\n var cmd = data[i++]; // Begin a new subpath\n\n if (cmd === CMD.M && i > 1) {\n // Close previous subpath\n if (!isStroke) {\n w += windingLine(xi, yi, x0, y0, x, y);\n } // 如果被任何一个 subpath 包含\n // if (w !== 0) {\n // return true;\n // }\n\n }\n\n if (i === 1) {\n // 如果第一个命令是 L, C, Q\n // 则 previous point 同绘制命令的第一个 point\n //\n // 第一个命令为 Arc 的情况下会在后面特殊处理\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n\n switch (cmd) {\n case CMD.M:\n // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点\n // 在 closePath 的时候使用\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n break;\n\n case CMD.L:\n if (isStroke) {\n if (line.containStroke(xi, yi, data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n } else {\n // NOTE 在第一个命令为 L, C, Q 的时候会计算出 NaN\n w += windingLine(xi, yi, data[i], data[i + 1], x, y) || 0;\n }\n\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.C:\n if (isStroke) {\n if (cubic.containStroke(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n } else {\n w += windingCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.Q:\n if (isStroke) {\n if (quadratic.containStroke(xi, yi, data[i++], data[i++], data[i], data[i + 1], lineWidth, x, y)) {\n return true;\n }\n } else {\n w += windingQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], x, y) || 0;\n }\n\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.A:\n // TODO Arc 判断的开销比较大\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var theta = data[i++];\n var dTheta = data[i++]; // TODO Arc 旋转\n\n i += 1;\n var anticlockwise = 1 - data[i++];\n var x1 = Math.cos(theta) * rx + cx;\n var y1 = Math.sin(theta) * ry + cy; // 不是直接使用 arc 命令\n\n if (i > 1) {\n w += windingLine(xi, yi, x1, y1, x, y);\n } else {\n // 第一个命令起点还未定义\n x0 = x1;\n y0 = y1;\n } // zr 使用scale来模拟椭圆, 这里也对x做一定的缩放\n\n\n var _x = (x - cx) * ry / rx + cx;\n\n if (isStroke) {\n if (arc.containStroke(cx, cy, ry, theta, theta + dTheta, anticlockwise, lineWidth, _x, y)) {\n return true;\n }\n } else {\n w += windingArc(cx, cy, ry, theta, theta + dTheta, anticlockwise, _x, y);\n }\n\n xi = Math.cos(theta + dTheta) * rx + cx;\n yi = Math.sin(theta + dTheta) * ry + cy;\n break;\n\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++];\n var x1 = x0 + width;\n var y1 = y0 + height;\n\n if (isStroke) {\n if (line.containStroke(x0, y0, x1, y0, lineWidth, x, y) || line.containStroke(x1, y0, x1, y1, lineWidth, x, y) || line.containStroke(x1, y1, x0, y1, lineWidth, x, y) || line.containStroke(x0, y1, x0, y0, lineWidth, x, y)) {\n return true;\n }\n } else {\n // FIXME Clockwise ?\n w += windingLine(x1, y0, x1, y1, x, y);\n w += windingLine(x0, y1, x0, y0, x, y);\n }\n\n break;\n\n case CMD.Z:\n if (isStroke) {\n if (line.containStroke(xi, yi, x0, y0, lineWidth, x, y)) {\n return true;\n }\n } else {\n // Close a subpath\n w += windingLine(xi, yi, x0, y0, x, y); // 如果被任何一个 subpath 包含\n // FIXME subpaths may overlap\n // if (w !== 0) {\n // return true;\n // }\n }\n\n xi = x0;\n yi = y0;\n break;\n }\n }\n\n if (!isStroke && !isAroundEqual(yi, y0)) {\n w += windingLine(xi, yi, x0, y0, x, y) || 0;\n }\n\n return w !== 0;\n}\n\nfunction contain(pathData, x, y) {\n return containPath(pathData, 0, false, x, y);\n}\n\nfunction containStroke(pathData, lineWidth, x, y) {\n return containPath(pathData, lineWidth, true, x, y);\n}\n\nexports.contain = contain;\nexports.containStroke = containStroke;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9wYXRoLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvbnRhaW4vcGF0aC5qcz9kODMzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoUHJveHkgPSByZXF1aXJlKFwiLi4vY29yZS9QYXRoUHJveHlcIik7XG5cbnZhciBsaW5lID0gcmVxdWlyZShcIi4vbGluZVwiKTtcblxudmFyIGN1YmljID0gcmVxdWlyZShcIi4vY3ViaWNcIik7XG5cbnZhciBxdWFkcmF0aWMgPSBy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eTEsIHkyKTtcblxuICAgIGlmICh0ID49IDAgJiYgdCA8PSAxKSB7XG4gICAgICB2YXIgdyA9IDA7XG4gICAgICB2YXIgeV8gPSBjdXJ2ZS5xdWFkcmF0aWNBdCh5MCwgeTEsIHkyLCB0KTtcblxuICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBuUm9vdHM7IGkrKykge1xuICAgICAgICAvLyBSZW1vdmUgb25lIGVuZHBvaW50LlxuICAgICAgICB2YXIgdW5pdCA9IHJvb3RzW2ldID09PSAwIHx8IHJvb3RzW2ldID09PSAxID8gMC41IDogMTtcbiAgICAgICAgdmFyIHhfID0gY3VydmUucXVhZHJhdGljQXQoeDAsIHgxLCB4Miwgcm9vdHNbaV0pO1xuXG4gICAgICAgIGlmICh4XyA8IHgpIHtcbiAgICAgICAgICAvLyBRdWljayByZWplY3RcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmIChyb290c1tpXSA8IHQpIHtcbiAgICAgICAgICB3ICs9IHlfIDwgeTAgPyB1bml0IDogLXVuaXQ7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgdyArPSB5MiA8IHlfID8gdW5pdCA6IC11bml0O1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB3O1xuICAgIH0gZWxzZSB7XG4gICAgICAvLyBSZW1vdmUgb25lIGVuZHBvaW50LlxuICAgICAgdmFyIHVuaXQgPSByb290c1swXSA9PT0gMCB8fCByb290c1swXSA9PT0gMSA/IDAuNSA6IDE7XG4gICAgICB2YXIgeF8gPSBjdXJ2ZS5xdWFkcmF0aWNBdCh4MCwgeDEsIHgyLCByb290c1swXSk7XG5cbiAgICAgIGlmICh4XyA8IHgpIHtcbiAgICAgICAgLy8gUXVpY2sgcmVqZWN0XG4gICAgICAgIHJldHVybiAwO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4geTIgPCB5MCA/IHVuaXQgOiAtdW5pdDtcbiAgICB9XG4gIH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uICAgIGlmIChjbWQgPT09IENNRC5NICYmIGkgPiAxKSB7XG4gICAgICAvLyBDbG9zZSBwcmV2aW91cyBzdWJwYXRoXG4gICAgICBpZiAoIWlzU3Ryb2tlKSB7XG4gICAgICAgIHcgKz0gd2luZGluZ0xpbmUoeGksIHlpLCB4MCwgeTAsIHgsIHkpO1xuICAgICAgfSAvLyDlpoLmnpzooqvku7vkvZXkuIDkuKogc3VicGF0aCDljIXlkKtcbiAgICAgIC8vIGlmICh3ICE9PSAwKSB7XG4gICAgICAvLyAgICAgcmV0dXJuIHRydWU7XG4gICAgICAvLyB9XG5cbiAgICB9XG5cbiAgICBpZiAoaSA9PT0gMSkge1xuICAgICAgLy8g5aaC5p6c56ys5LiA5Liq5ZG95Luk5pivIEwsIEMsIFFcbiAgICAgIC8vIOWImSBwcmV2aW91cyBwb2ludCDlkIznu5jliLblkb3ku6TnmoTnrKzkuIDkuKogcG9pbnRcbiAgICAgIC8vXG4gICAgICAvLyDnrKzkuIDkuKrlkb3ku6TkuLogQXJjIOeahOaDheWGteS4i+S8muWcqOWQjumdoueJueauiuWkhOeQhlxuICAgICAgeGkgPSBkYXRhW2ldO1xuICAgICAgeWkgPSBkYXRhW2kgKyAxXTtcbiAgICAgIHgwID0geGk7XG4gICAgICB5MCA9IHlpO1xuICAgIH1cblxuICAgIHN3aXRjaCAoY21kKSB7XG4gICAgICBjYXNlIENNRC5NOlxuICAgICAgICAvLyBtb3ZlVG8g5ZG95Luk6YeN5paw5Yib5bu65LiA5Liq5paw55qEIHN1YnBhdGgsIOW5tuS4lOabtOaWsOaWsOeahOi1t+eCuVxuICAgICAgICAvLyDlnKggY2xvc2VQYXRoIOeahOaXtuWAmeS9v+eUqFxuICAgICAgICB4MCA9IGRhdGFbaSsrXTtcbiAgICAgICAgeTAgPSBkYXRhW2krK107XG4gICAgICAgIHhpID0geDA7XG4gICAgICAgIHlpID0geTA7XG4gICAgICAgIGJyZWFrO1xuXG4gICAgICBjYXNlIENNRC5MOlxuICAgICAgICBpZiAoaXNTdHJva2UpIHtcbiAgICAgICAgICBpZiAobGluZS5jb250YWluU3Ryb2tlKHhpLCB5aSwgZGF0YVtpXSwgZGF0YVtpICsgMV0sIGxpbmVXaWR0aCwgeCwgeSkpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBOT1RFIOWcqOesrOS4gOS4quWRveS7pOS4uiBMLCBDLCBRIOeahOaXtuWAmeS8muiuoeeul+WHuiBOYU5cbiAgICAgICAgICB3ICs9IHdpbmRpbmdMaW5lKHhpLCB5aSwgZGF0YVtpXSwgZGF0YVtpICsgMV0sIHgsIHkpIHx8IDA7XG4gICAgICAgIH1cblxuICAgICAgICB4aSA9IGRhdGFbaSsrXTtcbiAgICAgICAgeWkgPSBkYXRhW2krK107XG4gICAgICAgIGJyZWFrO1xuXG4gICAgICBjYXNlIENNRC5DOlxuICAgICAgICBpZiAoaXNTdHJva2UpIHtcbiAgICAgICAgICBpZiAoY3ViaWMuY29udGFpblN0cm9rZSh4aSwgeWksIGRhdGFbaSsrXSwgZGF0YVtpKytdLCBkYXRhW2krK10sIGRhdGFbaSsrXSwgZGF0YVtpXSwgZGF0YVtpICsgMV0sIGxpbmVXaWR0aCwgeCwgeSkpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB3ICs9IHdpbmRpbmdDdWJpYyh4aSwgeWksIGRhdGFbaSsrXSwgZGF0YVtpKytdLCBkYXRhW2krK10sIGRhdGFbaSsrXSwgZGF0YVtpXSwgZGF0YVtpICsgMV0sIHgsIHkpIHx8IDA7XG4gICAgICAgIH1cblxuICAgICAgICB4aSA9IGRhdGFbaSsrXTtcbiAgICAgICAgeWkgPSBkYXRhW2krK107XG4gICAgICAgIGJyZWFrO1xuXG4gICAgICBjYXNlIENNRC5ROlxuICAgICAgICBpZiAoaXNTdHJva2UpIHtcbiAgICAgICAgICBpZiAocXVhZHJhdGljLmNvbnRhaW5TdHJva2UoeGksIHlpLCBkYXRhW2krK10sIGRhdGFbaSsrXSwgZGF0YVtpXSwgZGF0YVtpICsgMV0sIGxpbmVXaWR0aCwgeCwgeSkpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB3ICs9IHdpbmRpbmdRdWFkcmF0aWMoeGksIHlpLCBkYXRhW2krK10sIGRhdGFbaSsrXSwgZGF0YVtpXSwgZGF0YVtpICsgMV0sIHgsIHkpIHx8IDA7XG4gICAgICAgIH1cblxuICAgICAgICB4aSA9IGRhdGFbaSsrXTtcbiAgICAgICAgeWkgPSBkYXRhW2krK107XG4gICAgICAgIGJyZWFrO1xuXG4gICAgICBjYXNlIENNRC5BOlxuICAgICAgICAvLyBUT0RPIEFyYyDliKTmlq3nmoTlvIDplIDmr5TovoPlpKdcbiAgICAgICAgdmFyIGN4ID0gZGF0YVtpKytdO1xuICAgICAgICB2YXIgY3kgPSBkYXRhW2krK107XG4gICAgICAgIHZhciByeCA9IGRhdGFbaSsrXTtcbiAgICAgICAgdmFyIHJ5ID0gZGF0YVtpKytdO1xuICAgICAgICB2YXIgdGhldGEgPSBkYXRhW2krK107XG4gICAgICAgIHZhciBkVGhldGEgPSBkYXRhW2krK107IC8vIFRPRE8gQXJjIOaXi+i9rFxuXG4gICAgICAgIGkgKz0gMTtcbiAgICAgICAgdmFyIGFudGljbG9ja3dpc2UgPSAxIC0gZGF0YVtpKytdO1xuICAgICAgICB2YXIgeDEgPSBNYXRoLmNvcyh0aGV0YSkgKiByeCArIGN4O1xuICAgICAgICB2YXIgeTEgPSBNYXRoLnNpbih0aGV0YSkgKiByeSArIGN5OyAvLyDkuI3mmK/nm7TmjqXkvb/nlKggYXJjIOWRveS7pFxuXG4gICAgICAgIGlmIChpID4gMSkge1xuICAgICAgICAgIHcgKz0gd2luZGluZ0xpbmUoeGksIHlpLCB4MSwgeTEsIHgsIHkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIOesrOS4gOS4quWRveS7pOi1t+eCuei/mOacquWumuS5iVxuICAgICAgICAgIHgwID0geDE7XG4gICAgICAgICAgeTAgPSB5MTtcbiAgICAgICAgfSAvLyB6ciDkvb/nlKhzY2FsZeadpeaooeaLn+akreWchiwg6L+Z6YeM5Lmf5a+5eOWBmuS4gOWumueahOe8qeaUvlxuXG5cbiAgICAgICAgdmFyIF94ID0gKHggLSBjeCkgKiByeSAvIHJ4ICsgY3g7XG5cbiAgICAgICAgaWYgKGlzU3Ryb2tlKSB7XG4gICAgICAgICAgaWYgKGFyYy5jb250YWluU3Ryb2tlKGN4LCBjeSwgcnksIHRoZXRhLCB0aGV0YSArIGRUaGV0YSwgYW50aWNsb2Nrd2lzZSwgbGluZVdpZHRoLCBfeCwgeSkpIHtcbiAgICAgICAgICAgIHJldHVybiB0cnVlO1xuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICB3ICs9IHdpbmRpbmdBcmMoY3gsIGN5LCByeSwgdGhldGEsIHRoZXRhICsgZFRoZXRhLCBhbnRpY2xvY2t3aXNlLCBfeCwgeSk7XG4gICAgICAgIH1cblxuICAgICAgICB4aSA9IE1hdGguY29zKHRoZXRhICsgZFRoZXRhKSAqIHJ4ICsgY3g7XG4gICAgICAgIHlpID0gTWF0aC5zaW4odGhldGEgKyBkVGhldGEpICogcnkgKyBjeTtcbiAgICAgICAgYnJlYWs7XG5cbiAgICAgIGNhc2UgQ01ELlI6XG4gICAgICAgIHgwID0geGkgPSBkYXRhW2krK107XG4gICAgICAgIHkwID0geWkgPSBkYXRhW2krK107XG4gICAgICAgIHZhciB3aWR0aCA9IGRhdGFbaSsrXTtcbiAgICAgICAgdmFyIGhlaWdodCA9IGRhdGFbaSsrXTtcbiAgICAgICAgdmFyIHgxID0geDAgKyB3aWR0a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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/path.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/quadratic.js": +/*!*******************************************************!*\ + !*** ./node_modules/zrender/lib/contain/quadratic.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var _curve = __webpack_require__(/*! ../core/curve */ \"./node_modules/zrender/lib/core/curve.js\");\n\nvar quadraticProjectPoint = _curve.quadraticProjectPoint;\n\n/**\n * 二次贝塞尔曲线描边包含判断\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} lineWidth\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\nfunction containStroke(x0, y0, x1, y1, x2, y2, lineWidth, x, y) {\n if (lineWidth === 0) {\n return false;\n }\n\n var _l = lineWidth; // Quick reject\n\n 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) {\n return false;\n }\n\n var d = quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, null);\n return d <= _l / 2;\n}\n\nexports.containStroke = containStroke;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9xdWFkcmF0aWMuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi9xdWFkcmF0aWMuanM/NjhhYiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgX2N1cnZlID0gcmVxdWlyZShcIi4uL2NvcmUvY3VydmVcIik7XG5cbnZhciBxdWFkcmF0aWNQcm9qZWN0UG9pbnQgPSBfY3VydmUucXVhZHJhdGljUHJvamVjdFBvaW50O1xuXG4vKipcbiAqIOS6jOasoei0neWhnuWwlOabsue6v+aPj+i+ueWMheWQq+WIpOaWrVxuICogQHBhcmFtICB7bnVtYmVyfSAgeDBcbiAqIEBwYXJhbSAge251bWJlcn0gIHkwXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB4MVxuICogQHBhcmFtICB7bnVtYmVyfSAgeTFcbiAqIEBwYXJhbSAge251bWJlcn0gIHgyXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB5MlxuICogQHBhcmFtICB7bnVtYmVyfSAgbGluZVdpZHRoXG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB4XG4gKiBAcGFyYW0gIHtudW1iZXJ9ICB5XG4gKiBAcmV0dXJuIHtib29sZWFufVxuICovXG5mdW5jdGlvbiBjb250YWluU3Ryb2tlKHgwLCB5MCwgeDEsIHkxLCB4MiwgeTIsIGxpbmVXaWR0aCwgeCwgeSkge1xuICBpZiAobGluZVdpZHRoID09PSAwKSB7XG4gICAgcmV0dXJuIGZhbHNlO1xuICB9XG5cbiAgdmFyIF9sID0gbGluZVdpZHRoOyAvLyBRdWljayByZWplY3RcblxuICBpZiAoeSA+IHkwICsgX2wgJiYgeSA+IHkxICsgX2wgJiYgeSA+IHkyICsgX2wgfHwgeSA8IHkwIC0gX2wgJiYgeSA8IHkxIC0gX2wgJiYgeSA8IHkyIC0gX2wgfHwgeCA+IHgwICsgX2wgJiYgeCA+IHgxICsgX2wgJiYgeCA+IHgyICsgX2wgfHwgeCA8IHgwIC0gX2wgJiYgeCA8IHgxIC0gX2wgJiYgeCA8IHgyIC0gX2wpIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cblxuICB2YXIgZCA9IHF1YWRyYXRpY1Byb2plY3RQb2ludCh4MCwgeTAsIHgxLCB5MSwgeDIsIHkyLCB4LCB5LCBudWxsKTtcbiAgcmV0dXJuIGQgPD0gX2wgLyAyO1xufVxuXG5leHBvcnRzLmNvbnRhaW5TdHJva2UgPSBjb250YWluU3Ryb2tlOyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/quadratic.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/text.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/contain/text.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\nvar imageHelper = __webpack_require__(/*! ../graphic/helper/image */ \"./node_modules/zrender/lib/graphic/helper/image.js\");\n\nvar _util = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar getContext = _util.getContext;\nvar extend = _util.extend;\nvar retrieve2 = _util.retrieve2;\nvar retrieve3 = _util.retrieve3;\nvar trim = _util.trim;\nvar textWidthCache = {};\nvar textWidthCacheCounter = 0;\nvar TEXT_CACHE_MAX = 5000;\nvar STYLE_REG = /\\{([a-zA-Z0-9_]+)\\|([^}]*)\\}/g;\nvar DEFAULT_FONT = '12px sans-serif'; // Avoid assign to an exported variable, for transforming to cjs.\n\nvar methods = {};\n\nfunction $override(name, fn) {\n methods[name] = fn;\n}\n/**\n * @public\n * @param {string} text\n * @param {string} font\n * @return {number} width\n */\n\n\nfunction getWidth(text, font) {\n font = font || DEFAULT_FONT;\n var key = text + ':' + font;\n\n if (textWidthCache[key]) {\n return textWidthCache[key];\n }\n\n var textLines = (text + '').split('\\n');\n var width = 0;\n\n for (var i = 0, l = textLines.length; i < l; i++) {\n // textContain.measureText may be overrided in SVG or VML\n width = Math.max(measureText(textLines[i], font).width, width);\n }\n\n if (textWidthCacheCounter > TEXT_CACHE_MAX) {\n textWidthCacheCounter = 0;\n textWidthCache = {};\n }\n\n textWidthCacheCounter++;\n textWidthCache[key] = width;\n return width;\n}\n/**\n * @public\n * @param {string} text\n * @param {string} font\n * @param {string} [textAlign='left']\n * @param {string} [textVerticalAlign='top']\n * @param {Array.} [textPadding]\n * @param {Object} [rich]\n * @param {Object} [truncate]\n * @return {Object} {x, y, width, height, lineHeight}\n */\n\n\nfunction getBoundingRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) {\n return rich ? getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) : getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate);\n}\n\nfunction getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate) {\n var contentBlock = parsePlainText(text, font, textPadding, textLineHeight, truncate);\n var outerWidth = getWidth(text, font);\n\n if (textPadding) {\n outerWidth += textPadding[1] + textPadding[3];\n }\n\n var outerHeight = contentBlock.outerHeight;\n var x = adjustTextX(0, outerWidth, textAlign);\n var y = adjustTextY(0, outerHeight, textVerticalAlign);\n var rect = new BoundingRect(x, y, outerWidth, outerHeight);\n rect.lineHeight = contentBlock.lineHeight;\n return rect;\n}\n\nfunction getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) {\n var contentBlock = parseRichText(text, {\n rich: rich,\n truncate: truncate,\n font: font,\n textAlign: textAlign,\n textPadding: textPadding,\n textLineHeight: textLineHeight\n });\n var outerWidth = contentBlock.outerWidth;\n var outerHeight = contentBlock.outerHeight;\n var x = adjustTextX(0, outerWidth, textAlign);\n var y = adjustTextY(0, outerHeight, textVerticalAlign);\n return new BoundingRect(x, y, outerWidth, outerHeight);\n}\n/**\n * @public\n * @param {number} x\n * @param {number} width\n * @param {string} [textAlign='left']\n * @return {number} Adjusted x.\n */\n\n\nfunction adjustTextX(x, width, textAlign) {\n // FIXME Right to left language\n if (textAlign === 'right') {\n x -= width;\n } else if (textAlign === 'center') {\n x -= width / 2;\n }\n\n return x;\n}\n/**\n * @public\n * @param {number} y\n * @param {number} height\n * @param {string} [textVerticalAlign='top']\n * @return {number} Adjusted y.\n */\n\n\nfunction adjustTextY(y, height, textVerticalAlign) {\n if (textVerticalAlign === 'middle') {\n y -= height / 2;\n } else if (textVerticalAlign === 'bottom') {\n y -= height;\n }\n\n return y;\n}\n/**\n * @public\n * @param {stirng} textPosition\n * @param {Object} rect {x, y, width, height}\n * @param {number} distance\n * @return {Object} {x, y, textAlign, textVerticalAlign}\n */\n\n\nfunction adjustTextPositionOnRect(textPosition, rect, distance) {\n var x = rect.x;\n var y = rect.y;\n var height = rect.height;\n var width = rect.width;\n var halfHeight = height / 2;\n var textAlign = 'left';\n var textVerticalAlign = 'top';\n\n switch (textPosition) {\n case 'left':\n x -= distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n\n case 'right':\n x += distance + width;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n\n case 'top':\n x += width / 2;\n y -= distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n\n case 'bottom':\n x += width / 2;\n y += height + distance;\n textAlign = 'center';\n break;\n\n case 'inside':\n x += width / 2;\n y += halfHeight;\n textAlign = 'center';\n textVerticalAlign = 'middle';\n break;\n\n case 'insideLeft':\n x += distance;\n y += halfHeight;\n textVerticalAlign = 'middle';\n break;\n\n case 'insideRight':\n x += width - distance;\n y += halfHeight;\n textAlign = 'right';\n textVerticalAlign = 'middle';\n break;\n\n case 'insideTop':\n x += width / 2;\n y += distance;\n textAlign = 'center';\n break;\n\n case 'insideBottom':\n x += width / 2;\n y += height - distance;\n textAlign = 'center';\n textVerticalAlign = 'bottom';\n break;\n\n case 'insideTopLeft':\n x += distance;\n y += distance;\n break;\n\n case 'insideTopRight':\n x += width - distance;\n y += distance;\n textAlign = 'right';\n break;\n\n case 'insideBottomLeft':\n x += distance;\n y += height - distance;\n textVerticalAlign = 'bottom';\n break;\n\n case 'insideBottomRight':\n x += width - distance;\n y += height - distance;\n textAlign = 'right';\n textVerticalAlign = 'bottom';\n break;\n }\n\n return {\n x: x,\n y: y,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\n}\n/**\n * Show ellipsis if overflow.\n *\n * @public\n * @param {string} text\n * @param {string} containerWidth\n * @param {string} font\n * @param {number} [ellipsis='...']\n * @param {Object} [options]\n * @param {number} [options.maxIterations=3]\n * @param {number} [options.minChar=0] If truncate result are less\n * then minChar, ellipsis will not show, which is\n * better for user hint in some cases.\n * @param {number} [options.placeholder=''] When all truncated, use the placeholder.\n * @return {string}\n */\n\n\nfunction truncateText(text, containerWidth, font, ellipsis, options) {\n if (!containerWidth) {\n return '';\n }\n\n var textLines = (text + '').split('\\n');\n options = prepareTruncateOptions(containerWidth, font, ellipsis, options); // FIXME\n // It is not appropriate that every line has '...' when truncate multiple lines.\n\n for (var i = 0, len = textLines.length; i < len; i++) {\n textLines[i] = truncateSingleLine(textLines[i], options);\n }\n\n return textLines.join('\\n');\n}\n\nfunction prepareTruncateOptions(containerWidth, font, ellipsis, options) {\n options = extend({}, options);\n options.font = font;\n var ellipsis = retrieve2(ellipsis, '...');\n options.maxIterations = retrieve2(options.maxIterations, 2);\n var minChar = options.minChar = retrieve2(options.minChar, 0); // FIXME\n // Other languages?\n\n options.cnCharWidth = getWidth('国', font); // FIXME\n // Consider proportional font?\n\n var ascCharWidth = options.ascCharWidth = getWidth('a', font);\n options.placeholder = retrieve2(options.placeholder, ''); // Example 1: minChar: 3, text: 'asdfzxcv', truncate result: 'asdf', but not: 'a...'.\n // Example 2: minChar: 3, text: '维度', truncate result: '维', but not: '...'.\n\n var contentWidth = containerWidth = Math.max(0, containerWidth - 1); // Reserve some gap.\n\n for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) {\n contentWidth -= ascCharWidth;\n }\n\n var ellipsisWidth = getWidth(ellipsis, font);\n\n if (ellipsisWidth > contentWidth) {\n ellipsis = '';\n ellipsisWidth = 0;\n }\n\n contentWidth = containerWidth - ellipsisWidth;\n options.ellipsis = ellipsis;\n options.ellipsisWidth = ellipsisWidth;\n options.contentWidth = contentWidth;\n options.containerWidth = containerWidth;\n return options;\n}\n\nfunction truncateSingleLine(textLine, options) {\n var containerWidth = options.containerWidth;\n var font = options.font;\n var contentWidth = options.contentWidth;\n\n if (!containerWidth) {\n return '';\n }\n\n var lineWidth = getWidth(textLine, font);\n\n if (lineWidth <= containerWidth) {\n return textLine;\n }\n\n for (var j = 0;; j++) {\n if (lineWidth <= contentWidth || j >= options.maxIterations) {\n textLine += options.ellipsis;\n break;\n }\n\n var subLength = j === 0 ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth) : lineWidth > 0 ? Math.floor(textLine.length * contentWidth / lineWidth) : 0;\n textLine = textLine.substr(0, subLength);\n lineWidth = getWidth(textLine, font);\n }\n\n if (textLine === '') {\n textLine = options.placeholder;\n }\n\n return textLine;\n}\n\nfunction estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) {\n var width = 0;\n var i = 0;\n\n for (var len = text.length; i < len && width < contentWidth; i++) {\n var charCode = text.charCodeAt(i);\n width += 0 <= charCode && charCode <= 127 ? ascCharWidth : cnCharWidth;\n }\n\n return i;\n}\n/**\n * @public\n * @param {string} font\n * @return {number} line height\n */\n\n\nfunction getLineHeight(font) {\n // FIXME A rough approach.\n return getWidth('国', font);\n}\n/**\n * @public\n * @param {string} text\n * @param {string} font\n * @return {Object} width\n */\n\n\nfunction measureText(text, font) {\n return methods.measureText(text, font);\n} // Avoid assign to an exported variable, for transforming to cjs.\n\n\nmethods.measureText = function (text, font) {\n var ctx = getContext();\n ctx.font = font || DEFAULT_FONT;\n return ctx.measureText(text);\n};\n/**\n * @public\n * @param {string} text\n * @param {string} font\n * @param {Object} [truncate]\n * @return {Object} block: {lineHeight, lines, height, outerHeight}\n * Notice: for performance, do not calculate outerWidth util needed.\n */\n\n\nfunction parsePlainText(text, font, padding, textLineHeight, truncate) {\n text != null && (text += '');\n var lineHeight = retrieve2(textLineHeight, getLineHeight(font));\n var lines = text ? text.split('\\n') : [];\n var height = lines.length * lineHeight;\n var outerHeight = height;\n\n if (padding) {\n outerHeight += padding[0] + padding[2];\n }\n\n if (text && truncate) {\n var truncOuterHeight = truncate.outerHeight;\n var truncOuterWidth = truncate.outerWidth;\n\n if (truncOuterHeight != null && outerHeight > truncOuterHeight) {\n text = '';\n lines = [];\n } else if (truncOuterWidth != null) {\n var options = prepareTruncateOptions(truncOuterWidth - (padding ? padding[1] + padding[3] : 0), font, truncate.ellipsis, {\n minChar: truncate.minChar,\n placeholder: truncate.placeholder\n }); // FIXME\n // It is not appropriate that every line has '...' when truncate multiple lines.\n\n for (var i = 0, len = lines.length; i < len; i++) {\n lines[i] = truncateSingleLine(lines[i], options);\n }\n }\n }\n\n return {\n lines: lines,\n height: height,\n outerHeight: outerHeight,\n lineHeight: lineHeight\n };\n}\n/**\n * For example: 'some text {a|some text}other text{b|some text}xxx{c|}xxx'\n * Also consider 'bbbb{a|xxx\\nzzz}xxxx\\naaaa'.\n *\n * @public\n * @param {string} text\n * @param {Object} style\n * @return {Object} block\n * {\n * width,\n * height,\n * lines: [{\n * lineHeight,\n * width,\n * tokens: [[{\n * styleName,\n * text,\n * width, // include textPadding\n * height, // include textPadding\n * textWidth, // pure text width\n * textHeight, // pure text height\n * lineHeihgt,\n * font,\n * textAlign,\n * textVerticalAlign\n * }], [...], ...]\n * }, ...]\n * }\n * If styleName is undefined, it is plain text.\n */\n\n\nfunction parseRichText(text, style) {\n var contentBlock = {\n lines: [],\n width: 0,\n height: 0\n };\n text != null && (text += '');\n\n if (!text) {\n return contentBlock;\n }\n\n var lastIndex = STYLE_REG.lastIndex = 0;\n var result;\n\n while ((result = STYLE_REG.exec(text)) != null) {\n var matchedIndex = result.index;\n\n if (matchedIndex > lastIndex) {\n pushTokens(contentBlock, text.substring(lastIndex, matchedIndex));\n }\n\n pushTokens(contentBlock, result[2], result[1]);\n lastIndex = STYLE_REG.lastIndex;\n }\n\n if (lastIndex < text.length) {\n pushTokens(contentBlock, text.substring(lastIndex, text.length));\n }\n\n var lines = contentBlock.lines;\n var contentHeight = 0;\n var contentWidth = 0; // For `textWidth: 100%`\n\n var pendingList = [];\n var stlPadding = style.textPadding;\n var truncate = style.truncate;\n var truncateWidth = truncate && truncate.outerWidth;\n var truncateHeight = truncate && truncate.outerHeight;\n\n if (stlPadding) {\n truncateWidth != null && (truncateWidth -= stlPadding[1] + stlPadding[3]);\n truncateHeight != null && (truncateHeight -= stlPadding[0] + stlPadding[2]);\n } // Calculate layout info of tokens.\n\n\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n var lineHeight = 0;\n var lineWidth = 0;\n\n for (var j = 0; j < line.tokens.length; j++) {\n var token = line.tokens[j];\n var tokenStyle = token.styleName && style.rich[token.styleName] || {}; // textPadding should not inherit from style.\n\n var textPadding = token.textPadding = tokenStyle.textPadding; // textFont has been asigned to font by `normalizeStyle`.\n\n var font = token.font = tokenStyle.font || style.font; // textHeight can be used when textVerticalAlign is specified in token.\n\n var tokenHeight = token.textHeight = retrieve2( // textHeight should not be inherited, consider it can be specified\n // as box height of the block.\n tokenStyle.textHeight, getLineHeight(font));\n textPadding && (tokenHeight += textPadding[0] + textPadding[2]);\n token.height = tokenHeight;\n token.lineHeight = retrieve3(tokenStyle.textLineHeight, style.textLineHeight, tokenHeight);\n token.textAlign = tokenStyle && tokenStyle.textAlign || style.textAlign;\n token.textVerticalAlign = tokenStyle && tokenStyle.textVerticalAlign || 'middle';\n\n if (truncateHeight != null && contentHeight + token.lineHeight > truncateHeight) {\n return {\n lines: [],\n width: 0,\n height: 0\n };\n }\n\n token.textWidth = getWidth(token.text, font);\n var tokenWidth = tokenStyle.textWidth;\n var tokenWidthNotSpecified = tokenWidth == null || tokenWidth === 'auto'; // Percent width, can be `100%`, can be used in drawing separate\n // line when box width is needed to be auto.\n\n if (typeof tokenWidth === 'string' && tokenWidth.charAt(tokenWidth.length - 1) === '%') {\n token.percentWidth = tokenWidth;\n pendingList.push(token);\n tokenWidth = 0; // Do not truncate in this case, because there is no user case\n // and it is too complicated.\n } else {\n if (tokenWidthNotSpecified) {\n tokenWidth = token.textWidth; // FIXME: If image is not loaded and textWidth is not specified, calling\n // `getBoundingRect()` will not get correct result.\n\n var textBackgroundColor = tokenStyle.textBackgroundColor;\n var bgImg = textBackgroundColor && textBackgroundColor.image; // Use cases:\n // (1) If image is not loaded, it will be loaded at render phase and call\n // `dirty()` and `textBackgroundColor.image` will be replaced with the loaded\n // image, and then the right size will be calculated here at the next tick.\n // See `graphic/helper/text.js`.\n // (2) If image loaded, and `textBackgroundColor.image` is image src string,\n // use `imageHelper.findExistImage` to find cached image.\n // `imageHelper.findExistImage` will always be called here before\n // `imageHelper.createOrUpdateImage` in `graphic/helper/text.js#renderRichText`\n // which ensures that image will not be rendered before correct size calcualted.\n\n if (bgImg) {\n bgImg = imageHelper.findExistImage(bgImg);\n\n if (imageHelper.isImageReady(bgImg)) {\n tokenWidth = Math.max(tokenWidth, bgImg.width * tokenHeight / bgImg.height);\n }\n }\n }\n\n var paddingW = textPadding ? textPadding[1] + textPadding[3] : 0;\n tokenWidth += paddingW;\n var remianTruncWidth = truncateWidth != null ? truncateWidth - lineWidth : null;\n\n if (remianTruncWidth != null && remianTruncWidth < tokenWidth) {\n if (!tokenWidthNotSpecified || remianTruncWidth < paddingW) {\n token.text = '';\n token.textWidth = tokenWidth = 0;\n } else {\n token.text = truncateText(token.text, remianTruncWidth - paddingW, font, truncate.ellipsis, {\n minChar: truncate.minChar\n });\n token.textWidth = getWidth(token.text, font);\n tokenWidth = token.textWidth + paddingW;\n }\n }\n }\n\n lineWidth += token.width = tokenWidth;\n tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight));\n }\n\n line.width = lineWidth;\n line.lineHeight = lineHeight;\n contentHeight += lineHeight;\n contentWidth = Math.max(contentWidth, lineWidth);\n }\n\n contentBlock.outerWidth = contentBlock.width = retrieve2(style.textWidth, contentWidth);\n contentBlock.outerHeight = contentBlock.height = retrieve2(style.textHeight, contentHeight);\n\n if (stlPadding) {\n contentBlock.outerWidth += stlPadding[1] + stlPadding[3];\n contentBlock.outerHeight += stlPadding[0] + stlPadding[2];\n }\n\n for (var i = 0; i < pendingList.length; i++) {\n var token = pendingList[i];\n var percentWidth = token.percentWidth; // Should not base on outerWidth, because token can not be placed out of padding.\n\n token.width = parseInt(percentWidth, 10) / 100 * contentWidth;\n }\n\n return contentBlock;\n}\n\nfunction pushTokens(block, str, styleName) {\n var isEmptyStr = str === '';\n var strs = str.split('\\n');\n var lines = block.lines;\n\n for (var i = 0; i < strs.length; i++) {\n var text = strs[i];\n var token = {\n styleName: styleName,\n text: text,\n isLineHolder: !text && !isEmptyStr\n }; // The first token should be appended to the last line.\n\n if (!i) {\n var tokens = (lines[lines.length - 1] || (lines[0] = {\n tokens: []\n })).tokens; // Consider cases:\n // (1) ''.split('\\n') => ['', '\\n', ''], the '' at the first item\n // (which is a placeholder) should be replaced by new token.\n // (2) A image backage, where token likes {a|}.\n // (3) A redundant '' will affect textAlign in line.\n // (4) tokens with the same tplName should not be merged, because\n // they should be displayed in different box (with border and padding).\n\n var tokensLen = tokens.length;\n tokensLen === 1 && tokens[0].isLineHolder ? tokens[0] = token : // Consider text is '', only insert when it is the \"lineHolder\" or\n // \"emptyStr\". Otherwise a redundant '' will affect textAlign in line.\n (text || !tokensLen || isEmptyStr) && tokens.push(token);\n } // Other tokens always start a new line.\n else {\n // If there is '', insert it as a placeholder.\n lines.push({\n tokens: [token]\n });\n }\n }\n}\n\nfunction makeFont(style) {\n // FIXME in node-canvas fontWeight is before fontStyle\n // Use `fontSize` `fontFamily` to check whether font properties are defined.\n var font = (style.fontSize || style.fontFamily) && [style.fontStyle, style.fontWeight, (style.fontSize || 12) + 'px', // If font properties are defined, `fontFamily` should not be ignored.\n style.fontFamily || 'sans-serif'].join(' ');\n return font && trim(font) || style.textFont || style.font;\n}\n\nexports.DEFAULT_FONT = DEFAULT_FONT;\nexports.$override = $override;\nexports.getWidth = getWidth;\nexports.getBoundingRect = getBoundingRect;\nexports.adjustTextX = adjustTextX;\nexports.adjustTextY = adjustTextY;\nexports.adjustTextPositionOnRect = adjustTextPositionOnRect;\nexports.truncateText = truncateText;\nexports.getLineHeight = getLineHeight;\nexports.measureText = measureText;\nexports.parsePlainText = parsePlainText;\nexports.parseRichText = parseRichText;\nexports.makeFont = makeFont;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi90ZXh0LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvb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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/text.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/util.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/contain/util.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var PI2 = Math.PI * 2;\n\nfunction normalizeRadian(angle) {\n angle %= PI2;\n\n if (angle < 0) {\n angle += PI2;\n }\n\n return angle;\n}\n\nexports.normalizeRadian = normalizeRadian;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi91dGlsLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvbnRhaW4vdXRpbC5qcz84NTdkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQSTIgPSBNYXRoLlBJICogMjtcblxuZnVuY3Rpb24gbm9ybWFsaXplUmFkaWFuKGFuZ2xlKSB7XG4gIGFuZ2xlICU9IFBJMjtcblxuICBpZiAoYW5nbGUgPCAwKSB7XG4gICAgYW5nbGUgKz0gUEkyO1xuICB9XG5cbiAgcmV0dXJuIGFuZ2xlO1xufVxuXG5leHBvcnRzLm5vcm1hbGl6ZVJhZGlhbiA9IG5vcm1hbGl6ZVJhZGlhbjsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/util.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/contain/windingLine.js": +/*!*********************************************************!*\ + !*** ./node_modules/zrender/lib/contain/windingLine.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("function windingLine(x0, y0, x1, y1, x, y) {\n if (y > y0 && y > y1 || y < y0 && y < y1) {\n return 0;\n } // Ignore horizontal line\n\n\n if (y1 === y0) {\n return 0;\n }\n\n var dir = y1 < y0 ? 1 : -1;\n var t = (y - y0) / (y1 - y0); // Avoid winding error when intersection point is the connect point of two line of polygon\n\n if (t === 1 || t === 0) {\n dir = y1 < y0 ? 0.5 : -0.5;\n }\n\n var x_ = t * (x1 - x0) + x0; // If (x, y) on the line, considered as \"contain\".\n\n return x_ === x ? Infinity : x_ > x ? dir : 0;\n}\n\nmodule.exports = windingLine;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbi93aW5kaW5nTGluZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9jb250YWluL3dpbmRpbmdMaW5lLmpzPzg3MjgiXSwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gd2luZGluZ0xpbmUoeDAsIHkwLCB4MSwgeTEsIHgsIHkpIHtcbiAgaWYgKHkgPiB5MCAmJiB5ID4geTEgfHwgeSA8IHkwICYmIHkgPCB5MSkge1xuICAgIHJldHVybiAwO1xuICB9IC8vIElnbm9yZSBob3Jpem9udGFsIGxpbmVcblxuXG4gIGlmICh5MSA9PT0geTApIHtcbiAgICByZXR1cm4gMDtcbiAgfVxuXG4gIHZhciBkaXIgPSB5MSA8IHkwID8gMSA6IC0xO1xuICB2YXIgdCA9ICh5IC0geTApIC8gKHkxIC0geTApOyAvLyBBdm9pZCB3aW5kaW5nIGVycm9yIHdoZW4gaW50ZXJzZWN0aW9uIHBvaW50IGlzIHRoZSBjb25uZWN0IHBvaW50IG9mIHR3byBsaW5lIG9mIHBvbHlnb25cblxuICBpZiAodCA9PT0gMSB8fCB0ID09PSAwKSB7XG4gICAgZGlyID0geTEgPCB5MCA/IDAuNSA6IC0wLjU7XG4gIH1cblxuICB2YXIgeF8gPSB0ICogKHgxIC0geDApICsgeDA7IC8vIElmICh4LCB5KSBvbiB0aGUgbGluZSwgY29uc2lkZXJlZCBhcyBcImNvbnRhaW5cIi5cblxuICByZXR1cm4geF8gPT09IHggPyBJbmZpbml0eSA6IHhfID4geCA/IGRpciA6IDA7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gd2luZGluZ0xpbmU7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/contain/windingLine.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/container/Group.js": +/*!*****************************************************!*\ + !*** ./node_modules/zrender/lib/container/Group.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar Element = __webpack_require__(/*! ../Element */ \"./node_modules/zrender/lib/Element.js\");\n\nvar BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\n/**\n * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上\n * @module zrender/graphic/Group\n * @example\n * var Group = require('zrender/container/Group');\n * var Circle = require('zrender/graphic/shape/Circle');\n * var g = new Group();\n * g.position[0] = 100;\n * g.position[1] = 100;\n * g.add(new Circle({\n * style: {\n * x: 100,\n * y: 100,\n * r: 20,\n * }\n * }));\n * zr.add(g);\n */\n\n/**\n * @alias module:zrender/graphic/Group\n * @constructor\n * @extends module:zrender/mixin/Transformable\n * @extends module:zrender/mixin/Eventful\n */\nvar Group = function (opts) {\n opts = opts || {};\n Element.call(this, opts);\n\n for (var key in opts) {\n if (opts.hasOwnProperty(key)) {\n this[key] = opts[key];\n }\n }\n\n this._children = [];\n this.__storage = null;\n this.__dirty = true;\n};\n\nGroup.prototype = {\n constructor: Group,\n isGroup: true,\n\n /**\n * @type {string}\n */\n type: 'group',\n\n /**\n * 所有子孙元素是否响应鼠标事件\n * @name module:/zrender/container/Group#silent\n * @type {boolean}\n * @default false\n */\n silent: false,\n\n /**\n * @return {Array.}\n */\n children: function () {\n return this._children.slice();\n },\n\n /**\n * 获取指定 index 的儿子节点\n * @param {number} idx\n * @return {module:zrender/Element}\n */\n childAt: function (idx) {\n return this._children[idx];\n },\n\n /**\n * 获取指定名字的儿子节点\n * @param {string} name\n * @return {module:zrender/Element}\n */\n childOfName: function (name) {\n var children = this._children;\n\n for (var i = 0; i < children.length; i++) {\n if (children[i].name === name) {\n return children[i];\n }\n }\n },\n\n /**\n * @return {number}\n */\n childCount: function () {\n return this._children.length;\n },\n\n /**\n * 添加子节点到最后\n * @param {module:zrender/Element} child\n */\n add: function (child) {\n if (child && child !== this && child.parent !== this) {\n this._children.push(child);\n\n this._doAdd(child);\n }\n\n return this;\n },\n\n /**\n * 添加子节点在 nextSibling 之前\n * @param {module:zrender/Element} child\n * @param {module:zrender/Element} nextSibling\n */\n addBefore: function (child, nextSibling) {\n if (child && child !== this && child.parent !== this && nextSibling && nextSibling.parent === this) {\n var children = this._children;\n var idx = children.indexOf(nextSibling);\n\n if (idx >= 0) {\n children.splice(idx, 0, child);\n\n this._doAdd(child);\n }\n }\n\n return this;\n },\n _doAdd: function (child) {\n if (child.parent) {\n child.parent.remove(child);\n }\n\n child.parent = this;\n var storage = this.__storage;\n var zr = this.__zr;\n\n if (storage && storage !== child.__storage) {\n storage.addToStorage(child);\n\n if (child instanceof Group) {\n child.addChildrenToStorage(storage);\n }\n }\n\n zr && zr.refresh();\n },\n\n /**\n * 移除子节点\n * @param {module:zrender/Element} child\n */\n remove: function (child) {\n var zr = this.__zr;\n var storage = this.__storage;\n var children = this._children;\n var idx = zrUtil.indexOf(children, child);\n\n if (idx < 0) {\n return this;\n }\n\n children.splice(idx, 1);\n child.parent = null;\n\n if (storage) {\n storage.delFromStorage(child);\n\n if (child instanceof Group) {\n child.delChildrenFromStorage(storage);\n }\n }\n\n zr && zr.refresh();\n return this;\n },\n\n /**\n * 移除所有子节点\n */\n removeAll: function () {\n var children = this._children;\n var storage = this.__storage;\n var child;\n var i;\n\n for (i = 0; i < children.length; i++) {\n child = children[i];\n\n if (storage) {\n storage.delFromStorage(child);\n\n if (child instanceof Group) {\n child.delChildrenFromStorage(storage);\n }\n }\n\n child.parent = null;\n }\n\n children.length = 0;\n return this;\n },\n\n /**\n * 遍历所有子节点\n * @param {Function} cb\n * @param {} context\n */\n eachChild: function (cb, context) {\n var children = this._children;\n\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n cb.call(context, child, i);\n }\n\n return this;\n },\n\n /**\n * 深度优先遍历所有子孙节点\n * @param {Function} cb\n * @param {} context\n */\n traverse: function (cb, context) {\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n cb.call(context, child);\n\n if (child.type === 'group') {\n child.traverse(cb, context);\n }\n }\n\n return this;\n },\n addChildrenToStorage: function (storage) {\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n storage.addToStorage(child);\n\n if (child instanceof Group) {\n child.addChildrenToStorage(storage);\n }\n }\n },\n delChildrenFromStorage: function (storage) {\n for (var i = 0; i < this._children.length; i++) {\n var child = this._children[i];\n storage.delFromStorage(child);\n\n if (child instanceof Group) {\n child.delChildrenFromStorage(storage);\n }\n }\n },\n dirty: function () {\n this.__dirty = true;\n this.__zr && this.__zr.refresh();\n return this;\n },\n\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n getBoundingRect: function (includeChildren) {\n // TODO Caching\n var rect = null;\n var tmpRect = new BoundingRect(0, 0, 0, 0);\n var children = includeChildren || this._children;\n var tmpMat = [];\n\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n\n if (child.ignore || child.invisible) {\n continue;\n }\n\n var childRect = child.getBoundingRect();\n var transform = child.getLocalTransform(tmpMat); // TODO\n // The boundingRect cacluated by transforming original\n // rect may be bigger than the actual bundingRect when rotation\n // is used. (Consider a circle rotated aginst its center, where\n // the actual boundingRect should be the same as that not be\n // rotated.) But we can not find better approach to calculate\n // actual boundingRect yet, considering performance.\n\n if (transform) {\n tmpRect.copy(childRect);\n tmpRect.applyTransform(transform);\n rect = rect || tmpRect.clone();\n rect.union(tmpRect);\n } else {\n rect = rect || childRect.clone();\n rect.union(childRect);\n }\n }\n\n return rect || tmpRect;\n }\n};\nzrUtil.inherits(Group, Element);\nvar _default = Group;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29udGFpbmVyL0dyb3VwLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvbnRhaW5lci9Hcm91cC5qcz9lMWZjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB6clV0aWwgPSByZXF1aXJlKFwiLi4vY29yZS91dGlsXCIpO1xuXG52YXIgRWxlbWVudCA9IHJlcXVpcmUoXCIuLi9FbGVtZW50XCIpO1xuXG52YXIgQm91bmRpbmdSZWN0ID0gcmVxdWlyZShcIi4uL2NvcmUvQm91bmRpbmdSZWN0XCIpO1xuXG4vKipcbiAqIEdyb3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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/container/Group.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/BoundingRect.js": +/*!*******************************************************!*\ + !*** ./node_modules/zrender/lib/core/BoundingRect.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var vec2 = __webpack_require__(/*! ./vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar matrix = __webpack_require__(/*! ./matrix */ \"./node_modules/zrender/lib/core/matrix.js\");\n\n/**\n * @module echarts/core/BoundingRect\n */\nvar v2ApplyTransform = vec2.applyTransform;\nvar mathMin = Math.min;\nvar mathMax = Math.max;\n/**\n * @alias module:echarts/core/BoundingRect\n */\n\nfunction BoundingRect(x, y, width, height) {\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n /**\n * @type {number}\n */\n\n\n this.x = x;\n /**\n * @type {number}\n */\n\n this.y = y;\n /**\n * @type {number}\n */\n\n this.width = width;\n /**\n * @type {number}\n */\n\n this.height = height;\n}\n\nBoundingRect.prototype = {\n constructor: BoundingRect,\n\n /**\n * @param {module:echarts/core/BoundingRect} other\n */\n union: function (other) {\n var x = mathMin(other.x, this.x);\n var y = mathMin(other.y, this.y);\n this.width = mathMax(other.x + other.width, this.x + this.width) - x;\n this.height = mathMax(other.y + other.height, this.y + this.height) - y;\n this.x = x;\n this.y = y;\n },\n\n /**\n * @param {Array.} m\n * @methods\n */\n applyTransform: function () {\n var lt = [];\n var rb = [];\n var lb = [];\n var rt = [];\n return function (m) {\n // In case usage like this\n // el.getBoundingRect().applyTransform(el.transform)\n // And element has no transform\n if (!m) {\n return;\n }\n\n lt[0] = lb[0] = this.x;\n lt[1] = rt[1] = this.y;\n rb[0] = rt[0] = this.x + this.width;\n rb[1] = lb[1] = this.y + this.height;\n v2ApplyTransform(lt, lt, m);\n v2ApplyTransform(rb, rb, m);\n v2ApplyTransform(lb, lb, m);\n v2ApplyTransform(rt, rt, m);\n this.x = mathMin(lt[0], rb[0], lb[0], rt[0]);\n this.y = mathMin(lt[1], rb[1], lb[1], rt[1]);\n var maxX = mathMax(lt[0], rb[0], lb[0], rt[0]);\n var maxY = mathMax(lt[1], rb[1], lb[1], rt[1]);\n this.width = maxX - this.x;\n this.height = maxY - this.y;\n };\n }(),\n\n /**\n * Calculate matrix of transforming from self to target rect\n * @param {module:zrender/core/BoundingRect} b\n * @return {Array.}\n */\n calculateTransform: function (b) {\n var a = this;\n var sx = b.width / a.width;\n var sy = b.height / a.height;\n var m = matrix.create(); // 矩阵右乘\n\n matrix.translate(m, m, [-a.x, -a.y]);\n matrix.scale(m, m, [sx, sy]);\n matrix.translate(m, m, [b.x, b.y]);\n return m;\n },\n\n /**\n * @param {(module:echarts/core/BoundingRect|Object)} b\n * @return {boolean}\n */\n intersect: function (b) {\n if (!b) {\n return false;\n }\n\n if (!(b instanceof BoundingRect)) {\n // Normalize negative width/height.\n b = BoundingRect.create(b);\n }\n\n var a = this;\n var ax0 = a.x;\n var ax1 = a.x + a.width;\n var ay0 = a.y;\n var ay1 = a.y + a.height;\n var bx0 = b.x;\n var bx1 = b.x + b.width;\n var by0 = b.y;\n var by1 = b.y + b.height;\n return !(ax1 < bx0 || bx1 < ax0 || ay1 < by0 || by1 < ay0);\n },\n contain: function (x, y) {\n var rect = this;\n return x >= rect.x && x <= rect.x + rect.width && y >= rect.y && y <= rect.y + rect.height;\n },\n\n /**\n * @return {module:echarts/core/BoundingRect}\n */\n clone: function () {\n return new BoundingRect(this.x, this.y, this.width, this.height);\n },\n\n /**\n * Copy from another rect\n */\n copy: function (other) {\n this.x = other.x;\n this.y = other.y;\n this.width = other.width;\n this.height = other.height;\n },\n plain: function () {\n return {\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height\n };\n }\n};\n/**\n * @param {Object|module:zrender/core/BoundingRect} rect\n * @param {number} rect.x\n * @param {number} rect.y\n * @param {number} rect.width\n * @param {number} rect.height\n * @return {module:zrender/core/BoundingRect}\n */\n\nBoundingRect.create = function (rect) {\n return new BoundingRect(rect.x, rect.y, rect.width, rect.height);\n};\n\nvar _default = BoundingRect;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZX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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/BoundingRect.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/LRU.js": +/*!**********************************************!*\ + !*** ./node_modules/zrender/lib/core/LRU.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("// Simple LRU cache use doubly linked list\n// @module zrender/core/LRU\n\n/**\n * Simple double linked list. Compared with array, it has O(1) remove operation.\n * @constructor\n */\nvar LinkedList = function () {\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n this.head = null;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.tail = null;\n this._len = 0;\n};\n\nvar linkedListProto = LinkedList.prototype;\n/**\n * Insert a new value at the tail\n * @param {} val\n * @return {module:zrender/core/LRU~Entry}\n */\n\nlinkedListProto.insert = function (val) {\n var entry = new Entry(val);\n this.insertEntry(entry);\n return entry;\n};\n/**\n * Insert an entry at the tail\n * @param {module:zrender/core/LRU~Entry} entry\n */\n\n\nlinkedListProto.insertEntry = function (entry) {\n if (!this.head) {\n this.head = this.tail = entry;\n } else {\n this.tail.next = entry;\n entry.prev = this.tail;\n entry.next = null;\n this.tail = entry;\n }\n\n this._len++;\n};\n/**\n * Remove entry.\n * @param {module:zrender/core/LRU~Entry} entry\n */\n\n\nlinkedListProto.remove = function (entry) {\n var prev = entry.prev;\n var next = entry.next;\n\n if (prev) {\n prev.next = next;\n } else {\n // Is head\n this.head = next;\n }\n\n if (next) {\n next.prev = prev;\n } else {\n // Is tail\n this.tail = prev;\n }\n\n entry.next = entry.prev = null;\n this._len--;\n};\n/**\n * @return {number}\n */\n\n\nlinkedListProto.len = function () {\n return this._len;\n};\n/**\n * Clear list\n */\n\n\nlinkedListProto.clear = function () {\n this.head = this.tail = null;\n this._len = 0;\n};\n/**\n * @constructor\n * @param {} val\n */\n\n\nvar Entry = function (val) {\n /**\n * @type {}\n */\n this.value = val;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.next;\n /**\n * @type {module:zrender/core/LRU~Entry}\n */\n\n this.prev;\n};\n/**\n * LRU Cache\n * @constructor\n * @alias module:zrender/core/LRU\n */\n\n\nvar LRU = function (maxSize) {\n this._list = new LinkedList();\n this._map = {};\n this._maxSize = maxSize || 10;\n this._lastRemovedEntry = null;\n};\n\nvar LRUProto = LRU.prototype;\n/**\n * @param {string} key\n * @param {} value\n * @return {} Removed value\n */\n\nLRUProto.put = function (key, value) {\n var list = this._list;\n var map = this._map;\n var removed = null;\n\n if (map[key] == null) {\n var len = list.len(); // Reuse last removed entry\n\n var entry = this._lastRemovedEntry;\n\n if (len >= this._maxSize && len > 0) {\n // Remove the least recently used\n var leastUsedEntry = list.head;\n list.remove(leastUsedEntry);\n delete map[leastUsedEntry.key];\n removed = leastUsedEntry.value;\n this._lastRemovedEntry = leastUsedEntry;\n }\n\n if (entry) {\n entry.value = value;\n } else {\n entry = new Entry(value);\n }\n\n entry.key = key;\n list.insertEntry(entry);\n map[key] = entry;\n }\n\n return removed;\n};\n/**\n * @param {string} key\n * @return {}\n */\n\n\nLRUProto.get = function (key) {\n var entry = this._map[key];\n var list = this._list;\n\n if (entry != null) {\n // Put the latest used entry in the tail\n if (entry !== list.tail) {\n list.remove(entry);\n list.insertEntry(entry);\n }\n\n return entry.value;\n }\n};\n/**\n * Clear the cache\n */\n\n\nLRUProto.clear = function () {\n this._list.clear();\n\n this._map = {};\n};\n\nvar _default = LRU;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9MUlUuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9MUlUuanM/ZDUxYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBTaW1wbGUgTFJVIGNhY2hlIHVzZSBkb3VibHkgbGlua2VkIGxpc3Rcbi8vIEBtb2R1bGUgenJlbmRlci9jb3JlL0xSVVxuXG4vKipcbiAqIFNpbXBsZSBkb3VibGUgbGlua2VkIGxpc3QuIENvbXBhcmVkIHdpdGggYXJyYXksIGl0IGhhcyBPKDEpIHJlbW92ZSBvcGVyYXRpb24uXG4gKiBAY29uc3RydWN0b3JcbiAqL1xudmFyIExpbmtlZExpc3QgPSBmdW5jdGlvbiAoKSB7XG4gIC8qKlxuICAgKiBAdHlwZSB7bW9kdWxlOnpyZW5kZXIvY29yZS9MUlV+RW50cnl9XG4gICAqL1xuICB0aGlzLmhlYWQgPSBudWxsO1xuICAvKipcbiAgICogQHR5cGUge21vZ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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/LRU.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/PathProxy.js": +/*!****************************************************!*\ + !*** ./node_modules/zrender/lib/core/PathProxy.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var curve = __webpack_require__(/*! ./curve */ \"./node_modules/zrender/lib/core/curve.js\");\n\nvar vec2 = __webpack_require__(/*! ./vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar bbox = __webpack_require__(/*! ./bbox */ \"./node_modules/zrender/lib/core/bbox.js\");\n\nvar BoundingRect = __webpack_require__(/*! ./BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\nvar _config = __webpack_require__(/*! ../config */ \"./node_modules/zrender/lib/config.js\");\n\nvar dpr = _config.devicePixelRatio;\n\n/**\n * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中\n * 可以用于 isInsidePath 判断以及获取boundingRect\n *\n * @module zrender/core/PathProxy\n * @author Yi Shen (http://www.github.com/pissang)\n */\n// TODO getTotalLength, getPointAtLength\nvar CMD = {\n M: 1,\n L: 2,\n C: 3,\n Q: 4,\n A: 5,\n Z: 6,\n // Rect\n R: 7\n}; // var CMD_MEM_SIZE = {\n// M: 3,\n// L: 3,\n// C: 7,\n// Q: 5,\n// A: 9,\n// R: 5,\n// Z: 1\n// };\n\nvar min = [];\nvar max = [];\nvar min2 = [];\nvar max2 = [];\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathCos = Math.cos;\nvar mathSin = Math.sin;\nvar mathSqrt = Math.sqrt;\nvar mathAbs = Math.abs;\nvar hasTypedArray = typeof Float32Array !== 'undefined';\n/**\n * @alias module:zrender/core/PathProxy\n * @constructor\n */\n\nvar PathProxy = function (notSaveData) {\n this._saveData = !(notSaveData || false);\n\n if (this._saveData) {\n /**\n * Path data. Stored as flat array\n * @type {Array.}\n */\n this.data = [];\n }\n\n this._ctx = null;\n};\n/**\n * 快速计算Path包围盒(并不是最小包围盒)\n * @return {Object}\n */\n\n\nPathProxy.prototype = {\n constructor: PathProxy,\n _xi: 0,\n _yi: 0,\n _x0: 0,\n _y0: 0,\n // Unit x, Unit y. Provide for avoiding drawing that too short line segment\n _ux: 0,\n _uy: 0,\n _len: 0,\n _lineDash: null,\n _dashOffset: 0,\n _dashIdx: 0,\n _dashSum: 0,\n\n /**\n * @readOnly\n */\n setScale: function (sx, sy) {\n this._ux = mathAbs(1 / dpr / sx) || 0;\n this._uy = mathAbs(1 / dpr / sy) || 0;\n },\n getContext: function () {\n return this._ctx;\n },\n\n /**\n * @param {CanvasRenderingContext2D} ctx\n * @return {module:zrender/core/PathProxy}\n */\n beginPath: function (ctx) {\n this._ctx = ctx;\n ctx && ctx.beginPath();\n ctx && (this.dpr = ctx.dpr); // Reset\n\n if (this._saveData) {\n this._len = 0;\n }\n\n if (this._lineDash) {\n this._lineDash = null;\n this._dashOffset = 0;\n }\n\n return this;\n },\n\n /**\n * @param {number} x\n * @param {number} y\n * @return {module:zrender/core/PathProxy}\n */\n moveTo: function (x, y) {\n this.addData(CMD.M, x, y);\n this._ctx && this._ctx.moveTo(x, y); // x0, y0, xi, yi 是记录在 _dashedXXXXTo 方法中使用\n // xi, yi 记录当前点, x0, y0 在 closePath 的时候回到起始点。\n // 有可能在 beginPath 之后直接调用 lineTo,这时候 x0, y0 需要\n // 在 lineTo 方法中记录,这里先不考虑这种情况,dashed line 也只在 IE10- 中不支持\n\n this._x0 = x;\n this._y0 = y;\n this._xi = x;\n this._yi = y;\n return this;\n },\n\n /**\n * @param {number} x\n * @param {number} y\n * @return {module:zrender/core/PathProxy}\n */\n lineTo: function (x, y) {\n var exceedUnit = mathAbs(x - this._xi) > this._ux || mathAbs(y - this._yi) > this._uy // Force draw the first segment\n || this._len < 5;\n this.addData(CMD.L, x, y);\n\n if (this._ctx && exceedUnit) {\n this._needsDash() ? this._dashedLineTo(x, y) : this._ctx.lineTo(x, y);\n }\n\n if (exceedUnit) {\n this._xi = x;\n this._yi = y;\n }\n\n return this;\n },\n\n /**\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x3\n * @param {number} y3\n * @return {module:zrender/core/PathProxy}\n */\n bezierCurveTo: function (x1, y1, x2, y2, x3, y3) {\n this.addData(CMD.C, x1, y1, x2, y2, x3, y3);\n\n if (this._ctx) {\n this._needsDash() ? this._dashedBezierTo(x1, y1, x2, y2, x3, y3) : this._ctx.bezierCurveTo(x1, y1, x2, y2, x3, y3);\n }\n\n this._xi = x3;\n this._yi = y3;\n return this;\n },\n\n /**\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @return {module:zrender/core/PathProxy}\n */\n quadraticCurveTo: function (x1, y1, x2, y2) {\n this.addData(CMD.Q, x1, y1, x2, y2);\n\n if (this._ctx) {\n this._needsDash() ? this._dashedQuadraticTo(x1, y1, x2, y2) : this._ctx.quadraticCurveTo(x1, y1, x2, y2);\n }\n\n this._xi = x2;\n this._yi = y2;\n return this;\n },\n\n /**\n * @param {number} cx\n * @param {number} cy\n * @param {number} r\n * @param {number} startAngle\n * @param {number} endAngle\n * @param {boolean} anticlockwise\n * @return {module:zrender/core/PathProxy}\n */\n arc: function (cx, cy, r, startAngle, endAngle, anticlockwise) {\n this.addData(CMD.A, cx, cy, r, r, startAngle, endAngle - startAngle, 0, anticlockwise ? 0 : 1);\n this._ctx && this._ctx.arc(cx, cy, r, startAngle, endAngle, anticlockwise);\n this._xi = mathCos(endAngle) * r + cx;\n this._yi = mathSin(endAngle) * r + cy;\n return this;\n },\n // TODO\n arcTo: function (x1, y1, x2, y2, radius) {\n if (this._ctx) {\n this._ctx.arcTo(x1, y1, x2, y2, radius);\n }\n\n return this;\n },\n // TODO\n rect: function (x, y, w, h) {\n this._ctx && this._ctx.rect(x, y, w, h);\n this.addData(CMD.R, x, y, w, h);\n return this;\n },\n\n /**\n * @return {module:zrender/core/PathProxy}\n */\n closePath: function () {\n this.addData(CMD.Z);\n var ctx = this._ctx;\n var x0 = this._x0;\n var y0 = this._y0;\n\n if (ctx) {\n this._needsDash() && this._dashedLineTo(x0, y0);\n ctx.closePath();\n }\n\n this._xi = x0;\n this._yi = y0;\n return this;\n },\n\n /**\n * Context 从外部传入,因为有可能是 rebuildPath 完之后再 fill。\n * stroke 同样\n * @param {CanvasRenderingContext2D} ctx\n * @return {module:zrender/core/PathProxy}\n */\n fill: function (ctx) {\n ctx && ctx.fill();\n this.toStatic();\n },\n\n /**\n * @param {CanvasRenderingContext2D} ctx\n * @return {module:zrender/core/PathProxy}\n */\n stroke: function (ctx) {\n ctx && ctx.stroke();\n this.toStatic();\n },\n\n /**\n * 必须在其它绘制命令前调用\n * Must be invoked before all other path drawing methods\n * @return {module:zrender/core/PathProxy}\n */\n setLineDash: function (lineDash) {\n if (lineDash instanceof Array) {\n this._lineDash = lineDash;\n this._dashIdx = 0;\n var lineDashSum = 0;\n\n for (var i = 0; i < lineDash.length; i++) {\n lineDashSum += lineDash[i];\n }\n\n this._dashSum = lineDashSum;\n }\n\n return this;\n },\n\n /**\n * 必须在其它绘制命令前调用\n * Must be invoked before all other path drawing methods\n * @return {module:zrender/core/PathProxy}\n */\n setLineDashOffset: function (offset) {\n this._dashOffset = offset;\n return this;\n },\n\n /**\n *\n * @return {boolean}\n */\n len: function () {\n return this._len;\n },\n\n /**\n * 直接设置 Path 数据\n */\n setData: function (data) {\n var len = data.length;\n\n if (!(this.data && this.data.length === len) && hasTypedArray) {\n this.data = new Float32Array(len);\n }\n\n for (var i = 0; i < len; i++) {\n this.data[i] = data[i];\n }\n\n this._len = len;\n },\n\n /**\n * 添加子路径\n * @param {module:zrender/core/PathProxy|Array.} path\n */\n appendPath: function (path) {\n if (!(path instanceof Array)) {\n path = [path];\n }\n\n var len = path.length;\n var appendSize = 0;\n var offset = this._len;\n\n for (var i = 0; i < len; i++) {\n appendSize += path[i].len();\n }\n\n if (hasTypedArray && this.data instanceof Float32Array) {\n this.data = new Float32Array(offset + appendSize);\n }\n\n for (var i = 0; i < len; i++) {\n var appendPathData = path[i].data;\n\n for (var k = 0; k < appendPathData.length; k++) {\n this.data[offset++] = appendPathData[k];\n }\n }\n\n this._len = offset;\n },\n\n /**\n * 填充 Path 数据。\n * 尽量复用而不申明新的数组。大部分图形重绘的指令数据长度都是不变的。\n */\n addData: function (cmd) {\n if (!this._saveData) {\n return;\n }\n\n var data = this.data;\n\n if (this._len + arguments.length > data.length) {\n // 因为之前的数组已经转换成静态的 Float32Array\n // 所以不够用时需要扩展一个新的动态数组\n this._expandData();\n\n data = this.data;\n }\n\n for (var i = 0; i < arguments.length; i++) {\n data[this._len++] = arguments[i];\n }\n\n this._prevCmd = cmd;\n },\n _expandData: function () {\n // Only if data is Float32Array\n if (!(this.data instanceof Array)) {\n var newData = [];\n\n for (var i = 0; i < this._len; i++) {\n newData[i] = this.data[i];\n }\n\n this.data = newData;\n }\n },\n\n /**\n * If needs js implemented dashed line\n * @return {boolean}\n * @private\n */\n _needsDash: function () {\n return this._lineDash;\n },\n _dashedLineTo: function (x1, y1) {\n var dashSum = this._dashSum;\n var offset = this._dashOffset;\n var lineDash = this._lineDash;\n var ctx = this._ctx;\n var x0 = this._xi;\n var y0 = this._yi;\n var dx = x1 - x0;\n var dy = y1 - y0;\n var dist = mathSqrt(dx * dx + dy * dy);\n var x = x0;\n var y = y0;\n var dash;\n var nDash = lineDash.length;\n var idx;\n dx /= dist;\n dy /= dist;\n\n if (offset < 0) {\n // Convert to positive offset\n offset = dashSum + offset;\n }\n\n offset %= dashSum;\n x -= offset * dx;\n y -= offset * dy;\n\n while (dx > 0 && x <= x1 || dx < 0 && x >= x1 || dx === 0 && (dy > 0 && y <= y1 || dy < 0 && y >= y1)) {\n idx = this._dashIdx;\n dash = lineDash[idx];\n x += dx * dash;\n y += dy * dash;\n this._dashIdx = (idx + 1) % nDash; // Skip positive offset\n\n if (dx > 0 && x < x0 || dx < 0 && x > x0 || dy > 0 && y < y0 || dy < 0 && y > y0) {\n continue;\n }\n\n ctx[idx % 2 ? 'moveTo' : 'lineTo'](dx >= 0 ? mathMin(x, x1) : mathMax(x, x1), dy >= 0 ? mathMin(y, y1) : mathMax(y, y1));\n } // Offset for next lineTo\n\n\n dx = x - x1;\n dy = y - y1;\n this._dashOffset = -mathSqrt(dx * dx + dy * dy);\n },\n // Not accurate dashed line to\n _dashedBezierTo: function (x1, y1, x2, y2, x3, y3) {\n var dashSum = this._dashSum;\n var offset = this._dashOffset;\n var lineDash = this._lineDash;\n var ctx = this._ctx;\n var x0 = this._xi;\n var y0 = this._yi;\n var t;\n var dx;\n var dy;\n var cubicAt = curve.cubicAt;\n var bezierLen = 0;\n var idx = this._dashIdx;\n var nDash = lineDash.length;\n var x;\n var y;\n var tmpLen = 0;\n\n if (offset < 0) {\n // Convert to positive offset\n offset = dashSum + offset;\n }\n\n offset %= dashSum; // Bezier approx length\n\n for (t = 0; t < 1; t += 0.1) {\n dx = cubicAt(x0, x1, x2, x3, t + 0.1) - cubicAt(x0, x1, x2, x3, t);\n dy = cubicAt(y0, y1, y2, y3, t + 0.1) - cubicAt(y0, y1, y2, y3, t);\n bezierLen += mathSqrt(dx * dx + dy * dy);\n } // Find idx after add offset\n\n\n for (; idx < nDash; idx++) {\n tmpLen += lineDash[idx];\n\n if (tmpLen > offset) {\n break;\n }\n }\n\n t = (tmpLen - offset) / bezierLen;\n\n while (t <= 1) {\n x = cubicAt(x0, x1, x2, x3, t);\n y = cubicAt(y0, y1, y2, y3, t); // Use line to approximate dashed bezier\n // Bad result if dash is long\n\n idx % 2 ? ctx.moveTo(x, y) : ctx.lineTo(x, y);\n t += lineDash[idx] / bezierLen;\n idx = (idx + 1) % nDash;\n } // Finish the last segment and calculate the new offset\n\n\n idx % 2 !== 0 && ctx.lineTo(x3, y3);\n dx = x3 - x;\n dy = y3 - y;\n this._dashOffset = -mathSqrt(dx * dx + dy * dy);\n },\n _dashedQuadraticTo: function (x1, y1, x2, y2) {\n // Convert quadratic to cubic using degree elevation\n var x3 = x2;\n var y3 = y2;\n x2 = (x2 + 2 * x1) / 3;\n y2 = (y2 + 2 * y1) / 3;\n x1 = (this._xi + 2 * x1) / 3;\n y1 = (this._yi + 2 * y1) / 3;\n\n this._dashedBezierTo(x1, y1, x2, y2, x3, y3);\n },\n\n /**\n * 转成静态的 Float32Array 减少堆内存占用\n * Convert dynamic array to static Float32Array\n */\n toStatic: function () {\n var data = this.data;\n\n if (data instanceof Array) {\n data.length = this._len;\n\n if (hasTypedArray) {\n this.data = new Float32Array(data);\n }\n }\n },\n\n /**\n * @return {module:zrender/core/BoundingRect}\n */\n getBoundingRect: function () {\n min[0] = min[1] = min2[0] = min2[1] = Number.MAX_VALUE;\n max[0] = max[1] = max2[0] = max2[1] = -Number.MAX_VALUE;\n var data = this.data;\n var xi = 0;\n var yi = 0;\n var x0 = 0;\n var y0 = 0;\n\n for (var i = 0; i < data.length;) {\n var cmd = data[i++];\n\n if (i === 1) {\n // 如果第一个命令是 L, C, Q\n // 则 previous point 同绘制命令的第一个 point\n //\n // 第一个命令为 Arc 的情况下会在后面特殊处理\n xi = data[i];\n yi = data[i + 1];\n x0 = xi;\n y0 = yi;\n }\n\n switch (cmd) {\n case CMD.M:\n // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点\n // 在 closePath 的时候使用\n x0 = data[i++];\n y0 = data[i++];\n xi = x0;\n yi = y0;\n min2[0] = x0;\n min2[1] = y0;\n max2[0] = x0;\n max2[1] = y0;\n break;\n\n case CMD.L:\n bbox.fromLine(xi, yi, data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.C:\n bbox.fromCubic(xi, yi, data[i++], data[i++], data[i++], data[i++], data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.Q:\n bbox.fromQuadratic(xi, yi, data[i++], data[i++], data[i], data[i + 1], min2, max2);\n xi = data[i++];\n yi = data[i++];\n break;\n\n case CMD.A:\n // TODO Arc 判断的开销比较大\n var cx = data[i++];\n var cy = data[i++];\n var rx = data[i++];\n var ry = data[i++];\n var startAngle = data[i++];\n var endAngle = data[i++] + startAngle; // TODO Arc 旋转\n\n i += 1;\n var anticlockwise = 1 - data[i++];\n\n if (i === 1) {\n // 直接使用 arc 命令\n // 第一个命令起点还未定义\n x0 = mathCos(startAngle) * rx + cx;\n y0 = mathSin(startAngle) * ry + cy;\n }\n\n bbox.fromArc(cx, cy, rx, ry, startAngle, endAngle, anticlockwise, min2, max2);\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n\n case CMD.R:\n x0 = xi = data[i++];\n y0 = yi = data[i++];\n var width = data[i++];\n var height = data[i++]; // Use fromLine\n\n bbox.fromLine(x0, y0, x0 + width, y0 + height, min2, max2);\n break;\n\n case CMD.Z:\n xi = x0;\n yi = y0;\n break;\n } // Union\n\n\n vec2.min(min, min, min2);\n vec2.max(max, max, max2);\n } // No data\n\n\n if (i === 0) {\n min[0] = min[1] = max[0] = max[1] = 0;\n }\n\n return new BoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]);\n },\n\n /**\n * Rebuild path from current data\n * Rebuild path will not consider javascript implemented line dash.\n * @param {CanvasRenderingContext2D} ctx\n */\n rebuildPath: function (ctx) {\n var d = this.data;\n var x0, y0;\n var xi, yi;\n var x, y;\n var ux = this._ux;\n var uy = this._uy;\n var len = this._len;\n\n for (var i = 0; i < len;) {\n var cmd = d[i++];\n\n if (i === 1) {\n // 如果第一个命令是 L, C, Q\n // 则 previous point 同绘制命令的第一个 point\n //\n // 第一个命令为 Arc 的情况下会在后面特殊处理\n xi = d[i];\n yi = d[i + 1];\n x0 = xi;\n y0 = yi;\n }\n\n switch (cmd) {\n case CMD.M:\n x0 = xi = d[i++];\n y0 = yi = d[i++];\n ctx.moveTo(xi, yi);\n break;\n\n case CMD.L:\n x = d[i++];\n y = d[i++]; // Not draw too small seg between\n\n if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len - 1) {\n ctx.lineTo(x, y);\n xi = x;\n yi = y;\n }\n\n break;\n\n case CMD.C:\n ctx.bezierCurveTo(d[i++], d[i++], d[i++], d[i++], d[i++], d[i++]);\n xi = d[i - 2];\n yi = d[i - 1];\n break;\n\n case CMD.Q:\n ctx.quadraticCurveTo(d[i++], d[i++], d[i++], d[i++]);\n xi = d[i - 2];\n yi = d[i - 1];\n break;\n\n case CMD.A:\n var cx = d[i++];\n var cy = d[i++];\n var rx = d[i++];\n var ry = d[i++];\n var theta = d[i++];\n var dTheta = d[i++];\n var psi = d[i++];\n var fs = d[i++];\n var r = rx > ry ? rx : ry;\n var scaleX = rx > ry ? 1 : rx / ry;\n var scaleY = rx > ry ? ry / rx : 1;\n var isEllipse = Math.abs(rx - ry) > 1e-3;\n var endAngle = theta + dTheta;\n\n if (isEllipse) {\n ctx.translate(cx, cy);\n ctx.rotate(psi);\n ctx.scale(scaleX, scaleY);\n ctx.arc(0, 0, r, theta, endAngle, 1 - fs);\n ctx.scale(1 / scaleX, 1 / scaleY);\n ctx.rotate(-psi);\n ctx.translate(-cx, -cy);\n } else {\n ctx.arc(cx, cy, r, theta, endAngle, 1 - fs);\n }\n\n if (i === 1) {\n // 直接使用 arc 命令\n // 第一个命令起点还未定义\n x0 = mathCos(theta) * rx + cx;\n y0 = mathSin(theta) * ry + cy;\n }\n\n xi = mathCos(endAngle) * rx + cx;\n yi = mathSin(endAngle) * ry + cy;\n break;\n\n case CMD.R:\n x0 = xi = d[i];\n y0 = yi = d[i + 1];\n ctx.rect(d[i++], d[i++], d[i++], d[i++]);\n break;\n\n case CMD.Z:\n ctx.closePath();\n xi = x0;\n yi = y0;\n }\n }\n }\n};\nPathProxy.CMD = CMD;\nvar _default = PathProxy;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9QYXRoUHJveHkuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9QYXRoUHJveHkuanM/MjBjOCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY3VydmUgPSByZXF1aXJlKFwiLi9jdXJ2ZVwiKTtcblxudmFyIHZlYzIgPSByZXF1aXJlKFwiLi92ZWN0b3JcIik7XG5cbnZhciBiYm94ID0gcmVxdWlyZShcIi4vYmJveFwiKTtcblxudmFyIEJvdW5kaW5nUmVjdCA9IHJlcXVpcmUoXCIuL0JvdW5kaW5nUmVjdFwiKTtcblxudmFyIF9jb25maWcgPSByZXF1aXJlKFwiLi4vY29uZmlnXCIpO1xuXG52YXIgZHByID0gX2NvbmZpZy5kZXZpY2VQaXhlbFJhdGlvO1xuXG4vKipcbiAqIFBhdGgg5Luj55CG77yM5Y+v5Lul5ZyoYGJ1aWxkUGF0aGDkuK3nlKjkuo7mm7/ku6NgY3R4YCwg5Lya5L+d5a2Y5q+P5LiqcGF0aOaTjeS9nOeahOWRveS7pOWIsHBh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esrOS4gOS4quWRveS7pOS4uiBBcmMg55qE5oOF5Ya15LiL5Lya5Zyo5ZCO6Z2i54m55q6K5aSE55CGXG4gICAgICAgIHhpID0gZGF0YVtpXTtcbiAgICAgICAgeWkgPSBkYXRhW2kgKyAxXTtcbiAgICAgICAgeDAgPSB4aTtcbiAgICAgICAgeTAgPSB5aTtcbiAgICAgIH1cblxuICAgICAgc3dpdGNoIChjbWQpIHtcbiAgICAgICAgY2FzZSBDTUQuTTpcbiAgICAgICAgICAvLyBtb3ZlVG8g5ZG95Luk6YeN5paw5Yib5bu65LiA5Liq5paw55qEIHN1YnBhdGgsIOW5tuS4lOabtOaWsOaWsOeahOi1t+eCuVxuICAgICAgICAgIC8vIOWcqCBjbG9zZVBhdGgg55qE5pe25YCZ5L2/55SoXG4gICAgICAgICAgeDAgPSBkYXRhW2krK107XG4gICAgICAgICAgeTAgPSBkYXRhW2krK107XG4gICAgICAgICAgeGkgPSB4MDtcbiAgICAgICAgICB5aSA9IHkwO1xuICAgICAgICAgIG1pbjJbMF0gPSB4MDtcbiAgICAgICAgICBtaW4yWzFdID0geTA7XG4gICAgICAgICAgbWF4MlswXSA9IHgwO1xuICAgICAgICAgIG1heDJbMV0gPSB5MDtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIENNRC5MOlxuICAgICAgICAgIGJib3guZnJvbUxpbmUoeGksIHlpLCBkYXRhW2ldLCBkYXRhW2kgKyAxXSwgbWluMiwgbWF4Mik7XG4gICAgICAgICAgeGkgPSBkYXRhW2krK107XG4gICAgICAgICAgeWkgPSBkYXRhW2krK107XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTUQuQzpcbiAgICAgICAgICBiYm94LmZyb21DdWJpYyh4aSwgeWksIGRhdGFbaSsrXSwgZGF0YVtpKytdLCBkYXRhW2krK10sIGRhdGFbaSsrXSwgZGF0YVtpXSwgZGF0YVtpICsgMV0sIG1pbjIsIG1heDIpO1xuICAgICAgICAgIHhpID0gZGF0YVtpKytdO1xuICAgICAgICAgIHlpID0gZGF0YVtpKytdO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgQ01ELlE6XG4gICAgICAgICAgYmJveC5mcm9tUXVhZHJhdGljKHhpLCB5aSwgZGF0YVtpKytdLCBkYXRhW2krK10sIGRhdGFbaV0sIGRhdGFbaSArIDFdLCBtaW4yLCBtYXgyKTtcbiAgICAgICAgICB4aSA9IGRhdGFbaSsrXTtcbiAgICAgICAgICB5aSA9IGRhdGFbaSsrXTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIENNRC5BOlxuICAgICAgICAgIC8vIFRPRE8gQXJjIOWIpOaWreeahOW8gOmUgOavlOi+g+Wkp1xuICAgICAgICAgIHZhciBjeCA9IGRhdGFbaSsrXTtcbiAgICAgICAgICB2YXIgY3kgPSBkYXRhW2krK107XG4gICAgICAgICAgdmFyIHJ4ID0gZGF0YVtpKytdO1xuICAgICAgICAgIHZhciByeSA9IGRhdGFbaSsrXTtcbiAgICAgICAgICB2YXIgc3RhcnRBbmdsZSA9IGRhdGFbaSsrXTtcbiAgICAgICAgICB2YXIgZW5kQW5nbGUgPSBkYXRhW2krK10gKyBzdGFydEFuZ2xlOyAvLyBUT0RPIEFyYyDml4vovaxcblxuICAgICAgICAgIGkgKz0gMTtcbiAgICAgICAgICB2YXIgYW50aWNsb2Nrd2lzZSA9IDEgLSBkYXRhW2krK107XG5cbiAgICAgICAgICBpZiAoaSA9PT0gMSkge1xuICAgICAgICAgICAgLy8g55u05o6l5L2/55SoIGFyYyDlkb3ku6RcbiAgICAgICAgICAgIC8vIOesrOS4gOS4quWRveS7pOi1t+eCuei/mOacquWumuS5iVxuICAgICAgICAgICAgeDAgPSBtYXRoQ29zKHN0YXJ0QW5nbGUpICogcnggKyBjeDtcbiAgICAgICAgICAgIHkwID0gbWF0aFNpbihzdGFydEFuZ2xlKSAqIHJ5ICsgY3k7XG4gICAgICAgICAgfVxuXG4gICAg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gY2FzZSBDTUQuTDpcbiAgICAgICAgICB4ID0gZFtpKytdO1xuICAgICAgICAgIHkgPSBkW2krK107IC8vIE5vdCBkcmF3IHRvbyBzbWFsbCBzZWcgYmV0d2VlblxuXG4gICAgICAgICAgaWYgKG1hdGhBYnMoeCAtIHhpKSA+IHV4IHx8IG1hdGhBYnMoeSAtIHlpKSA+IHV5IHx8IGkgPT09IGxlbiAtIDEpIHtcbiAgICAgICAgICAgIGN0eC5saW5lVG8oeCwgeSk7XG4gICAgICAgICAgICB4aSA9IHg7XG4gICAgICAgICAgICB5aSA9IHk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTUQuQzpcbiAgICAgICAgICBjdHguYmV6aWVyQ3VydmVUbyhkW2krK10sIGRbaSsrXSwgZFtpKytdLCBkW2krK10sIGRbaSsrXSwgZFtpKytdKTtcbiAgICAgICAgICB4aSA9IGRbaSAtIDJdO1xuICAgICAgICAgIHlpID0gZFtpIC0gMV07XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSBDTUQuUTpcbiAgICAgICAgICBjdHgucXVhZHJhdGljQ3VydmVUbyhkW2krK10sIGRbaSsrXSwgZFtpKytdLCBkW2krK10pO1xuICAgICAgICAgIHhpID0gZFtpIC0gMl07XG4gICAgICAgICAgeWkgPSBkW2kgLSAxXTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlIENNRC5BOlxuICAgICAgICAgIHZhciBjeCA9IGRbaSsrXTtcbiAgICAgICAgICB2YXIgY3kgPSBkW2krK107XG4gICAgICAgICAgdmFyIHJ4ID0gZFtpKytdO1xuICAgICAgICAgIHZhciByeSA9IGRbaSsrXTtcbiAgICAgICAgICB2YXIgdGhldGEgPSBkW2krK107XG4gICAgICAgICAgdmFyIGRUaGV0YSA9IGRbaSsrXTtcbiAgICAgICAgICB2YXIgcHNpID0gZFtpKytdO1xuICAgICAgICAgIHZhciBmcyA9IGRbaSsrXTtcbiAgICAgICAgICB2YXIgciA9IHJ4ID4gcnkgPyByeCA6IHJ5O1xuICAgICAgICAgIHZhciBzY2FsZVggPSByeCA+IHJ5ID8gMSA6IHJ4IC8gcnk7XG4gICAgICAgICAgdmFyIHNjYWxlWSA9IHJ4ID4gcnkgPyByeSAvIHJ4IDogMTtcbiAgICAgICAgICB2YXIgaXNFbGxpcHNlID0gTWF0aC5hYnMocnggLSByeSkgPiAxZS0zO1xuICAgICAgICAgIHZhciBlbmRBbmdsZSA9IHRoZXRhICsgZFRoZXRhO1xuXG4gICAgICAgICAgaWYgKGlzRWxsaXBzZSkge1xuICAgICAgICAgICAgY3R4LnRyYW5zbGF0ZShjeCwgY3kpO1xuICAgICAgICAgICAgY3R4LnJvdGF0ZShwc2kpO1xuICAgICAgICAgICAgY3R4LnNjYWxlKHNjYWxlWCwgc2NhbGVZKTtcbiAgICAgICAgICAgIGN0eC5hcmMoMCwgMCwgciwgdGhldGEsIGVuZEFuZ2xlLCAxIC0gZnMpO1xuICAgICAgICAgICAgY3R4LnNjYWxlKDEgLyBzY2FsZVgsIDEgLyBzY2FsZVkpO1xuICAgICAgICAgICAgY3R4LnJvdGF0ZSgtcHNpKTtcbiAgICAgICAgICAgIGN0eC50cmFuc2xhdGUoLWN4LCAtY3kpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBjdHguYXJjKGN4LCBjeSwgciwgdGhldGEsIGVuZEFuZ2xlLCAxIC0gZnMpO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGlmIChpID09PSAxKSB7XG4gICAgICAgICAgICAvLyDnm7TmjqXkvb/nlKggYXJjIOWRveS7pFxuICAgICAgICAgICAgLy8g56ys5LiA5Liq5ZG95Luk6LW354K56L+Y5pyq5a6a5LmJXG4gICAgICAgICAgICB4MCA9IG1hdGhDb3ModGhldGEpICogcnggKyBjeDtcbiAgICAgICAgICAgIHkwID0gbWF0aFNpbih0aGV0YSkgKiByeSArIGN5O1xuICAgICAgIC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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/PathProxy.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/bbox.js": +/*!***********************************************!*\ + !*** ./node_modules/zrender/lib/core/bbox.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var vec2 = __webpack_require__(/*! ./vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar curve = __webpack_require__(/*! ./curve */ \"./node_modules/zrender/lib/core/curve.js\");\n\n/**\n * @author Yi Shen(https://github.com/pissang)\n */\nvar mathMin = Math.min;\nvar mathMax = Math.max;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI2 = Math.PI * 2;\nvar start = vec2.create();\nvar end = vec2.create();\nvar extremity = vec2.create();\n/**\n * 从顶点数组中计算出最小包围盒,写入`min`和`max`中\n * @module zrender/core/bbox\n * @param {Array} points 顶点数组\n * @param {number} min\n * @param {number} max\n */\n\nfunction fromPoints(points, min, max) {\n if (points.length === 0) {\n return;\n }\n\n var p = points[0];\n var left = p[0];\n var right = p[0];\n var top = p[1];\n var bottom = p[1];\n var i;\n\n for (i = 1; i < points.length; i++) {\n p = points[i];\n left = mathMin(left, p[0]);\n right = mathMax(right, p[0]);\n top = mathMin(top, p[1]);\n bottom = mathMax(bottom, p[1]);\n }\n\n min[0] = left;\n min[1] = top;\n max[0] = right;\n max[1] = bottom;\n}\n/**\n * @memberOf module:zrender/core/bbox\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {Array.} min\n * @param {Array.} max\n */\n\n\nfunction fromLine(x0, y0, x1, y1, min, max) {\n min[0] = mathMin(x0, x1);\n min[1] = mathMin(y0, y1);\n max[0] = mathMax(x0, x1);\n max[1] = mathMax(y0, y1);\n}\n\nvar xDim = [];\nvar yDim = [];\n/**\n * 从三阶贝塞尔曲线(p0, p1, p2, p3)中计算出最小包围盒,写入`min`和`max`中\n * @memberOf module:zrender/core/bbox\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x3\n * @param {number} y3\n * @param {Array.} min\n * @param {Array.} max\n */\n\nfunction fromCubic(x0, y0, x1, y1, x2, y2, x3, y3, min, max) {\n var cubicExtrema = curve.cubicExtrema;\n var cubicAt = curve.cubicAt;\n var i;\n var n = cubicExtrema(x0, x1, x2, x3, xDim);\n min[0] = Infinity;\n min[1] = Infinity;\n max[0] = -Infinity;\n max[1] = -Infinity;\n\n for (i = 0; i < n; i++) {\n var x = cubicAt(x0, x1, x2, x3, xDim[i]);\n min[0] = mathMin(x, min[0]);\n max[0] = mathMax(x, max[0]);\n }\n\n n = cubicExtrema(y0, y1, y2, y3, yDim);\n\n for (i = 0; i < n; i++) {\n var y = cubicAt(y0, y1, y2, y3, yDim[i]);\n min[1] = mathMin(y, min[1]);\n max[1] = mathMax(y, max[1]);\n }\n\n min[0] = mathMin(x0, min[0]);\n max[0] = mathMax(x0, max[0]);\n min[0] = mathMin(x3, min[0]);\n max[0] = mathMax(x3, max[0]);\n min[1] = mathMin(y0, min[1]);\n max[1] = mathMax(y0, max[1]);\n min[1] = mathMin(y3, min[1]);\n max[1] = mathMax(y3, max[1]);\n}\n/**\n * 从二阶贝塞尔曲线(p0, p1, p2)中计算出最小包围盒,写入`min`和`max`中\n * @memberOf module:zrender/core/bbox\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {Array.} min\n * @param {Array.} max\n */\n\n\nfunction fromQuadratic(x0, y0, x1, y1, x2, y2, min, max) {\n var quadraticExtremum = curve.quadraticExtremum;\n var quadraticAt = curve.quadraticAt; // Find extremities, where derivative in x dim or y dim is zero\n\n var tx = mathMax(mathMin(quadraticExtremum(x0, x1, x2), 1), 0);\n var ty = mathMax(mathMin(quadraticExtremum(y0, y1, y2), 1), 0);\n var x = quadraticAt(x0, x1, x2, tx);\n var y = quadraticAt(y0, y1, y2, ty);\n min[0] = mathMin(x0, x2, x);\n min[1] = mathMin(y0, y2, y);\n max[0] = mathMax(x0, x2, x);\n max[1] = mathMax(y0, y2, y);\n}\n/**\n * 从圆弧中计算出最小包围盒,写入`min`和`max`中\n * @method\n * @memberOf module:zrender/core/bbox\n * @param {number} x\n * @param {number} y\n * @param {number} rx\n * @param {number} ry\n * @param {number} startAngle\n * @param {number} endAngle\n * @param {number} anticlockwise\n * @param {Array.} min\n * @param {Array.} max\n */\n\n\nfunction fromArc(x, y, rx, ry, startAngle, endAngle, anticlockwise, min, max) {\n var vec2Min = vec2.min;\n var vec2Max = vec2.max;\n var diff = Math.abs(startAngle - endAngle);\n\n if (diff % PI2 < 1e-4 && diff > 1e-4) {\n // Is a circle\n min[0] = x - rx;\n min[1] = y - ry;\n max[0] = x + rx;\n max[1] = y + ry;\n return;\n }\n\n start[0] = mathCos(startAngle) * rx + x;\n start[1] = mathSin(startAngle) * ry + y;\n end[0] = mathCos(endAngle) * rx + x;\n end[1] = mathSin(endAngle) * ry + y;\n vec2Min(min, start, end);\n vec2Max(max, start, end); // Thresh to [0, Math.PI * 2]\n\n startAngle = startAngle % PI2;\n\n if (startAngle < 0) {\n startAngle = startAngle + PI2;\n }\n\n endAngle = endAngle % PI2;\n\n if (endAngle < 0) {\n endAngle = endAngle + PI2;\n }\n\n if (startAngle > endAngle && !anticlockwise) {\n endAngle += PI2;\n } else if (startAngle < endAngle && anticlockwise) {\n startAngle += PI2;\n }\n\n if (anticlockwise) {\n var tmp = endAngle;\n endAngle = startAngle;\n startAngle = tmp;\n } // var number = 0;\n // var step = (anticlockwise ? -Math.PI : Math.PI) / 2;\n\n\n for (var angle = 0; angle < endAngle; angle += Math.PI / 2) {\n if (angle > startAngle) {\n extremity[0] = mathCos(angle) * rx + x;\n extremity[1] = mathSin(angle) * ry + y;\n vec2Min(min, extremity, min);\n vec2Max(max, extremity, max);\n }\n }\n}\n\nexports.fromPoints = fromPoints;\nexports.fromLine = fromLine;\nexports.fromCubic = fromCubic;\nexports.fromQuadratic = fromQuadratic;\nexports.fromArc = fromArc;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9iYm94LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWN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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/bbox.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/curve.js": +/*!************************************************!*\ + !*** ./node_modules/zrender/lib/core/curve.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var _vector = __webpack_require__(/*! ./vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar v2Create = _vector.create;\nvar v2DistSquare = _vector.distSquare;\n\n/**\n * 曲线辅助模块\n * @module zrender/core/curve\n * @author pissang(https://www.github.com/pissang)\n */\nvar mathPow = Math.pow;\nvar mathSqrt = Math.sqrt;\nvar EPSILON = 1e-8;\nvar EPSILON_NUMERIC = 1e-4;\nvar THREE_SQRT = mathSqrt(3);\nvar ONE_THIRD = 1 / 3; // 临时变量\n\nvar _v0 = v2Create();\n\nvar _v1 = v2Create();\n\nvar _v2 = v2Create();\n\nfunction isAroundZero(val) {\n return val > -EPSILON && val < EPSILON;\n}\n\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\n/**\n * 计算三次贝塞尔值\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} t\n * @return {number}\n */\n\n\nfunction cubicAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return onet * onet * (onet * p0 + 3 * t * p1) + t * t * (t * p3 + 3 * onet * p2);\n}\n/**\n * 计算三次贝塞尔导数值\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} t\n * @return {number}\n */\n\n\nfunction cubicDerivativeAt(p0, p1, p2, p3, t) {\n var onet = 1 - t;\n return 3 * (((p1 - p0) * onet + 2 * (p2 - p1) * t) * onet + (p3 - p2) * t * t);\n}\n/**\n * 计算三次贝塞尔方程根,使用盛金公式\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} val\n * @param {Array.} roots\n * @return {number} 有效根数目\n */\n\n\nfunction cubicRootAt(p0, p1, p2, p3, val, roots) {\n // Evaluate roots of cubic functions\n var a = p3 + 3 * (p1 - p2) - p0;\n var b = 3 * (p2 - p1 * 2 + p0);\n var c = 3 * (p1 - p0);\n var d = p0 - val;\n var A = b * b - 3 * a * c;\n var B = b * c - 9 * a * d;\n var C = c * c - 3 * b * d;\n var n = 0;\n\n if (isAroundZero(A) && isAroundZero(B)) {\n if (isAroundZero(b)) {\n roots[0] = 0;\n } else {\n var t1 = -c / b; //t1, t2, t3, b is not zero\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n } else {\n var disc = B * B - 4 * A * C;\n\n if (isAroundZero(disc)) {\n var K = B / A;\n var t1 = -b / a + K; // t1, a is not zero\n\n var t2 = -K / 2; // t2, t3\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n } else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var Y1 = A * b + 1.5 * a * (-B + discSqrt);\n var Y2 = A * b + 1.5 * a * (-B - discSqrt);\n\n if (Y1 < 0) {\n Y1 = -mathPow(-Y1, ONE_THIRD);\n } else {\n Y1 = mathPow(Y1, ONE_THIRD);\n }\n\n if (Y2 < 0) {\n Y2 = -mathPow(-Y2, ONE_THIRD);\n } else {\n Y2 = mathPow(Y2, ONE_THIRD);\n }\n\n var t1 = (-b - (Y1 + Y2)) / (3 * a);\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n } else {\n var T = (2 * A * b - 3 * a * B) / (2 * mathSqrt(A * A * A));\n var theta = Math.acos(T) / 3;\n var ASqrt = mathSqrt(A);\n var tmp = Math.cos(theta);\n var t1 = (-b - 2 * ASqrt * tmp) / (3 * a);\n var t2 = (-b + ASqrt * (tmp + THREE_SQRT * Math.sin(theta))) / (3 * a);\n var t3 = (-b + ASqrt * (tmp - THREE_SQRT * Math.sin(theta))) / (3 * a);\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n\n if (t3 >= 0 && t3 <= 1) {\n roots[n++] = t3;\n }\n }\n }\n\n return n;\n}\n/**\n * 计算三次贝塞尔方程极限值的位置\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {Array.} extrema\n * @return {number} 有效数目\n */\n\n\nfunction cubicExtrema(p0, p1, p2, p3, extrema) {\n var b = 6 * p2 - 12 * p1 + 6 * p0;\n var a = 9 * p1 + 3 * p3 - 3 * p0 - 9 * p2;\n var c = 3 * p1 - 3 * p0;\n var n = 0;\n\n if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n }\n } else {\n var disc = b * b - 4 * a * c;\n\n if (isAroundZero(disc)) {\n extrema[0] = -b / (2 * a);\n } else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var t1 = (-b + discSqrt) / (2 * a);\n var t2 = (-b - discSqrt) / (2 * a);\n\n if (t1 >= 0 && t1 <= 1) {\n extrema[n++] = t1;\n }\n\n if (t2 >= 0 && t2 <= 1) {\n extrema[n++] = t2;\n }\n }\n }\n\n return n;\n}\n/**\n * 细分三次贝塞尔曲线\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} p3\n * @param {number} t\n * @param {Array.} out\n */\n\n\nfunction cubicSubdivide(p0, p1, p2, p3, t, out) {\n var p01 = (p1 - p0) * t + p0;\n var p12 = (p2 - p1) * t + p1;\n var p23 = (p3 - p2) * t + p2;\n var p012 = (p12 - p01) * t + p01;\n var p123 = (p23 - p12) * t + p12;\n var p0123 = (p123 - p012) * t + p012; // Seg0\n\n out[0] = p0;\n out[1] = p01;\n out[2] = p012;\n out[3] = p0123; // Seg1\n\n out[4] = p0123;\n out[5] = p123;\n out[6] = p23;\n out[7] = p3;\n}\n/**\n * 投射点到三次贝塞尔曲线上,返回投射距离。\n * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x3\n * @param {number} y3\n * @param {number} x\n * @param {number} y\n * @param {Array.} [out] 投射点\n * @return {number}\n */\n\n\nfunction cubicProjectPoint(x0, y0, x1, y1, x2, y2, x3, y3, x, y, out) {\n // http://pomax.github.io/bezierinfo/#projections\n var t;\n var interval = 0.005;\n var d = Infinity;\n var prev;\n var next;\n var d1;\n var d2;\n _v0[0] = x;\n _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值\n // PENDING\n\n for (var _t = 0; _t < 1; _t += 0.05) {\n _v1[0] = cubicAt(x0, x1, x2, x3, _t);\n _v1[1] = cubicAt(y0, y1, y2, y3, _t);\n d1 = v2DistSquare(_v0, _v1);\n\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n\n d = Infinity; // At most 32 iteration\n\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n\n prev = t - interval;\n next = t + interval; // t - interval\n\n _v1[0] = cubicAt(x0, x1, x2, x3, prev);\n _v1[1] = cubicAt(y0, y1, y2, y3, prev);\n d1 = v2DistSquare(_v1, _v0);\n\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n } else {\n // t + interval\n _v2[0] = cubicAt(x0, x1, x2, x3, next);\n _v2[1] = cubicAt(y0, y1, y2, y3, next);\n d2 = v2DistSquare(_v2, _v0);\n\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n } else {\n interval *= 0.5;\n }\n }\n } // t\n\n\n if (out) {\n out[0] = cubicAt(x0, x1, x2, x3, t);\n out[1] = cubicAt(y0, y1, y2, y3, t);\n } // console.log(interval, i);\n\n\n return mathSqrt(d);\n}\n/**\n * 计算二次方贝塞尔值\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} t\n * @return {number}\n */\n\n\nfunction quadraticAt(p0, p1, p2, t) {\n var onet = 1 - t;\n return onet * (onet * p0 + 2 * t * p1) + t * t * p2;\n}\n/**\n * 计算二次方贝塞尔导数值\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} t\n * @return {number}\n */\n\n\nfunction quadraticDerivativeAt(p0, p1, p2, t) {\n return 2 * ((1 - t) * (p1 - p0) + t * (p2 - p1));\n}\n/**\n * 计算二次方贝塞尔方程根\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} t\n * @param {Array.} roots\n * @return {number} 有效根数目\n */\n\n\nfunction quadraticRootAt(p0, p1, p2, val, roots) {\n var a = p0 - 2 * p1 + p2;\n var b = 2 * (p1 - p0);\n var c = p0 - val;\n var n = 0;\n\n if (isAroundZero(a)) {\n if (isNotAroundZero(b)) {\n var t1 = -c / b;\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n }\n } else {\n var disc = b * b - 4 * a * c;\n\n if (isAroundZero(disc)) {\n var t1 = -b / (2 * a);\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n } else if (disc > 0) {\n var discSqrt = mathSqrt(disc);\n var t1 = (-b + discSqrt) / (2 * a);\n var t2 = (-b - discSqrt) / (2 * a);\n\n if (t1 >= 0 && t1 <= 1) {\n roots[n++] = t1;\n }\n\n if (t2 >= 0 && t2 <= 1) {\n roots[n++] = t2;\n }\n }\n }\n\n return n;\n}\n/**\n * 计算二次贝塞尔方程极限值\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @return {number}\n */\n\n\nfunction quadraticExtremum(p0, p1, p2) {\n var divider = p0 + p2 - 2 * p1;\n\n if (divider === 0) {\n // p1 is center of p0 and p2\n return 0.5;\n } else {\n return (p0 - p1) / divider;\n }\n}\n/**\n * 细分二次贝塞尔曲线\n * @memberOf module:zrender/core/curve\n * @param {number} p0\n * @param {number} p1\n * @param {number} p2\n * @param {number} t\n * @param {Array.} out\n */\n\n\nfunction quadraticSubdivide(p0, p1, p2, t, out) {\n var p01 = (p1 - p0) * t + p0;\n var p12 = (p2 - p1) * t + p1;\n var p012 = (p12 - p01) * t + p01; // Seg0\n\n out[0] = p0;\n out[1] = p01;\n out[2] = p012; // Seg1\n\n out[3] = p012;\n out[4] = p12;\n out[5] = p2;\n}\n/**\n * 投射点到二次贝塞尔曲线上,返回投射距离。\n * 投射点有可能会有一个或者多个,这里只返回其中距离最短的一个。\n * @param {number} x0\n * @param {number} y0\n * @param {number} x1\n * @param {number} y1\n * @param {number} x2\n * @param {number} y2\n * @param {number} x\n * @param {number} y\n * @param {Array.} out 投射点\n * @return {number}\n */\n\n\nfunction quadraticProjectPoint(x0, y0, x1, y1, x2, y2, x, y, out) {\n // http://pomax.github.io/bezierinfo/#projections\n var t;\n var interval = 0.005;\n var d = Infinity;\n _v0[0] = x;\n _v0[1] = y; // 先粗略估计一下可能的最小距离的 t 值\n // PENDING\n\n for (var _t = 0; _t < 1; _t += 0.05) {\n _v1[0] = quadraticAt(x0, x1, x2, _t);\n _v1[1] = quadraticAt(y0, y1, y2, _t);\n var d1 = v2DistSquare(_v0, _v1);\n\n if (d1 < d) {\n t = _t;\n d = d1;\n }\n }\n\n d = Infinity; // At most 32 iteration\n\n for (var i = 0; i < 32; i++) {\n if (interval < EPSILON_NUMERIC) {\n break;\n }\n\n var prev = t - interval;\n var next = t + interval; // t - interval\n\n _v1[0] = quadraticAt(x0, x1, x2, prev);\n _v1[1] = quadraticAt(y0, y1, y2, prev);\n var d1 = v2DistSquare(_v1, _v0);\n\n if (prev >= 0 && d1 < d) {\n t = prev;\n d = d1;\n } else {\n // t + interval\n _v2[0] = quadraticAt(x0, x1, x2, next);\n _v2[1] = quadraticAt(y0, y1, y2, next);\n var d2 = v2DistSquare(_v2, _v0);\n\n if (next <= 1 && d2 < d) {\n t = next;\n d = d2;\n } else {\n interval *= 0.5;\n }\n }\n } // t\n\n\n if (out) {\n out[0] = quadraticAt(x0, x1, x2, t);\n out[1] = quadraticAt(y0, y1, y2, t);\n } // console.log(interval, i);\n\n\n return mathSqrt(d);\n}\n\nexports.cubicAt = cubicAt;\nexports.cubicDerivativeAt = cubicDerivativeAt;\nexports.cubicRootAt = cubicRootAt;\nexports.cubicExtrema = cubicExtrema;\nexports.cubicSubdivide = cubicSubdivide;\nexports.cubicProjectPoint = cubicProjectPoint;\nexports.quadraticAt = quadraticAt;\nexports.quadraticDerivativeAt = quadraticDerivativeAt;\nexports.quadraticRootAt = quadraticRootAt;\nexports.quadraticExtremum = quadraticExtremum;\nexports.quadraticSubdivide = quadraticSubdivide;\nexports.quadraticProjectPoint = quadraticProjectPoint;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9jdXJ2ZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9jb3JlL2N1cnZlLmpzPzRhM2YiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIF92ZWN0b3IgPSByZXF1aXJlKFwiLi92ZWN0b3JcIik7XG5cbnZhciB2MkNyZWF0ZSA9IF92ZWN0b3IuY3JlYXRlO1xudmFyIHYyRGlzdFNxdWFyZSA9IF92ZWN0b3IuZGlzdFNxdWFyZTtcblxuLyoqXG4gKiDmm7Lnur/ovoXliqnmqKHlnZdcbiAqIEBtb2R1bGUgenJlbmRlci9jb3JlL2N1cnZlXG4gKiBAYXV0aG9yIHBpc3NhbmcoaHR0cHM6Ly93d3cuZ2l0aHViLmNvbS9waXNzYW5nKVxuICovXG52YXIgbWF0aFBvdyA9IE1hdGgucG93O1xudmFyIG1hdGhTcXJ0ID0gTWF0aC5zcXJ0O1xudmFyIEVQU0lMT04gPSAxZS04O1xudmFyIEVQU0lMT05fTlVNRVJJQyA9IDFlLTQ7XG52YXIgVEhSRUVfU1FSVCA9IG1hdGhTcXJ0KDMpO1xudmFyIE9ORV9USElSRCA9IDEgLyAzOyAvLyDkuLTml7blj5jph49cblxudmFyIF92MCA9IHYyQ3JlYXRlKCk7XG5cbnZhciBfdjEgPSB2MkNyZWF0ZSgpO1xuXG52YXIgX3YyID0gdjJDcmVhdGUoKTtcblxuZnVuY3Rpb24gaXNBcm91bmRaZXJvKHZhbCkge1xuICByZXR1cm4gdmFsID4gLUVQU0lMT04gJiYgdmFsIDwgRVBTSUxPTjtcbn1cblxuZnVuY3Rpb24ga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PSAxKSB7XG4gICAgICAgIHJvb3RzW24rK10gPSB0MTtcbiAgICAgIH1cbiAgICB9XG4gIH0gZWxzZSB7XG4gICAgdmFyIGRpc2MgPSBCICogQiAtIDQgKiBBICogQztcblxuICAgIGlmIChpc0Fyb3VuZFplcm8oZGlzYykpIHtcbiAgICAgIHZhciBLID0gQiAvIEE7XG4gICAgICB2YXIgdDEgPSAtYiAvIGEgKyBLOyAvLyB0MSwgYSBpcyBub3QgemVyb1xuXG4gICAgICB2YXIgdDIgPSAtSyAvIDI7IC8vIHQyLCB0M1xuXG4gICAgICBpZiAodDEgPj0gMCAmJiB0MSA8PSAxKSB7XG4gICAgICAgIHJvb3RzW24rK10gPSB0MTtcbiAgICAgIH1cblxuICAgICAgaWYgKHQyID49IDAgJiYgdDIgPD0gMSkge1xuICAgICAgICByb290c1tuKytdID0gdDI7XG4gICAgICB9XG4gICAgfSBlbHNlIGlmIChkaXNjID4gMCkge1xuICAgICAgdmFyIGRpc2NTcXJ0ID0gbWF0aFNxcnQoZGlzYyk7XG4gICAgICB2YXIgWTEgPSBBICogYiArIDEuNSAqIGEgKiAoLUIgKyBkaXNjU3FydCk7XG4gICAgICB2YXIgWTIgPSBBICogYiArIDEuNSAqIGEgKiAoLUIgLSBkaXNjU3FydCk7XG5cbiAgICAgIGlmIChZMSA8IDApIHtcbiAgICAgICAgWTEgPSAtbWF0aFBvdygtWTEsIE9ORV9USElSRCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBZMSA9IG1hdGhQb3coWTEsIE9ORV9USElSRCk7XG4gICAgICB9XG5cbiAgICAgIGlmIChZMiA8IDApIHtcbiAgICAgICAgWTIgPSAtbWF0aFBvdygtWTIsIE9ORV9USElSRCk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBZMiA9IG1hdGhQb3coWTIsIE9ORV9USElSRCk7XG4gICAgICB9XG5cbiAgICAgIHZhciB0MSA9ICgtYiAtIChZMSArIFkyKSkgLyAoMyAqIGEpO1xuXG4gICA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wYXJhbSAge251bWJlcn0gcDFcbiAqIEBwYXJhbSAge251bWJlcn0gcDJcbiAqIEBwYXJhbSAge251bWJlcn0gdFxuICogQHBhcmFtICB7QXJyYXkuPG51bWJlcj59IHJvb3RzXG4gKiBAcmV0dXJuIHtudW1iZXJ9IOacieaViOagueaVsOebrlxuICovXG5cblxuZnVuY3Rpb24gcXVhZHJhdGljUm9vdEF0KHAwLCBwMSwgcDIsIHZhbCwgcm9vdHMpIHtcbiAgdmFyIGEgPSBwMCAtIDIgKiBwMSArIHAyO1xuICB2YXIgYiA9IDIgKiAocDEgLSBwMCk7XG4gIHZhciBjID0gcDAgLSB2YWw7XG4gIHZhciBuID0gMDtcblxuICBpZiAoaXNBcm91bmRaZXJvKGEpKSB7XG4gICAgaWYgKGlzTm90QXJvdW5kWmVybyhiKSkge1xuICAgICAgdmFyIHQxID0gLWMgLyBiO1xuXG4gICAgICBpZiAodDEgPj0gMCAmJiB0MSA8PSAxKSB7XG4gICAgICAgIHJvb3RzW24rK10gPSB0MTtcbiAgICAgIH1cbiAgICB9XG4gIH0gZWxzZSB7XG4gICAgdmFyIGRpc2MgPSBiICogYiAtIDQgKiBhICogYztcblxuICAgIGlmIChpc0Fyb3VuZFplcm8oZGlzYykpIHtcbiAgICAgIHZhciB0MSA9IC1iIC8gKDIgKiBhKTtcblxuICAgICAgaWYgKHQxID49IDAgJiYgdDEgPD0gMSkge1xuICAgICAgICByb290c1tuKytdID0gdDE7XG4gICAgICB9XG4gICAgfSBlbHNlIGlmIChkaXNjID4gMCkge1xuICAgICAgdmFyIGRpc2NTcXJ0ID0gbWF0aFNxcnQoZGlzYyk7XG4gICAgICB2YXIgdDEgPSAoLWIgKyBkaXNjU3FydCkgLyAoMiAqIGEpO1xuICAgICAgdmFyIHQyID0gKC1iIC0gZGlzY1NxcnQpIC8gKDIgKiBhKTtcblxuICAgICAgaWYgKHQxID49IDAgJiYgdDEgPD0gMSkge1xuICAgICAgICByb290c1tuKytdID0gdDE7XG4gICA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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/curve.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/env.js": +/*!**********************************************!*\ + !*** ./node_modules/zrender/lib/core/env.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * echarts设备环境识别\n *\n * @desc echarts基于Canvas,纯Javascript图表库,提供直观,生动,可交互,可个性化定制的数据统计图表。\n * @author firede[firede@firede.us]\n * @desc thanks zepto.\n */\nvar env = {};\n\nif (typeof wx === 'object' && typeof wx.getSystemInfoSync === 'function') {\n // In Weixin Application\n env = {\n browser: {},\n os: {},\n node: false,\n wxa: true,\n // Weixin Application\n canvasSupported: true,\n svgSupported: false,\n touchEventsSupported: true,\n domSupported: false\n };\n} else if (typeof document === 'undefined' && typeof self !== 'undefined') {\n // In worker\n env = {\n browser: {},\n os: {},\n node: false,\n worker: true,\n canvasSupported: true,\n domSupported: false\n };\n} else if (typeof navigator === 'undefined') {\n // In node\n env = {\n browser: {},\n os: {},\n node: true,\n worker: false,\n // Assume canvas is supported\n canvasSupported: true,\n svgSupported: true,\n domSupported: false\n };\n} else {\n env = detect(navigator.userAgent);\n}\n\nvar _default = env; // Zepto.js\n// (c) 2010-2013 Thomas Fuchs\n// Zepto.js may be freely distributed under the MIT license.\n\nfunction detect(ua) {\n var os = {};\n var browser = {}; // var webkit = ua.match(/Web[kK]it[\\/]{0,1}([\\d.]+)/);\n // var android = ua.match(/(Android);?[\\s\\/]+([\\d.]+)?/);\n // var ipad = ua.match(/(iPad).*OS\\s([\\d_]+)/);\n // var ipod = ua.match(/(iPod)(.*OS\\s([\\d_]+))?/);\n // var iphone = !ipad && ua.match(/(iPhone\\sOS)\\s([\\d_]+)/);\n // var webos = ua.match(/(webOS|hpwOS)[\\s\\/]([\\d.]+)/);\n // var touchpad = webos && ua.match(/TouchPad/);\n // var kindle = ua.match(/Kindle\\/([\\d.]+)/);\n // var silk = ua.match(/Silk\\/([\\d._]+)/);\n // var blackberry = ua.match(/(BlackBerry).*Version\\/([\\d.]+)/);\n // var bb10 = ua.match(/(BB10).*Version\\/([\\d.]+)/);\n // var rimtabletos = ua.match(/(RIM\\sTablet\\sOS)\\s([\\d.]+)/);\n // var playbook = ua.match(/PlayBook/);\n // var chrome = ua.match(/Chrome\\/([\\d.]+)/) || ua.match(/CriOS\\/([\\d.]+)/);\n\n var firefox = ua.match(/Firefox\\/([\\d.]+)/); // var safari = webkit && ua.match(/Mobile\\//) && !chrome;\n // var webview = ua.match(/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/) && !chrome;\n\n var ie = ua.match(/MSIE\\s([\\d.]+)/) // IE 11 Trident/7.0; rv:11.0\n || ua.match(/Trident\\/.+?rv:(([\\d.]+))/);\n var edge = ua.match(/Edge\\/([\\d.]+)/); // IE 12 and 12+\n\n var weChat = /micromessenger/i.test(ua); // Todo: clean this up with a better OS/browser seperation:\n // - discern (more) between multiple browsers on android\n // - decide if kindle fire in silk mode is android or not\n // - Firefox on Android doesn't specify the Android version\n // - possibly devide in os, device and browser hashes\n // if (browser.webkit = !!webkit) browser.version = webkit[1];\n // if (android) os.android = true, os.version = android[2];\n // if (iphone && !ipod) os.ios = os.iphone = true, os.version = iphone[2].replace(/_/g, '.');\n // if (ipad) os.ios = os.ipad = true, os.version = ipad[2].replace(/_/g, '.');\n // if (ipod) os.ios = os.ipod = true, os.version = ipod[3] ? ipod[3].replace(/_/g, '.') : null;\n // if (webos) os.webos = true, os.version = webos[2];\n // if (touchpad) os.touchpad = true;\n // if (blackberry) os.blackberry = true, os.version = blackberry[2];\n // if (bb10) os.bb10 = true, os.version = bb10[2];\n // if (rimtabletos) os.rimtabletos = true, os.version = rimtabletos[2];\n // if (playbook) browser.playbook = true;\n // if (kindle) os.kindle = true, os.version = kindle[1];\n // if (silk) browser.silk = true, browser.version = silk[1];\n // if (!silk && os.android && ua.match(/Kindle Fire/)) browser.silk = true;\n // if (chrome) browser.chrome = true, browser.version = chrome[1];\n\n if (firefox) {\n browser.firefox = true;\n browser.version = firefox[1];\n } // if (safari && (ua.match(/Safari/) || !!os.ios)) browser.safari = true;\n // if (webview) browser.webview = true;\n\n\n if (ie) {\n browser.ie = true;\n browser.version = ie[1];\n }\n\n if (edge) {\n browser.edge = true;\n browser.version = edge[1];\n } // It is difficult to detect WeChat in Win Phone precisely, because ua can\n // not be set on win phone. So we do not consider Win Phone.\n\n\n if (weChat) {\n browser.weChat = true;\n } // os.tablet = !!(ipad || playbook || (android && !ua.match(/Mobile/)) ||\n // (firefox && ua.match(/Tablet/)) || (ie && !ua.match(/Phone/) && ua.match(/Touch/)));\n // os.phone = !!(!os.tablet && !os.ipod && (android || iphone || webos ||\n // (chrome && ua.match(/Android/)) || (chrome && ua.match(/CriOS\\/([\\d.]+)/)) ||\n // (firefox && ua.match(/Mobile/)) || (ie && ua.match(/Touch/))));\n\n\n return {\n browser: browser,\n os: os,\n node: false,\n // 原生canvas支持,改极端点了\n // canvasSupported : !(browser.ie && parseFloat(browser.version) < 9)\n canvasSupported: !!document.createElement('canvas').getContext,\n svgSupported: typeof SVGRect !== 'undefined',\n // works on most browsers\n // IE10/11 does not support touch event, and MS Edge supports them but not by\n // default, so we dont check navigator.maxTouchPoints for them here.\n touchEventsSupported: 'ontouchstart' in window && !browser.ie && !browser.edge,\n // .\n pointerEventsSupported: 'onpointerdown' in window // Firefox supports pointer but not by default, only MS browsers are reliable on pointer\n // events currently. So we dont use that on other browsers unless tested sufficiently.\n // Although IE 10 supports pointer event, it use old style and is different from the\n // standard. So we exclude that. (IE 10 is hardly used on touch device)\n && (browser.edge || browser.ie && browser.version >= 11),\n // passiveSupported: detectPassiveSupport()\n domSupported: typeof document !== 'undefined'\n };\n} // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection\n// function detectPassiveSupport() {\n// // Test via a getter in the options object to see if the passive property is accessed\n// var supportsPassive = false;\n// try {\n// var opts = Object.defineProperty({}, 'passive', {\n// get: function() {\n// supportsPassive = true;\n// }\n// });\n// window.addEventListener('testPassive', function() {}, opts);\n// } catch (e) {\n// }\n// return supportsPassive;\n// }\n\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9lbnYuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21v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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/env.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/guid.js": +/*!***********************************************!*\ + !*** ./node_modules/zrender/lib/core/guid.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * zrender: 生成唯一id\n *\n * @author errorrik (errorrik@gmail.com)\n */\nvar idStart = 0x0907;\n\nfunction _default() {\n return idStart++;\n}\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9ndWlkLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvcmUvZ3VpZC5qcz9kZTAwIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogenJlbmRlcjog55Sf5oiQ5ZSv5LiAaWRcbiAqXG4gKiBAYXV0aG9yIGVycm9ycmlrIChlcnJvcnJpa0BnbWFpbC5jb20pXG4gKi9cbnZhciBpZFN0YXJ0ID0gMHgwOTA3O1xuXG5mdW5jdGlvbiBfZGVmYXVsdCgpIHtcbiAgcmV0dXJuIGlkU3RhcnQrKztcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBfZGVmYXVsdDsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/guid.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/log.js": +/*!**********************************************!*\ + !*** ./node_modules/zrender/lib/core/log.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var _config = __webpack_require__(/*! ../config */ \"./node_modules/zrender/lib/config.js\");\n\nvar debugMode = _config.debugMode;\n\nvar log = function () {};\n\nif (debugMode === 1) {\n log = function () {\n for (var k in arguments) {\n throw new Error(arguments[k]);\n }\n };\n} else if (debugMode > 1) {\n log = function () {\n for (var k in arguments) {\n console.log(arguments[k]);\n }\n };\n}\n\nvar _default = log;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9sb2cuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9sb2cuanM/NDk0MiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgX2NvbmZpZyA9IHJlcXVpcmUoXCIuLi9jb25maWdcIik7XG5cbnZhciBkZWJ1Z01vZGUgPSBfY29uZmlnLmRlYnVnTW9kZTtcblxudmFyIGxvZyA9IGZ1bmN0aW9uICgpIHt9O1xuXG5pZiAoZGVidWdNb2RlID09PSAxKSB7XG4gIGxvZyA9IGZ1bmN0aW9uICgpIHtcbiAgICBmb3IgKHZhciBrIGluIGFyZ3VtZW50cykge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGFyZ3VtZW50c1trXSk7XG4gICAgfVxuICB9O1xufSBlbHNlIGlmIChkZWJ1Z01vZGUgPiAxKSB7XG4gIGxvZyA9IGZ1bmN0aW9uICgpIHtcbiAgICBmb3IgKHZhciBrIGluIGFyZ3VtZW50cykge1xuICAgICAgY29uc29sZS5sb2coYXJndW1lbnRzW2tdKTtcbiAgICB9XG4gIH07XG59XG5cbnZhciBfZGVmYXVsdCA9IGxvZztcbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/log.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/matrix.js": +/*!*************************************************!*\ + !*** ./node_modules/zrender/lib/core/matrix.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * 3x2矩阵操作类\n * @exports zrender/tool/matrix\n */\nvar ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;\n/**\n * Create a identity matrix.\n * @return {Float32Array|Array.}\n */\n\nfunction create() {\n var out = new ArrayCtor(6);\n identity(out);\n return out;\n}\n/**\n * 设置矩阵为单位矩阵\n * @param {Float32Array|Array.} out\n */\n\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * 复制矩阵\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} m\n */\n\n\nfunction copy(out, m) {\n out[0] = m[0];\n out[1] = m[1];\n out[2] = m[2];\n out[3] = m[3];\n out[4] = m[4];\n out[5] = m[5];\n return out;\n}\n/**\n * 矩阵相乘\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} m1\n * @param {Float32Array|Array.} m2\n */\n\n\nfunction mul(out, m1, m2) {\n // Consider matrix.mul(m, m2, m);\n // where out is the same as m2.\n // So use temp variable to escape error.\n var out0 = m1[0] * m2[0] + m1[2] * m2[1];\n var out1 = m1[1] * m2[0] + m1[3] * m2[1];\n var out2 = m1[0] * m2[2] + m1[2] * m2[3];\n var out3 = m1[1] * m2[2] + m1[3] * m2[3];\n var out4 = m1[0] * m2[4] + m1[2] * m2[5] + m1[4];\n var out5 = m1[1] * m2[4] + m1[3] * m2[5] + m1[5];\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = out3;\n out[4] = out4;\n out[5] = out5;\n return out;\n}\n/**\n * 平移变换\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} a\n * @param {Float32Array|Array.} v\n */\n\n\nfunction translate(out, a, v) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4] + v[0];\n out[5] = a[5] + v[1];\n return out;\n}\n/**\n * 旋转变换\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} a\n * @param {number} rad\n */\n\n\nfunction rotate(out, a, rad) {\n var aa = a[0];\n var ac = a[2];\n var atx = a[4];\n var ab = a[1];\n var ad = a[3];\n var aty = a[5];\n var st = Math.sin(rad);\n var ct = Math.cos(rad);\n out[0] = aa * ct + ab * st;\n out[1] = -aa * st + ab * ct;\n out[2] = ac * ct + ad * st;\n out[3] = -ac * st + ct * ad;\n out[4] = ct * atx + st * aty;\n out[5] = ct * aty - st * atx;\n return out;\n}\n/**\n * 缩放变换\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} a\n * @param {Float32Array|Array.} v\n */\n\n\nfunction scale(out, a, v) {\n var vx = v[0];\n var vy = v[1];\n out[0] = a[0] * vx;\n out[1] = a[1] * vy;\n out[2] = a[2] * vx;\n out[3] = a[3] * vy;\n out[4] = a[4] * vx;\n out[5] = a[5] * vy;\n return out;\n}\n/**\n * 求逆矩阵\n * @param {Float32Array|Array.} out\n * @param {Float32Array|Array.} a\n */\n\n\nfunction invert(out, a) {\n var aa = a[0];\n var ac = a[2];\n var atx = a[4];\n var ab = a[1];\n var ad = a[3];\n var aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\n * Clone a new matrix.\n * @param {Float32Array|Array.} a\n */\n\n\nfunction clone(a) {\n var b = create();\n copy(b, a);\n return b;\n}\n\nexports.create = create;\nexports.identity = identity;\nexports.copy = copy;\nexports.mul = mul;\nexports.translate = translate;\nexports.rotate = rotate;\nexports.scale = scale;\nexports.invert = invert;\nexports.clone = clone;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9tYXRyaXguanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS9tYXRyaXguanM/MTY4NyJdLCJ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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/matrix.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/util.js": +/*!***********************************************!*\ + !*** ./node_modules/zrender/lib/core/util.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * @module zrender/core/util\n */\n// 用于处理merge时无法遍历Date等对象的问题\nvar BUILTIN_OBJECT = {\n '[object Function]': 1,\n '[object RegExp]': 1,\n '[object Date]': 1,\n '[object Error]': 1,\n '[object CanvasGradient]': 1,\n '[object CanvasPattern]': 1,\n // For node-canvas\n '[object Image]': 1,\n '[object Canvas]': 1\n};\nvar TYPED_ARRAY = {\n '[object Int8Array]': 1,\n '[object Uint8Array]': 1,\n '[object Uint8ClampedArray]': 1,\n '[object Int16Array]': 1,\n '[object Uint16Array]': 1,\n '[object Int32Array]': 1,\n '[object Uint32Array]': 1,\n '[object Float32Array]': 1,\n '[object Float64Array]': 1\n};\nvar objToString = Object.prototype.toString;\nvar arrayProto = Array.prototype;\nvar nativeForEach = arrayProto.forEach;\nvar nativeFilter = arrayProto.filter;\nvar nativeSlice = arrayProto.slice;\nvar nativeMap = arrayProto.map;\nvar nativeReduce = arrayProto.reduce; // Avoid assign to an exported variable, for transforming to cjs.\n\nvar methods = {};\n\nfunction $override(name, fn) {\n // Clear ctx instance for different environment\n if (name === 'createCanvas') {\n _ctx = null;\n }\n\n methods[name] = fn;\n}\n/**\n * Those data types can be cloned:\n * Plain object, Array, TypedArray, number, string, null, undefined.\n * Those data types will be assgined using the orginal data:\n * BUILTIN_OBJECT\n * Instance of user defined class will be cloned to a plain object, without\n * properties in prototype.\n * Other data types is not supported (not sure what will happen).\n *\n * Caution: do not support clone Date, for performance consideration.\n * (There might be a large number of date in `series.data`).\n * So date should not be modified in and out of echarts.\n *\n * @param {*} source\n * @return {*} new\n */\n\n\nfunction clone(source) {\n if (source == null || typeof source !== 'object') {\n return source;\n }\n\n var result = source;\n var typeStr = objToString.call(source);\n\n if (typeStr === '[object Array]') {\n if (!isPrimitive(source)) {\n result = [];\n\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = clone(source[i]);\n }\n }\n } else if (TYPED_ARRAY[typeStr]) {\n if (!isPrimitive(source)) {\n var Ctor = source.constructor;\n\n if (source.constructor.from) {\n result = Ctor.from(source);\n } else {\n result = new Ctor(source.length);\n\n for (var i = 0, len = source.length; i < len; i++) {\n result[i] = clone(source[i]);\n }\n }\n }\n } else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) {\n result = {};\n\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n result[key] = clone(source[key]);\n }\n }\n }\n\n return result;\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} target\n * @param {*} source\n * @param {boolean} [overwrite=false]\n */\n\n\nfunction merge(target, source, overwrite) {\n // We should escapse that source is string\n // and enter for ... in ...\n if (!isObject(source) || !isObject(target)) {\n return overwrite ? clone(source) : target;\n }\n\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n var targetProp = target[key];\n var sourceProp = source[key];\n\n if (isObject(sourceProp) && isObject(targetProp) && !isArray(sourceProp) && !isArray(targetProp) && !isDom(sourceProp) && !isDom(targetProp) && !isBuiltInObject(sourceProp) && !isBuiltInObject(targetProp) && !isPrimitive(sourceProp) && !isPrimitive(targetProp)) {\n // 如果需要递归覆盖,就递归调用merge\n merge(targetProp, sourceProp, overwrite);\n } else if (overwrite || !(key in target)) {\n // 否则只处理overwrite为true,或者在目标对象中没有此属性的情况\n // NOTE,在 target[key] 不存在的时候也是直接覆盖\n target[key] = clone(source[key], true);\n }\n }\n }\n\n return target;\n}\n/**\n * @param {Array} targetAndSources The first item is target, and the rests are source.\n * @param {boolean} [overwrite=false]\n * @return {*} target\n */\n\n\nfunction mergeAll(targetAndSources, overwrite) {\n var result = targetAndSources[0];\n\n for (var i = 1, len = targetAndSources.length; i < len; i++) {\n result = merge(result, targetAndSources[i], overwrite);\n }\n\n return result;\n}\n/**\n * @param {*} target\n * @param {*} source\n * @memberOf module:zrender/core/util\n */\n\n\nfunction extend(target, source) {\n for (var key in source) {\n if (source.hasOwnProperty(key)) {\n target[key] = source[key];\n }\n }\n\n return target;\n}\n/**\n * @param {*} target\n * @param {*} source\n * @param {boolean} [overlay=false]\n * @memberOf module:zrender/core/util\n */\n\n\nfunction defaults(target, source, overlay) {\n for (var key in source) {\n if (source.hasOwnProperty(key) && (overlay ? source[key] != null : target[key] == null)) {\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nvar createCanvas = function () {\n return methods.createCanvas();\n};\n\nmethods.createCanvas = function () {\n return document.createElement('canvas');\n}; // FIXME\n\n\nvar _ctx;\n\nfunction getContext() {\n if (!_ctx) {\n // Use util.createCanvas instead of createCanvas\n // because createCanvas may be overwritten in different environment\n _ctx = createCanvas().getContext('2d');\n }\n\n return _ctx;\n}\n/**\n * 查询数组中元素的index\n * @memberOf module:zrender/core/util\n */\n\n\nfunction indexOf(array, value) {\n if (array) {\n if (array.indexOf) {\n return array.indexOf(value);\n }\n\n for (var i = 0, len = array.length; i < len; i++) {\n if (array[i] === value) {\n return i;\n }\n }\n }\n\n return -1;\n}\n/**\n * 构造类继承关系\n *\n * @memberOf module:zrender/core/util\n * @param {Function} clazz 源类\n * @param {Function} baseClazz 基类\n */\n\n\nfunction inherits(clazz, baseClazz) {\n var clazzPrototype = clazz.prototype;\n\n function F() {}\n\n F.prototype = baseClazz.prototype;\n clazz.prototype = new F();\n\n for (var prop in clazzPrototype) {\n clazz.prototype[prop] = clazzPrototype[prop];\n }\n\n clazz.prototype.constructor = clazz;\n clazz.superClass = baseClazz;\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {Object|Function} target\n * @param {Object|Function} sorce\n * @param {boolean} overlay\n */\n\n\nfunction mixin(target, source, overlay) {\n target = 'prototype' in target ? target.prototype : target;\n source = 'prototype' in source ? source.prototype : source;\n defaults(target, source, overlay);\n}\n/**\n * Consider typed array.\n * @param {Array|TypedArray} data\n */\n\n\nfunction isArrayLike(data) {\n if (!data) {\n return;\n }\n\n if (typeof data === 'string') {\n return false;\n }\n\n return typeof data.length === 'number';\n}\n/**\n * 数组或对象遍历\n * @memberOf module:zrender/core/util\n * @param {Object|Array} obj\n * @param {Function} cb\n * @param {*} [context]\n */\n\n\nfunction each(obj, cb, context) {\n if (!(obj && cb)) {\n return;\n }\n\n if (obj.forEach && obj.forEach === nativeForEach) {\n obj.forEach(cb, context);\n } else if (obj.length === +obj.length) {\n for (var i = 0, len = obj.length; i < len; i++) {\n cb.call(context, obj[i], i, obj);\n }\n } else {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n cb.call(context, obj[key], key, obj);\n }\n }\n }\n}\n/**\n * 数组映射\n * @memberOf module:zrender/core/util\n * @param {Array} obj\n * @param {Function} cb\n * @param {*} [context]\n * @return {Array}\n */\n\n\nfunction map(obj, cb, context) {\n if (!(obj && cb)) {\n return;\n }\n\n if (obj.map && obj.map === nativeMap) {\n return obj.map(cb, context);\n } else {\n var result = [];\n\n for (var i = 0, len = obj.length; i < len; i++) {\n result.push(cb.call(context, obj[i], i, obj));\n }\n\n return result;\n }\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {Array} obj\n * @param {Function} cb\n * @param {Object} [memo]\n * @param {*} [context]\n * @return {Array}\n */\n\n\nfunction reduce(obj, cb, memo, context) {\n if (!(obj && cb)) {\n return;\n }\n\n if (obj.reduce && obj.reduce === nativeReduce) {\n return obj.reduce(cb, memo, context);\n } else {\n for (var i = 0, len = obj.length; i < len; i++) {\n memo = cb.call(context, memo, obj[i], i, obj);\n }\n\n return memo;\n }\n}\n/**\n * 数组过滤\n * @memberOf module:zrender/core/util\n * @param {Array} obj\n * @param {Function} cb\n * @param {*} [context]\n * @return {Array}\n */\n\n\nfunction filter(obj, cb, context) {\n if (!(obj && cb)) {\n return;\n }\n\n if (obj.filter && obj.filter === nativeFilter) {\n return obj.filter(cb, context);\n } else {\n var result = [];\n\n for (var i = 0, len = obj.length; i < len; i++) {\n if (cb.call(context, obj[i], i, obj)) {\n result.push(obj[i]);\n }\n }\n\n return result;\n }\n}\n/**\n * 数组项查找\n * @memberOf module:zrender/core/util\n * @param {Array} obj\n * @param {Function} cb\n * @param {*} [context]\n * @return {*}\n */\n\n\nfunction find(obj, cb, context) {\n if (!(obj && cb)) {\n return;\n }\n\n for (var i = 0, len = obj.length; i < len; i++) {\n if (cb.call(context, obj[i], i, obj)) {\n return obj[i];\n }\n }\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {Function} func\n * @param {*} context\n * @return {Function}\n */\n\n\nfunction bind(func, context) {\n var args = nativeSlice.call(arguments, 2);\n return function () {\n return func.apply(context, args.concat(nativeSlice.call(arguments)));\n };\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {Function} func\n * @return {Function}\n */\n\n\nfunction curry(func) {\n var args = nativeSlice.call(arguments, 1);\n return function () {\n return func.apply(this, args.concat(nativeSlice.call(arguments)));\n };\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isArray(value) {\n return objToString.call(value) === '[object Array]';\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isString(value) {\n return objToString.call(value) === '[object String]';\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return type === 'function' || !!value && type === 'object';\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isBuiltInObject(value) {\n return !!BUILTIN_OBJECT[objToString.call(value)];\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isTypedArray(value) {\n return !!TYPED_ARRAY[objToString.call(value)];\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction isDom(value) {\n return typeof value === 'object' && typeof value.nodeType === 'number' && typeof value.ownerDocument === 'object';\n}\n/**\n * Whether is exactly NaN. Notice isNaN('a') returns true.\n * @param {*} value\n * @return {boolean}\n */\n\n\nfunction eqNaN(value) {\n return value !== value;\n}\n/**\n * If value1 is not null, then return value1, otherwise judget rest of values.\n * Low performance.\n * @memberOf module:zrender/core/util\n * @return {*} Final value\n */\n\n\nfunction retrieve(values) {\n for (var i = 0, len = arguments.length; i < len; i++) {\n if (arguments[i] != null) {\n return arguments[i];\n }\n }\n}\n\nfunction retrieve2(value0, value1) {\n return value0 != null ? value0 : value1;\n}\n\nfunction retrieve3(value0, value1, value2) {\n return value0 != null ? value0 : value1 != null ? value1 : value2;\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {Array} arr\n * @param {number} startIndex\n * @param {number} endIndex\n * @return {Array}\n */\n\n\nfunction slice() {\n return Function.call.apply(nativeSlice, arguments);\n}\n/**\n * Normalize css liked array configuration\n * e.g.\n * 3 => [3, 3, 3, 3]\n * [4, 2] => [4, 2, 4, 2]\n * [4, 3, 2] => [4, 3, 2, 3]\n * @param {number|Array.} val\n * @return {Array.}\n */\n\n\nfunction normalizeCssArray(val) {\n if (typeof val === 'number') {\n return [val, val, val, val];\n }\n\n var len = val.length;\n\n if (len === 2) {\n // vertical | horizontal\n return [val[0], val[1], val[0], val[1]];\n } else if (len === 3) {\n // top | horizontal | bottom\n return [val[0], val[1], val[2], val[1]];\n }\n\n return val;\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {boolean} condition\n * @param {string} message\n */\n\n\nfunction assert(condition, message) {\n if (!condition) {\n throw new Error(message);\n }\n}\n/**\n * @memberOf module:zrender/core/util\n * @param {string} str string to be trimed\n * @return {string} trimed string\n */\n\n\nfunction trim(str) {\n if (str == null) {\n return null;\n } else if (typeof str.trim === 'function') {\n return str.trim();\n } else {\n return str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n }\n}\n\nvar primitiveKey = '__ec_primitive__';\n/**\n * Set an object as primitive to be ignored traversing children in clone or merge\n */\n\nfunction setAsPrimitive(obj) {\n obj[primitiveKey] = true;\n}\n\nfunction isPrimitive(obj) {\n return obj[primitiveKey];\n}\n/**\n * @constructor\n * @param {Object} obj Only apply `ownProperty`.\n */\n\n\nfunction HashMap(obj) {\n var isArr = isArray(obj); // Key should not be set on this, otherwise\n // methods get/set/... may be overrided.\n\n this.data = {};\n var thisMap = this;\n obj instanceof HashMap ? obj.each(visit) : obj && each(obj, visit);\n\n function visit(value, key) {\n isArr ? thisMap.set(value, key) : thisMap.set(key, value);\n }\n}\n\nHashMap.prototype = {\n constructor: HashMap,\n // Do not provide `has` method to avoid defining what is `has`.\n // (We usually treat `null` and `undefined` as the same, different\n // from ES6 Map).\n get: function (key) {\n return this.data.hasOwnProperty(key) ? this.data[key] : null;\n },\n set: function (key, value) {\n // Comparing with invocation chaining, `return value` is more commonly\n // used in this case: `var someVal = map.set('a', genVal());`\n return this.data[key] = value;\n },\n // Although util.each can be performed on this hashMap directly, user\n // should not use the exposed keys, who are prefixed.\n each: function (cb, context) {\n context !== void 0 && (cb = bind(cb, context));\n\n for (var key in this.data) {\n this.data.hasOwnProperty(key) && cb(this.data[key], key);\n }\n },\n // Do not use this method if performance sensitive.\n removeKey: function (key) {\n delete this.data[key];\n }\n};\n\nfunction createHashMap(obj) {\n return new HashMap(obj);\n}\n\nfunction concatArray(a, b) {\n var newArray = new a.constructor(a.length + b.length);\n\n for (var i = 0; i < a.length; i++) {\n newArray[i] = a[i];\n }\n\n var offset = a.length;\n\n for (i = 0; i < b.length; i++) {\n newArray[i + offset] = b[i];\n }\n\n return newArray;\n}\n\nfunction noop() {}\n\nexports.$override = $override;\nexports.clone = clone;\nexports.merge = merge;\nexports.mergeAll = mergeAll;\nexports.extend = extend;\nexports.defaults = defaults;\nexports.createCanvas = createCanvas;\nexports.getContext = getContext;\nexports.indexOf = indexOf;\nexports.inherits = inherits;\nexports.mixin = mixin;\nexports.isArrayLike = isArrayLike;\nexports.each = each;\nexports.map = map;\nexports.reduce = reduce;\nexports.filter = filter;\nexports.find = find;\nexports.bind = bind;\nexports.curry = curry;\nexports.isArray = isArray;\nexports.isFunction = isFunction;\nexports.isString = isString;\nexports.isObject = isObject;\nexports.isBuiltInObject = isBuiltInObject;\nexports.isTypedArray = isTypedArray;\nexports.isDom = isDom;\nexports.eqNaN = eqNaN;\nexports.retrieve = retrieve;\nexports.retrieve2 = retrieve2;\nexports.retrieve3 = retrieve3;\nexports.slice = slice;\nexports.normalizeCssArray = normalizeCssArray;\nexports.assert = assert;\nexports.trim = trim;\nexports.setAsPrimitive = setAsPrimitive;\nexports.isPrimitive = isPrimitive;\nexports.createHashMap = createHashMap;\nexports.concatArray = concatArray;\nexports.noop = noop;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS91dGlsLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2NvcmUvdXRpbC5qcz82ZDhiIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQG1vZHVsZSB6cmVuZGVyL2NvcmUvdXRpbFxuICovXG4vLyDnlKjkuo7lpITnkIZtZXJnZeaXtuaXoOazlemBjeWOhkRhdGXnrYnlr7nosaHnmoTpl67pophcbnZhciBCVUlMVElOX09CSkVDVCA9IHtcbiAgJ1tvYmplY3QgRnVuY3Rpb25dJzogMSxcbiAgJ1tvYmplY3QgUmVnRXhwXSc6IDEsXG4gICdbb2JqZWN0IERhdGVdJzogMSxcbiAgJ1tvYmplY3QgRXJyb3JdJzogMSxcbiAgJ1tvYmplY3QgQ2FudmFzR3JhZGllbnRdJzogMSxcbiAgJ1tvYmplY3QgQ2FudmFzUGF0dGVybl0nOiAxLFxuICAvLyBGb3Igbm9kZS1jYW52YXNcbiAgJ1tvYmplY3QgSW1hZ2VdJzog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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/util.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/core/vector.js": +/*!*************************************************!*\ + !*** ./node_modules/zrender/lib/core/vector.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var ArrayCtor = typeof Float32Array === 'undefined' ? Array : Float32Array;\n/**\n * 创建一个向量\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @return {Vector2}\n */\n\nfunction create(x, y) {\n var out = new ArrayCtor(2);\n\n if (x == null) {\n x = 0;\n }\n\n if (y == null) {\n y = 0;\n }\n\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * 复制向量数据\n * @param {Vector2} out\n * @param {Vector2} v\n * @return {Vector2}\n */\n\n\nfunction copy(out, v) {\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\n/**\n * 克隆一个向量\n * @param {Vector2} v\n * @return {Vector2}\n */\n\n\nfunction clone(v) {\n var out = new ArrayCtor(2);\n out[0] = v[0];\n out[1] = v[1];\n return out;\n}\n/**\n * 设置向量的两个项\n * @param {Vector2} out\n * @param {number} a\n * @param {number} b\n * @return {Vector2} 结果\n */\n\n\nfunction set(out, a, b) {\n out[0] = a;\n out[1] = b;\n return out;\n}\n/**\n * 向量相加\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction add(out, v1, v2) {\n out[0] = v1[0] + v2[0];\n out[1] = v1[1] + v2[1];\n return out;\n}\n/**\n * 向量缩放后相加\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @param {number} a\n */\n\n\nfunction scaleAndAdd(out, v1, v2, a) {\n out[0] = v1[0] + v2[0] * a;\n out[1] = v1[1] + v2[1] * a;\n return out;\n}\n/**\n * 向量相减\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction sub(out, v1, v2) {\n out[0] = v1[0] - v2[0];\n out[1] = v1[1] - v2[1];\n return out;\n}\n/**\n * 向量长度\n * @param {Vector2} v\n * @return {number}\n */\n\n\nfunction len(v) {\n return Math.sqrt(lenSquare(v));\n}\n\nvar length = len; // jshint ignore:line\n\n/**\n * 向量长度平方\n * @param {Vector2} v\n * @return {number}\n */\n\nfunction lenSquare(v) {\n return v[0] * v[0] + v[1] * v[1];\n}\n\nvar lengthSquare = lenSquare;\n/**\n * 向量乘法\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\nfunction mul(out, v1, v2) {\n out[0] = v1[0] * v2[0];\n out[1] = v1[1] * v2[1];\n return out;\n}\n/**\n * 向量除法\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction div(out, v1, v2) {\n out[0] = v1[0] / v2[0];\n out[1] = v1[1] / v2[1];\n return out;\n}\n/**\n * 向量点乘\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @return {number}\n */\n\n\nfunction dot(v1, v2) {\n return v1[0] * v2[0] + v1[1] * v2[1];\n}\n/**\n * 向量缩放\n * @param {Vector2} out\n * @param {Vector2} v\n * @param {number} s\n */\n\n\nfunction scale(out, v, s) {\n out[0] = v[0] * s;\n out[1] = v[1] * s;\n return out;\n}\n/**\n * 向量归一化\n * @param {Vector2} out\n * @param {Vector2} v\n */\n\n\nfunction normalize(out, v) {\n var d = len(v);\n\n if (d === 0) {\n out[0] = 0;\n out[1] = 0;\n } else {\n out[0] = v[0] / d;\n out[1] = v[1] / d;\n }\n\n return out;\n}\n/**\n * 计算向量间距离\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @return {number}\n */\n\n\nfunction distance(v1, v2) {\n return Math.sqrt((v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]));\n}\n\nvar dist = distance;\n/**\n * 向量距离平方\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @return {number}\n */\n\nfunction distanceSquare(v1, v2) {\n return (v1[0] - v2[0]) * (v1[0] - v2[0]) + (v1[1] - v2[1]) * (v1[1] - v2[1]);\n}\n\nvar distSquare = distanceSquare;\n/**\n * 求负向量\n * @param {Vector2} out\n * @param {Vector2} v\n */\n\nfunction negate(out, v) {\n out[0] = -v[0];\n out[1] = -v[1];\n return out;\n}\n/**\n * 插值两个点\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n * @param {number} t\n */\n\n\nfunction lerp(out, v1, v2, t) {\n out[0] = v1[0] + t * (v2[0] - v1[0]);\n out[1] = v1[1] + t * (v2[1] - v1[1]);\n return out;\n}\n/**\n * 矩阵左乘向量\n * @param {Vector2} out\n * @param {Vector2} v\n * @param {Vector2} m\n */\n\n\nfunction applyTransform(out, v, m) {\n var x = v[0];\n var y = v[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\n * 求两个向量最小值\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction min(out, v1, v2) {\n out[0] = Math.min(v1[0], v2[0]);\n out[1] = Math.min(v1[1], v2[1]);\n return out;\n}\n/**\n * 求两个向量最大值\n * @param {Vector2} out\n * @param {Vector2} v1\n * @param {Vector2} v2\n */\n\n\nfunction max(out, v1, v2) {\n out[0] = Math.max(v1[0], v2[0]);\n out[1] = Math.max(v1[1], v2[1]);\n return out;\n}\n\nexports.create = create;\nexports.copy = copy;\nexports.clone = clone;\nexports.set = set;\nexports.add = add;\nexports.scaleAndAdd = scaleAndAdd;\nexports.sub = sub;\nexports.len = len;\nexports.length = length;\nexports.lenSquare = lenSquare;\nexports.lengthSquare = lengthSquare;\nexports.mul = mul;\nexports.div = div;\nexports.dot = dot;\nexports.scale = scale;\nexports.normalize = normalize;\nexports.distance = distance;\nexports.dist = dist;\nexports.distanceSquare = distanceSquare;\nexports.distSquare = distSquare;\nexports.negate = negate;\nexports.lerp = lerp;\nexports.applyTransform = applyTransform;\nexports.min = min;\nexports.max = max;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS92ZWN0b3IuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvY29yZS92ZWN0b3IuanM/NDAxYiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgQXJyYXlDdG9yID0gdHlwZW9mIEZsb2F0MzJBcnJheSA9PT0gJ3VuZGVmaW5lZCcgPyBBcnJheSA6IEZsb2F0MzJBcnJheTtcbi8qKlxuICog5Yib5bu65LiA5Liq5ZCR6YePXG4gKiBAcGFyYW0ge251bWJlcn0gW3g9MF1cbiAqIEBwYXJhbSB7bnVtYmVyfSBbeT0wXVxuICogQHJldHVybiB7VmVjdG9yMn1cbiAqL1xuXG5mdW5jdGlvbiBjcmVhdGUoeCwgeSkge1x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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/core/vector.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/CompoundPath.js": +/*!**********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/CompoundPath.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ./Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\n// CompoundPath to improve performance\nvar _default = Path.extend({\n type: 'compound',\n shape: {\n paths: null\n },\n _updatePathDirty: function () {\n var dirtyPath = this.__dirtyPath;\n var paths = this.shape.paths;\n\n for (var i = 0; i < paths.length; i++) {\n // Mark as dirty if any subpath is dirty\n dirtyPath = dirtyPath || paths[i].__dirtyPath;\n }\n\n this.__dirtyPath = dirtyPath;\n this.__dirty = this.__dirty || dirtyPath;\n },\n beforeBrush: function () {\n this._updatePathDirty();\n\n var paths = this.shape.paths || [];\n var scale = this.getGlobalScale(); // Update path scale\n\n for (var i = 0; i < paths.length; i++) {\n if (!paths[i].path) {\n paths[i].createPathProxy();\n }\n\n paths[i].path.setScale(scale[0], scale[1]);\n }\n },\n buildPath: function (ctx, shape) {\n var paths = shape.paths || [];\n\n for (var i = 0; i < paths.length; i++) {\n paths[i].buildPath(ctx, paths[i].shape, true);\n }\n },\n afterBrush: function () {\n var paths = this.shape.paths || [];\n\n for (var i = 0; i < paths.length; i++) {\n paths[i].__dirtyPath = false;\n }\n },\n getBoundingRect: function () {\n this._updatePathDirty();\n\n return Path.prototype.getBoundingRect.call(this);\n }\n});\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9Db21wb3VuZFBhdGguanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9Db21wb3VuZFBhdGguanM/ZDRjNiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgUGF0aCA9IHJlcXVpcmUoXCIuL1BhdGhcIik7XG5cbi8vIENvbXBvdW5kUGF0aCB0byBpbXByb3ZlIHBlcmZvcm1hbmNlXG52YXIgX2RlZmF1bHQgPSBQYXRoLmV4dGVuZCh7XG4gIHR5cGU6ICdjb21wb3VuZCcsXG4gIHNoYXBlOiB7XG4gICAgcGF0aHM6IG51bGxcbiAgfSxcbiAgX3VwZGF0ZVBhdGhEaXJ0eTogZnVuY3Rpb24gKCkge1xuICAgIHZhciBkaXJ0eVBhdGggPSB0aGlzLl9fZGlydHlQYXRoO1xuICAgIHZhciBwYXRocyA9IH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4gIH0sXG4gIGFmdGVyQnJ1c2g6IGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgcGF0aHMgPSB0aGlzLnNoYXBlLnBhdGhzIHx8IFtdO1xuXG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCBwYXRocy5sZW5ndGg7IGkrKykge1xuICAgICAgcGF0aHNbaV0uX19kaXJ0eVBhdGggPSBmYWxzZTtcbiAgICB9XG4gIH0sXG4gIGdldEJvdW5kaW5nUmVjdDogZnVuY3Rpb24gKCkge1xuICAgIHRoaXMuX3VwZGF0ZVBhdGhEaXJ0eSgpO1xuXG4gICAgcmV0dXJuIFBhdGgucHJvdG90eXBlLmdldEJvdW5kaW5nUmVjdC5jYWxsKHRoaXMpO1xuICB9XG59KTtcblxubW9kdWxlLmV4cG9ydHMgPSBfZGVmYXVsdDsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/CompoundPath.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Displayable.js": +/*!*********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Displayable.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar Style = __webpack_require__(/*! ./Style */ \"./node_modules/zrender/lib/graphic/Style.js\");\n\nvar Element = __webpack_require__(/*! ../Element */ \"./node_modules/zrender/lib/Element.js\");\n\nvar RectText = __webpack_require__(/*! ./mixin/RectText */ \"./node_modules/zrender/lib/graphic/mixin/RectText.js\");\n\n/**\n * 可绘制的图形基类\n * Base class of all displayable graphic objects\n * @module zrender/graphic/Displayable\n */\n\n/**\n * @alias module:zrender/graphic/Displayable\n * @extends module:zrender/Element\n * @extends module:zrender/graphic/mixin/RectText\n */\nfunction Displayable(opts) {\n opts = opts || {};\n Element.call(this, opts); // Extend properties\n\n for (var name in opts) {\n if (opts.hasOwnProperty(name) && name !== 'style') {\n this[name] = opts[name];\n }\n }\n /**\n * @type {module:zrender/graphic/Style}\n */\n\n\n this.style = new Style(opts.style, this);\n this._rect = null; // Shapes for cascade clipping.\n\n this.__clipPaths = []; // FIXME Stateful must be mixined after style is setted\n // Stateful.call(this, opts);\n}\n\nDisplayable.prototype = {\n constructor: Displayable,\n type: 'displayable',\n\n /**\n * Displayable 是否为脏,Painter 中会根据该标记判断是否需要是否需要重新绘制\n * Dirty flag. From which painter will determine if this displayable object needs brush\n * @name module:zrender/graphic/Displayable#__dirty\n * @type {boolean}\n */\n __dirty: true,\n\n /**\n * 图形是否可见,为true时不绘制图形,但是仍能触发鼠标事件\n * If ignore drawing of the displayable object. Mouse event will still be triggered\n * @name module:/zrender/graphic/Displayable#invisible\n * @type {boolean}\n * @default false\n */\n invisible: false,\n\n /**\n * @name module:/zrender/graphic/Displayable#z\n * @type {number}\n * @default 0\n */\n z: 0,\n\n /**\n * @name module:/zrender/graphic/Displayable#z\n * @type {number}\n * @default 0\n */\n z2: 0,\n\n /**\n * z层level,决定绘画在哪层canvas中\n * @name module:/zrender/graphic/Displayable#zlevel\n * @type {number}\n * @default 0\n */\n zlevel: 0,\n\n /**\n * 是否可拖拽\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n draggable: false,\n\n /**\n * 是否正在拖拽\n * @name module:/zrender/graphic/Displayable#draggable\n * @type {boolean}\n * @default false\n */\n dragging: false,\n\n /**\n * 是否相应鼠标事件\n * @name module:/zrender/graphic/Displayable#silent\n * @type {boolean}\n * @default false\n */\n silent: false,\n\n /**\n * If enable culling\n * @type {boolean}\n * @default false\n */\n culling: false,\n\n /**\n * Mouse cursor when hovered\n * @name module:/zrender/graphic/Displayable#cursor\n * @type {string}\n */\n cursor: 'pointer',\n\n /**\n * If hover area is bounding rect\n * @name module:/zrender/graphic/Displayable#rectHover\n * @type {string}\n */\n rectHover: false,\n\n /**\n * Render the element progressively when the value >= 0,\n * usefull for large data.\n * @type {boolean}\n */\n progressive: false,\n\n /**\n * @type {boolean}\n */\n incremental: false,\n\n /**\n * Scale ratio for global scale.\n * @type {boolean}\n */\n globalScaleRatio: 1,\n beforeBrush: function (ctx) {},\n afterBrush: function (ctx) {},\n\n /**\n * 图形绘制方法\n * @param {CanvasRenderingContext2D} ctx\n */\n // Interface\n brush: function (ctx, prevEl) {},\n\n /**\n * 获取最小包围盒\n * @return {module:zrender/core/BoundingRect}\n */\n // Interface\n getBoundingRect: function () {},\n\n /**\n * 判断坐标 x, y 是否在图形上\n * If displayable element contain coord x, y\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\n contain: function (x, y) {\n return this.rectContain(x, y);\n },\n\n /**\n * @param {Function} cb\n * @param {} context\n */\n traverse: function (cb, context) {\n cb.call(context, this);\n },\n\n /**\n * 判断坐标 x, y 是否在图形的包围盒上\n * If bounding rect of element contain coord x, y\n * @param {number} x\n * @param {number} y\n * @return {boolean}\n */\n rectContain: function (x, y) {\n var coord = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n return rect.contain(coord[0], coord[1]);\n },\n\n /**\n * 标记图形元素为脏,并且在下一帧重绘\n * Mark displayable element dirty and refresh next frame\n */\n dirty: function () {\n this.__dirty = this.__dirtyText = true;\n this._rect = null;\n this.__zr && this.__zr.refresh();\n },\n\n /**\n * 图形是否会触发事件\n * If displayable object binded any event\n * @return {boolean}\n */\n // TODO, 通过 bind 绑定的事件\n // isSilent: function () {\n // return !(\n // this.hoverable || this.draggable\n // || this.onmousemove || this.onmouseover || this.onmouseout\n // || this.onmousedown || this.onmouseup || this.onclick\n // || this.ondragenter || this.ondragover || this.ondragleave\n // || this.ondrop\n // );\n // },\n\n /**\n * Alias for animate('style')\n * @param {boolean} loop\n */\n animateStyle: function (loop) {\n return this.animate('style', loop);\n },\n attrKV: function (key, value) {\n if (key !== 'style') {\n Element.prototype.attrKV.call(this, key, value);\n } else {\n this.style.set(value);\n }\n },\n\n /**\n * @param {Object|string} key\n * @param {*} value\n */\n setStyle: function (key, value) {\n this.style.set(key, value);\n this.dirty(false);\n return this;\n },\n\n /**\n * Use given style object\n * @param {Object} obj\n */\n useStyle: function (obj) {\n this.style = new Style(obj, this);\n this.dirty(false);\n return this;\n }\n};\nzrUtil.inherits(Displayable, Element);\nzrUtil.mixin(Displayable, RectText); // zrUtil.mixin(Displayable, Stateful);\n\nvar _default = Displayable;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9EaXNwbGF5YWJsZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL0Rpc3BsYXlhYmxlLmpzPzE5ZWIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHpyVXRpbCA9IHJlcXVpcmUoXCIuLi9jb3JlL3V0aWxcIik7XG5cbnZhciBTdHlsZSA9IHJlcXVpcmUoXCIuL1N0eWxlXCIpO1xuXG52YXIgRW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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Displayable.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Gradient.js": +/*!******************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Gradient.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * @param {Array.} colorStops\n */\nvar Gradient = function (colorStops) {\n this.colorStops = colorStops || [];\n};\n\nGradient.prototype = {\n constructor: Gradient,\n addColorStop: function (offset, color) {\n this.colorStops.push({\n offset: offset,\n color: color\n });\n }\n};\nvar _default = Gradient;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9HcmFkaWVudC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL0dyYWRpZW50LmpzPzQyZTUiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAcGFyYW0ge0FycmF5LjxPYmplY3Q+fSBjb2xvclN0b3BzXG4gKi9cbnZhciBHcmFkaWVudCA9IGZ1bmN0aW9uIChjb2xvclN0b3BzKSB7XG4gIHRoaXMuY29sb3JTdG9wcyA9IGNvbG9yU3RvcHMgfHwgW107XG59O1xuXG5HcmFkaWVudC5wcm90b3R5cGUgPSB7XG4gIGNvbnN0cnVjdG9yOiBHcmFkaWVudCxcbiAgYWRkQ29sb3JTdG9wOiBmdW5jdGlvbiAob2Zmc2V0LCBjb2xvcikge1xuICAgIHRoaXMuY29sb3JTdG9wcy5wdXNoKHtcbiAgICAgIG9mZnNldDogb2Zmc2V0LFxuICAgICAgY29sb3I6IGNvbG9yXG4gICAgfSk7XG4gIH1cbn07XG52YXIgX2RlZmF1bHQgPSBHcmFkaWVudDtcbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Gradient.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Image.js": +/*!***************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Image.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Displayable = __webpack_require__(/*! ./Displayable */ \"./node_modules/zrender/lib/graphic/Displayable.js\");\n\nvar BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\nvar zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar imageHelper = __webpack_require__(/*! ./helper/image */ \"./node_modules/zrender/lib/graphic/helper/image.js\");\n\n/**\n * @alias zrender/graphic/Image\n * @extends module:zrender/graphic/Displayable\n * @constructor\n * @param {Object} opts\n */\nfunction ZImage(opts) {\n Displayable.call(this, opts);\n}\n\nZImage.prototype = {\n constructor: ZImage,\n type: 'image',\n brush: function (ctx, prevEl) {\n var style = this.style;\n var src = style.image; // Must bind each time\n\n style.bind(ctx, this, prevEl);\n var image = this._image = imageHelper.createOrUpdateImage(src, this._image, this, this.onload);\n\n if (!image || !imageHelper.isImageReady(image)) {\n return;\n } // 图片已经加载完成\n // if (image.nodeName.toUpperCase() == 'IMG') {\n // if (!image.complete) {\n // return;\n // }\n // }\n // Else is canvas\n\n\n var x = style.x || 0;\n var y = style.y || 0;\n var width = style.width;\n var height = style.height;\n var aspect = image.width / image.height;\n\n if (width == null && height != null) {\n // Keep image/height ratio\n width = height * aspect;\n } else if (height == null && width != null) {\n height = width / aspect;\n } else if (width == null && height == null) {\n width = image.width;\n height = image.height;\n } // 设置transform\n\n\n this.setTransform(ctx);\n\n if (style.sWidth && style.sHeight) {\n var sx = style.sx || 0;\n var sy = style.sy || 0;\n ctx.drawImage(image, sx, sy, style.sWidth, style.sHeight, x, y, width, height);\n } else if (style.sx && style.sy) {\n var sx = style.sx;\n var sy = style.sy;\n var sWidth = width - sx;\n var sHeight = height - sy;\n ctx.drawImage(image, sx, sy, sWidth, sHeight, x, y, width, height);\n } else {\n ctx.drawImage(image, x, y, width, height);\n } // Draw rect text\n\n\n if (style.text != null) {\n // Only restore transform when needs draw text.\n this.restoreTransform(ctx);\n this.drawRectText(ctx, this.getBoundingRect());\n }\n },\n getBoundingRect: function () {\n var style = this.style;\n\n if (!this._rect) {\n this._rect = new BoundingRect(style.x || 0, style.y || 0, style.width || 0, style.height || 0);\n }\n\n return this._rect;\n }\n};\nzrUtil.inherits(ZImage, Displayable);\nvar _default = ZImage;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9JbWFnZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL0ltYWdlLmpzPzBkYTgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIERpc3BsYXlhYmxlID0gcmVxdWlyZShcIi4vRGlzcGxheWFibGVcIik7XG5cbnZhciBCb3VuZGluZ1JlY3QgPSByZXF1aXJ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W1hZ2U7XG5tb2R1bGUuZXhwb3J0cyA9IF9kZWZhdWx0OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Image.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/IncrementalDisplayable.js": +/*!********************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/IncrementalDisplayable.js ***! + \********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var _util = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar inherits = _util.inherits;\n\nvar Displayble = __webpack_require__(/*! ./Displayable */ \"./node_modules/zrender/lib/graphic/Displayable.js\");\n\nvar BoundingRect = __webpack_require__(/*! ../core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\n/**\n * Displayable for incremental rendering. It will be rendered in a separate layer\n * IncrementalDisplay have two main methods. `clearDisplayables` and `addDisplayables`\n * addDisplayables will render the added displayables incremetally.\n *\n * It use a not clearFlag to tell the painter don't clear the layer if it's the first element.\n */\n// TODO Style override ?\nfunction IncrementalDisplayble(opts) {\n Displayble.call(this, opts);\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.notClear = true;\n}\n\nIncrementalDisplayble.prototype.incremental = true;\n\nIncrementalDisplayble.prototype.clearDisplaybles = function () {\n this._displayables = [];\n this._temporaryDisplayables = [];\n this._cursor = 0;\n this.dirty();\n this.notClear = false;\n};\n\nIncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) {\n if (notPersistent) {\n this._temporaryDisplayables.push(displayable);\n } else {\n this._displayables.push(displayable);\n }\n\n this.dirty();\n};\n\nIncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) {\n notPersistent = notPersistent || false;\n\n for (var i = 0; i < displayables.length; i++) {\n this.addDisplayable(displayables[i], notPersistent);\n }\n};\n\nIncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) {\n for (var i = this._cursor; i < this._displayables.length; i++) {\n cb && cb(this._displayables[i]);\n }\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n cb && cb(this._temporaryDisplayables[i]);\n }\n};\n\nIncrementalDisplayble.prototype.update = function () {\n this.updateTransform();\n\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i]; // PENDING\n\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i]; // PENDING\n\n displayable.parent = this;\n displayable.update();\n displayable.parent = null;\n }\n};\n\nIncrementalDisplayble.prototype.brush = function (ctx, prevEl) {\n // Render persistant displayables.\n for (var i = this._cursor; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n displayable.beforeBrush && displayable.beforeBrush(ctx);\n displayable.brush(ctx, i === this._cursor ? null : this._displayables[i - 1]);\n displayable.afterBrush && displayable.afterBrush(ctx);\n }\n\n this._cursor = i; // Render temporary displayables.\n\n for (var i = 0; i < this._temporaryDisplayables.length; i++) {\n var displayable = this._temporaryDisplayables[i];\n displayable.beforeBrush && displayable.beforeBrush(ctx);\n displayable.brush(ctx, i === 0 ? null : this._temporaryDisplayables[i - 1]);\n displayable.afterBrush && displayable.afterBrush(ctx);\n }\n\n this._temporaryDisplayables = [];\n this.notClear = true;\n};\n\nvar m = [];\n\nIncrementalDisplayble.prototype.getBoundingRect = function () {\n if (!this._rect) {\n var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity);\n\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n var childRect = displayable.getBoundingRect().clone();\n\n if (displayable.needLocalTransform()) {\n childRect.applyTransform(displayable.getLocalTransform(m));\n }\n\n rect.union(childRect);\n }\n\n this._rect = rect;\n }\n\n return this._rect;\n};\n\nIncrementalDisplayble.prototype.contain = function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n\n if (rect.contain(localPos[0], localPos[1])) {\n for (var i = 0; i < this._displayables.length; i++) {\n var displayable = this._displayables[i];\n\n if (displayable.contain(x, y)) {\n return true;\n }\n }\n }\n\n return false;\n};\n\ninherits(IncrementalDisplayble, Displayble);\nvar _default = IncrementalDisplayble;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9JbmNyZW1lbnRhbERpc3BsYXlhYmxlLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxs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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/IncrementalDisplayable.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/LinearGradient.js": +/*!************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/LinearGradient.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar Gradient = __webpack_require__(/*! ./Gradient */ \"./node_modules/zrender/lib/graphic/Gradient.js\");\n\n/**\n * x, y, x2, y2 are all percent from 0 to 1\n * @param {number} [x=0]\n * @param {number} [y=0]\n * @param {number} [x2=1]\n * @param {number} [y2=0]\n * @param {Array.} colorStops\n * @param {boolean} [globalCoord=false]\n */\nvar LinearGradient = function (x, y, x2, y2, colorStops, globalCoord) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {type: 'linear', colorStops: ...}`, where\n // this constructor will not be called.\n this.x = x == null ? 0 : x;\n this.y = y == null ? 0 : y;\n this.x2 = x2 == null ? 1 : x2;\n this.y2 = y2 == null ? 0 : y2; // Can be cloned\n\n this.type = 'linear'; // If use global coord\n\n this.global = globalCoord || false;\n Gradient.call(this, colorStops);\n};\n\nLinearGradient.prototype = {\n constructor: LinearGradient\n};\nzrUtil.inherits(LinearGradient, Gradient);\nvar _default = LinearGradient;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9MaW5lYXJHcmFkaWVudC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL0xpbmVhckdyYWRpZW50LmpzPzQ4YTkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHpyVXRpbCA9IHJlcXVpcmUoXCIuLi9jb3JlL3V0aWxcIik7XG5cbnZhciBHcmFkaWVudCA9IHJlcXVpcmUoXCIuL0dyYWRpZW50XCIpO1xuXG4vKipcbiAqIHgsIHksIHgyLCB5MiBhcmUgYWxsIHBlcmNlbnQgZnJvbSAwIHRvIDFcbiAqIEBwYXJhbSB7bnVtYmVyfSBbeD0wXVxuICogQHBhcmFtIHtudW1iZXJ9IFt5PTBdXG4gKiBAcGFyYW0ge251bWJlcn0gW3gyPTFdXG4gKiBAcGFyYW0ge251bWJlcn0gW3kyPTBdXG4gKiBAcGFyYW0ge0FycmF5LjxPYmplY3Q+fSBjb2xvclN0b3BzXG4gKiBAcGFyYW0ge2Jvb2xlYW59IFtnbG9iYWxDb29yZD1mYWxzZV1cbiAqL1xudmFyIExpbmVhckdyYWRpZW50ID0gZnVuY3Rpb24gKHgsIHksIHgyLCB5MiwgY29sb3JTdG9wcywgZ2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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/LinearGradient.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Path.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Path.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Displayable = __webpack_require__(/*! ./Displayable */ \"./node_modules/zrender/lib/graphic/Displayable.js\");\n\nvar zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar PathProxy = __webpack_require__(/*! ../core/PathProxy */ \"./node_modules/zrender/lib/core/PathProxy.js\");\n\nvar pathContain = __webpack_require__(/*! ../contain/path */ \"./node_modules/zrender/lib/contain/path.js\");\n\nvar Pattern = __webpack_require__(/*! ./Pattern */ \"./node_modules/zrender/lib/graphic/Pattern.js\");\n\nvar getCanvasPattern = Pattern.prototype.getCanvasPattern;\nvar abs = Math.abs;\nvar pathProxyForDraw = new PathProxy(true);\n/**\n * @alias module:zrender/graphic/Path\n * @extends module:zrender/graphic/Displayable\n * @constructor\n * @param {Object} opts\n */\n\nfunction Path(opts) {\n Displayable.call(this, opts);\n /**\n * @type {module:zrender/core/PathProxy}\n * @readOnly\n */\n\n this.path = null;\n}\n\nPath.prototype = {\n constructor: Path,\n type: 'path',\n __dirtyPath: true,\n strokeContainThreshold: 5,\n\n /**\n * See `module:zrender/src/graphic/helper/subPixelOptimize`.\n * @type {boolean}\n */\n subPixelOptimize: false,\n brush: function (ctx, prevEl) {\n var style = this.style;\n var path = this.path || pathProxyForDraw;\n var hasStroke = style.hasStroke();\n var hasFill = style.hasFill();\n var fill = style.fill;\n var stroke = style.stroke;\n var hasFillGradient = hasFill && !!fill.colorStops;\n var hasStrokeGradient = hasStroke && !!stroke.colorStops;\n var hasFillPattern = hasFill && !!fill.image;\n var hasStrokePattern = hasStroke && !!stroke.image;\n style.bind(ctx, this, prevEl);\n this.setTransform(ctx);\n\n if (this.__dirty) {\n var rect; // Update gradient because bounding rect may changed\n\n if (hasFillGradient) {\n rect = rect || this.getBoundingRect();\n this._fillGradient = style.getGradient(ctx, fill, rect);\n }\n\n if (hasStrokeGradient) {\n rect = rect || this.getBoundingRect();\n this._strokeGradient = style.getGradient(ctx, stroke, rect);\n }\n } // Use the gradient or pattern\n\n\n if (hasFillGradient) {\n // PENDING If may have affect the state\n ctx.fillStyle = this._fillGradient;\n } else if (hasFillPattern) {\n ctx.fillStyle = getCanvasPattern.call(fill, ctx);\n }\n\n if (hasStrokeGradient) {\n ctx.strokeStyle = this._strokeGradient;\n } else if (hasStrokePattern) {\n ctx.strokeStyle = getCanvasPattern.call(stroke, ctx);\n }\n\n var lineDash = style.lineDash;\n var lineDashOffset = style.lineDashOffset;\n var ctxLineDash = !!ctx.setLineDash; // Update path sx, sy\n\n var scale = this.getGlobalScale();\n path.setScale(scale[0], scale[1]); // Proxy context\n // Rebuild path in following 2 cases\n // 1. Path is dirty\n // 2. Path needs javascript implemented lineDash stroking.\n // In this case, lineDash information will not be saved in PathProxy\n\n if (this.__dirtyPath || lineDash && !ctxLineDash && hasStroke) {\n path.beginPath(ctx); // Setting line dash before build path\n\n if (lineDash && !ctxLineDash) {\n path.setLineDash(lineDash);\n path.setLineDashOffset(lineDashOffset);\n }\n\n this.buildPath(path, this.shape, false); // Clear path dirty flag\n\n if (this.path) {\n this.__dirtyPath = false;\n }\n } else {\n // Replay path building\n ctx.beginPath();\n this.path.rebuildPath(ctx);\n }\n\n if (hasFill) {\n if (style.fillOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n path.fill(ctx);\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n path.fill(ctx);\n }\n }\n\n if (lineDash && ctxLineDash) {\n ctx.setLineDash(lineDash);\n ctx.lineDashOffset = lineDashOffset;\n }\n\n if (hasStroke) {\n if (style.strokeOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n path.stroke(ctx);\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n path.stroke(ctx);\n }\n }\n\n if (lineDash && ctxLineDash) {\n // PENDING\n // Remove lineDash\n ctx.setLineDash([]);\n } // Draw rect text\n\n\n if (style.text != null) {\n // Only restore transform when needs draw text.\n this.restoreTransform(ctx);\n this.drawRectText(ctx, this.getBoundingRect());\n }\n },\n // When bundling path, some shape may decide if use moveTo to begin a new subpath or closePath\n // Like in circle\n buildPath: function (ctx, shapeCfg, inBundle) {},\n createPathProxy: function () {\n this.path = new PathProxy();\n },\n getBoundingRect: function () {\n var rect = this._rect;\n var style = this.style;\n var needsUpdateRect = !rect;\n\n if (needsUpdateRect) {\n var path = this.path;\n\n if (!path) {\n // Create path on demand.\n path = this.path = new PathProxy();\n }\n\n if (this.__dirtyPath) {\n path.beginPath();\n this.buildPath(path, this.shape, false);\n }\n\n rect = path.getBoundingRect();\n }\n\n this._rect = rect;\n\n if (style.hasStroke()) {\n // Needs update rect with stroke lineWidth when\n // 1. Element changes scale or lineWidth\n // 2. Shape is changed\n var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone());\n\n if (this.__dirty || needsUpdateRect) {\n rectWithStroke.copy(rect); // FIXME Must after updateTransform\n\n var w = style.lineWidth; // PENDING, Min line width is needed when line is horizontal or vertical\n\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1; // Only add extra hover lineWidth when there are no fill\n\n if (!style.hasFill()) {\n w = Math.max(w, this.strokeContainThreshold || 4);\n } // Consider line width\n // Line scale can't be 0;\n\n\n if (lineScale > 1e-10) {\n rectWithStroke.width += w / lineScale;\n rectWithStroke.height += w / lineScale;\n rectWithStroke.x -= w / lineScale / 2;\n rectWithStroke.y -= w / lineScale / 2;\n }\n } // Return rect with stroke\n\n\n return rectWithStroke;\n }\n\n return rect;\n },\n contain: function (x, y) {\n var localPos = this.transformCoordToLocal(x, y);\n var rect = this.getBoundingRect();\n var style = this.style;\n x = localPos[0];\n y = localPos[1];\n\n if (rect.contain(x, y)) {\n var pathData = this.path.data;\n\n if (style.hasStroke()) {\n var lineWidth = style.lineWidth;\n var lineScale = style.strokeNoScale ? this.getLineScale() : 1; // Line scale can't be 0;\n\n if (lineScale > 1e-10) {\n // Only add extra hover lineWidth when there are no fill\n if (!style.hasFill()) {\n lineWidth = Math.max(lineWidth, this.strokeContainThreshold);\n }\n\n if (pathContain.containStroke(pathData, lineWidth / lineScale, x, y)) {\n return true;\n }\n }\n }\n\n if (style.hasFill()) {\n return pathContain.contain(pathData, x, y);\n }\n }\n\n return false;\n },\n\n /**\n * @param {boolean} dirtyPath\n */\n dirty: function (dirtyPath) {\n if (dirtyPath == null) {\n dirtyPath = true;\n } // Only mark dirty, not mark clean\n\n\n if (dirtyPath) {\n this.__dirtyPath = dirtyPath;\n this._rect = null;\n }\n\n this.__dirty = this.__dirtyText = true;\n this.__zr && this.__zr.refresh(); // Used as a clipping path\n\n if (this.__clipTarget) {\n this.__clipTarget.dirty();\n }\n },\n\n /**\n * Alias for animate('shape')\n * @param {boolean} loop\n */\n animateShape: function (loop) {\n return this.animate('shape', loop);\n },\n // Overwrite attrKV\n attrKV: function (key, value) {\n // FIXME\n if (key === 'shape') {\n this.setShape(value);\n this.__dirtyPath = true;\n this._rect = null;\n } else {\n Displayable.prototype.attrKV.call(this, key, value);\n }\n },\n\n /**\n * @param {Object|string} key\n * @param {*} value\n */\n setShape: function (key, value) {\n var shape = this.shape; // Path from string may not have shape\n\n if (shape) {\n if (zrUtil.isObject(key)) {\n for (var name in key) {\n if (key.hasOwnProperty(name)) {\n shape[name] = key[name];\n }\n }\n } else {\n shape[key] = value;\n }\n\n this.dirty(true);\n }\n\n return this;\n },\n getLineScale: function () {\n var m = this.transform; // Get the line scale.\n // Determinant of `m` means how much the area is enlarged by the\n // transformation. So its square root can be used as a scale factor\n // for width.\n\n 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;\n }\n};\n/**\n * 扩展一个 Path element, 比如星形,圆等。\n * Extend a path element\n * @param {Object} props\n * @param {string} props.type Path type\n * @param {Function} props.init Initialize\n * @param {Function} props.buildPath Overwrite buildPath method\n * @param {Object} [props.style] Extended default style config\n * @param {Object} [props.shape] Extended default shape config\n */\n\nPath.extend = function (defaults) {\n var Sub = function (opts) {\n Path.call(this, opts);\n\n if (defaults.style) {\n // Extend default style\n this.style.extendFrom(defaults.style, false);\n } // Extend default shape\n\n\n var defaultShape = defaults.shape;\n\n if (defaultShape) {\n this.shape = this.shape || {};\n var thisShape = this.shape;\n\n for (var name in defaultShape) {\n if (!thisShape.hasOwnProperty(name) && defaultShape.hasOwnProperty(name)) {\n thisShape[name] = defaultShape[name];\n }\n }\n }\n\n defaults.init && defaults.init.call(this, opts);\n };\n\n zrUtil.inherits(Sub, Path); // FIXME 不能 extend position, rotation 等引用对象\n\n for (var name in defaults) {\n // Extending prototype values and methods\n if (name !== 'style' && name !== 'shape') {\n Sub.prototype[name] = defaults[name];\n }\n }\n\n return Sub;\n};\n\nzrUtil.inherits(Path, Displayable);\nvar _default = Path;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9QYXRoLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvUGF0aC5qcz9jYmU1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBEaXNwbGF5YWJsZSA9IHJlcXVpcmUoXCIuL0Rpc3BsYXlhYmxlXCIpO1xuXG52YXIgenJVdG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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Path.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Pattern.js": +/*!*****************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Pattern.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var Pattern = function (image, repeat) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {image: ...}`, where this constructor will not be called.\n this.image = image;\n this.repeat = repeat; // Can be cloned\n\n this.type = 'pattern';\n};\n\nPattern.prototype.getCanvasPattern = function (ctx) {\n return ctx.createPattern(this.image, this.repeat || 'repeat');\n};\n\nvar _default = Pattern;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9QYXR0ZXJuLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvUGF0dGVybi5qcz9kYzJmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXR0ZXJuID0gZnVuY3Rpb24gKGltYWdlLCByZXBlYXQpIHtcbiAgLy8gU2hvdWxkIGRvIG5vdGhpbmcgbW9yZSBpbiB0aGlzIGNvbnN0cnVjdG9yLiBCZWNhdXNlIGdyYWRpZW50IGNhbiBiZVxuICAvLyBkZWNsYXJkIGJ5IGBjb2xvcjoge2ltYWdlOiAuLi59YCwgd2hlcmUgdGhpcyBjb25zdHJ1Y3RvciB3aWxsIG5vdCBiZSBjYWxsZWQuXG4gIHRoaXMuaW1hZ2UgPSBpbWFnZTtcbiAgdGhpcy5yZXBlYXQgPSByZXBlYXQ7IC8vIENhbiBiZSBjbG9uZWRcblxuICB0aGlzLnR5cGUgPSAncGF0dGVybic7XG59O1xuXG5QYXR0ZXJuLnByb3RvdHlwZS5nZXRDYW52YXNQYXR0ZXJuID0gZnVuY3Rpb24gKGN0eCkge1xuICByZXR1cm4gY3R4LmNyZWF0ZVBhdHRlcm4odGhpcy5pbWFnZSwgdGhpcy5yZXBlYXQgfHwgJ3JlcGVhdCcpO1xufTtcblxudmFyIF9kZWZhdWx0ID0gUGF0dGVybjtcbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Pattern.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/RadialGradient.js": +/*!************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/RadialGradient.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar Gradient = __webpack_require__(/*! ./Gradient */ \"./node_modules/zrender/lib/graphic/Gradient.js\");\n\n/**\n * x, y, r are all percent from 0 to 1\n * @param {number} [x=0.5]\n * @param {number} [y=0.5]\n * @param {number} [r=0.5]\n * @param {Array.} [colorStops]\n * @param {boolean} [globalCoord=false]\n */\nvar RadialGradient = function (x, y, r, colorStops, globalCoord) {\n // Should do nothing more in this constructor. Because gradient can be\n // declard by `color: {type: 'radial', colorStops: ...}`, where\n // this constructor will not be called.\n this.x = x == null ? 0.5 : x;\n this.y = y == null ? 0.5 : y;\n this.r = r == null ? 0.5 : r; // Can be cloned\n\n this.type = 'radial'; // If use global coord\n\n this.global = globalCoord || false;\n Gradient.call(this, colorStops);\n};\n\nRadialGradient.prototype = {\n constructor: RadialGradient\n};\nzrUtil.inherits(RadialGradient, Gradient);\nvar _default = RadialGradient;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9SYWRpYWxHcmFkaWVudC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL1JhZGlhbEdyYWRpZW50LmpzP2RkZWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHpyVXRpbCA9IHJlcXVpcmUoXCIuLi9jb3JlL3V0aWxcIik7XG5cbnZhciBHcmFkaWVudCA9IHJlcXVpcmUoXCIuL0dyYWRpZW50XCIpO1xuXG4vKipcbiAqIHgsIHksIHIgYXJlIGFsbCBwZXJjZW50IGZyb20gMCB0byAxXG4gKiBAcGFyYW0ge251bWJlcn0gW3g9MC41XVxuICogQHBhcmFtIHtudW1iZXJ9IFt5PTAuNV1cbiAqIEBwYXJhbSB7bnVtYmVyfSBbcj0wLjVdXG4gKiBAcGFyYW0ge0FycmF5LjxPYmplY3Q+fSBbY29sb3JTdG9wc11cbiAqIEBwYXJhbSB7Ym9vbGVhbn0gW2dsb2JhbENvb3JkPWZhbHNlXVxuICovXG52YXIgUmFkaWFsR3JhZGllbnQgPSBmdW5jdGlvbiAoeCwgeSwgciwgY29sb3JTdG9wcywgZ2xvYmFsQ29vcmQpIHtcbiAgLy8gU2hvdWx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ifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/RadialGradient.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Style.js": +/*!***************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Style.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var fixShadow = __webpack_require__(/*! ./helper/fixShadow */ \"./node_modules/zrender/lib/graphic/helper/fixShadow.js\");\n\nvar _constant = __webpack_require__(/*! ./constant */ \"./node_modules/zrender/lib/graphic/constant.js\");\n\nvar ContextCachedBy = _constant.ContextCachedBy;\nvar STYLE_COMMON_PROPS = [['shadowBlur', 0], ['shadowOffsetX', 0], ['shadowOffsetY', 0], ['shadowColor', '#000'], ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10]]; // var SHADOW_PROPS = STYLE_COMMON_PROPS.slice(0, 4);\n// var LINE_PROPS = STYLE_COMMON_PROPS.slice(4);\n\nvar Style = function (opts) {\n this.extendFrom(opts, false);\n};\n\nfunction createLinearGradient(ctx, obj, rect) {\n var x = obj.x == null ? 0 : obj.x;\n var x2 = obj.x2 == null ? 1 : obj.x2;\n var y = obj.y == null ? 0 : obj.y;\n var y2 = obj.y2 == null ? 0 : obj.y2;\n\n if (!obj.global) {\n x = x * rect.width + rect.x;\n x2 = x2 * rect.width + rect.x;\n y = y * rect.height + rect.y;\n y2 = y2 * rect.height + rect.y;\n } // Fix NaN when rect is Infinity\n\n\n x = isNaN(x) ? 0 : x;\n x2 = isNaN(x2) ? 1 : x2;\n y = isNaN(y) ? 0 : y;\n y2 = isNaN(y2) ? 0 : y2;\n var canvasGradient = ctx.createLinearGradient(x, y, x2, y2);\n return canvasGradient;\n}\n\nfunction createRadialGradient(ctx, obj, rect) {\n var width = rect.width;\n var height = rect.height;\n var min = Math.min(width, height);\n var x = obj.x == null ? 0.5 : obj.x;\n var y = obj.y == null ? 0.5 : obj.y;\n var r = obj.r == null ? 0.5 : obj.r;\n\n if (!obj.global) {\n x = x * width + rect.x;\n y = y * height + rect.y;\n r = r * min;\n }\n\n var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r);\n return canvasGradient;\n}\n\nStyle.prototype = {\n constructor: Style,\n\n /**\n * @type {string}\n */\n fill: '#000',\n\n /**\n * @type {string}\n */\n stroke: null,\n\n /**\n * @type {number}\n */\n opacity: 1,\n\n /**\n * @type {number}\n */\n fillOpacity: null,\n\n /**\n * @type {number}\n */\n strokeOpacity: null,\n\n /**\n * @type {Array.}\n */\n lineDash: null,\n\n /**\n * @type {number}\n */\n lineDashOffset: 0,\n\n /**\n * @type {number}\n */\n shadowBlur: 0,\n\n /**\n * @type {number}\n */\n shadowOffsetX: 0,\n\n /**\n * @type {number}\n */\n shadowOffsetY: 0,\n\n /**\n * @type {number}\n */\n lineWidth: 1,\n\n /**\n * If stroke ignore scale\n * @type {Boolean}\n */\n strokeNoScale: false,\n // Bounding rect text configuration\n // Not affected by element transform\n\n /**\n * @type {string}\n */\n text: null,\n\n /**\n * If `fontSize` or `fontFamily` exists, `font` will be reset by\n * `fontSize`, `fontStyle`, `fontWeight`, `fontFamily`.\n * So do not visit it directly in upper application (like echarts),\n * but use `contain/text#makeFont` instead.\n * @type {string}\n */\n font: null,\n\n /**\n * The same as font. Use font please.\n * @deprecated\n * @type {string}\n */\n textFont: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * @type {string}\n */\n fontStyle: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * @type {string}\n */\n fontWeight: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * Should be 12 but not '12px'.\n * @type {number}\n */\n fontSize: null,\n\n /**\n * It helps merging respectively, rather than parsing an entire font string.\n * @type {string}\n */\n fontFamily: null,\n\n /**\n * Reserved for special functinality, like 'hr'.\n * @type {string}\n */\n textTag: null,\n\n /**\n * @type {string}\n */\n textFill: '#000',\n\n /**\n * @type {string}\n */\n textStroke: null,\n\n /**\n * @type {number}\n */\n textWidth: null,\n\n /**\n * Only for textBackground.\n * @type {number}\n */\n textHeight: null,\n\n /**\n * textStroke may be set as some color as a default\n * value in upper applicaion, where the default value\n * of textStrokeWidth should be 0 to make sure that\n * user can choose to do not use text stroke.\n * @type {number}\n */\n textStrokeWidth: 0,\n\n /**\n * @type {number}\n */\n textLineHeight: null,\n\n /**\n * 'inside', 'left', 'right', 'top', 'bottom'\n * [x, y]\n * Based on x, y of rect.\n * @type {string|Array.}\n * @default 'inside'\n */\n textPosition: 'inside',\n\n /**\n * If not specified, use the boundingRect of a `displayable`.\n * @type {Object}\n */\n textRect: null,\n\n /**\n * [x, y]\n * @type {Array.}\n */\n textOffset: null,\n\n /**\n * @type {string}\n */\n textAlign: null,\n\n /**\n * @type {string}\n */\n textVerticalAlign: null,\n\n /**\n * @type {number}\n */\n textDistance: 5,\n\n /**\n * @type {string}\n */\n textShadowColor: 'transparent',\n\n /**\n * @type {number}\n */\n textShadowBlur: 0,\n\n /**\n * @type {number}\n */\n textShadowOffsetX: 0,\n\n /**\n * @type {number}\n */\n textShadowOffsetY: 0,\n\n /**\n * @type {string}\n */\n textBoxShadowColor: 'transparent',\n\n /**\n * @type {number}\n */\n textBoxShadowBlur: 0,\n\n /**\n * @type {number}\n */\n textBoxShadowOffsetX: 0,\n\n /**\n * @type {number}\n */\n textBoxShadowOffsetY: 0,\n\n /**\n * Whether transform text.\n * Only useful in Path and Image element\n * @type {boolean}\n */\n transformText: false,\n\n /**\n * Text rotate around position of Path or Image\n * Only useful in Path and Image element and transformText is false.\n */\n textRotation: 0,\n\n /**\n * Text origin of text rotation, like [10, 40].\n * Based on x, y of rect.\n * Useful in label rotation of circular symbol.\n * By default, this origin is textPosition.\n * Can be 'center'.\n * @type {string|Array.}\n */\n textOrigin: null,\n\n /**\n * @type {string}\n */\n textBackgroundColor: null,\n\n /**\n * @type {string}\n */\n textBorderColor: null,\n\n /**\n * @type {number}\n */\n textBorderWidth: 0,\n\n /**\n * @type {number}\n */\n textBorderRadius: 0,\n\n /**\n * Can be `2` or `[2, 4]` or `[2, 3, 4, 5]`\n * @type {number|Array.}\n */\n textPadding: null,\n\n /**\n * Text styles for rich text.\n * @type {Object}\n */\n rich: null,\n\n /**\n * {outerWidth, outerHeight, ellipsis, placeholder}\n * @type {Object}\n */\n truncate: null,\n\n /**\n * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation\n * @type {string}\n */\n blend: null,\n\n /**\n * @param {CanvasRenderingContext2D} ctx\n */\n bind: function (ctx, el, prevEl) {\n var style = this;\n var prevStyle = prevEl && prevEl.style; // If no prevStyle, it means first draw.\n // Only apply cache if the last time cachced by this function.\n\n var notCheckCache = !prevStyle || ctx.__attrCachedBy !== ContextCachedBy.STYLE_BIND;\n ctx.__attrCachedBy = ContextCachedBy.STYLE_BIND;\n\n for (var i = 0; i < STYLE_COMMON_PROPS.length; i++) {\n var prop = STYLE_COMMON_PROPS[i];\n var styleName = prop[0];\n\n if (notCheckCache || style[styleName] !== prevStyle[styleName]) {\n // FIXME Invalid property value will cause style leak from previous element.\n ctx[styleName] = fixShadow(ctx, styleName, style[styleName] || prop[1]);\n }\n }\n\n if (notCheckCache || style.fill !== prevStyle.fill) {\n ctx.fillStyle = style.fill;\n }\n\n if (notCheckCache || style.stroke !== prevStyle.stroke) {\n ctx.strokeStyle = style.stroke;\n }\n\n if (notCheckCache || style.opacity !== prevStyle.opacity) {\n ctx.globalAlpha = style.opacity == null ? 1 : style.opacity;\n }\n\n if (notCheckCache || style.blend !== prevStyle.blend) {\n ctx.globalCompositeOperation = style.blend || 'source-over';\n }\n\n if (this.hasStroke()) {\n var lineWidth = style.lineWidth;\n ctx.lineWidth = lineWidth / (this.strokeNoScale && el && el.getLineScale ? el.getLineScale() : 1);\n }\n },\n hasFill: function () {\n var fill = this.fill;\n return fill != null && fill !== 'none';\n },\n hasStroke: function () {\n var stroke = this.stroke;\n return stroke != null && stroke !== 'none' && this.lineWidth > 0;\n },\n\n /**\n * Extend from other style\n * @param {zrender/graphic/Style} otherStyle\n * @param {boolean} overwrite true: overwrirte any way.\n * false: overwrite only when !target.hasOwnProperty\n * others: overwrite when property is not null/undefined.\n */\n extendFrom: function (otherStyle, overwrite) {\n if (otherStyle) {\n for (var name in otherStyle) {\n if (otherStyle.hasOwnProperty(name) && (overwrite === true || (overwrite === false ? !this.hasOwnProperty(name) : otherStyle[name] != null))) {\n this[name] = otherStyle[name];\n }\n }\n }\n },\n\n /**\n * Batch setting style with a given object\n * @param {Object|string} obj\n * @param {*} [obj]\n */\n set: function (obj, value) {\n if (typeof obj === 'string') {\n this[obj] = value;\n } else {\n this.extendFrom(obj, true);\n }\n },\n\n /**\n * Clone\n * @return {zrender/graphic/Style} [description]\n */\n clone: function () {\n var newStyle = new this.constructor();\n newStyle.extendFrom(this, true);\n return newStyle;\n },\n getGradient: function (ctx, obj, rect) {\n var method = obj.type === 'radial' ? createRadialGradient : createLinearGradient;\n var canvasGradient = method(ctx, obj, rect);\n var colorStops = obj.colorStops;\n\n for (var i = 0; i < colorStops.length; i++) {\n canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);\n }\n\n return canvasGradient;\n }\n};\nvar styleProto = Style.prototype;\n\nfor (var i = 0; i < STYLE_COMMON_PROPS.length; i++) {\n var prop = STYLE_COMMON_PROPS[i];\n\n if (!(prop[0] in styleProto)) {\n styleProto[prop[0]] = prop[1];\n }\n} // Provide for others\n\n\nStyle.getGradient = styleProto.getGradient;\nvar _default = Style;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9TdHlsZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL1N0eWxlLmpzPzJiNj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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Style.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/Text.js": +/*!**************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/Text.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Displayable = __webpack_require__(/*! ./Displayable */ \"./node_modules/zrender/lib/graphic/Displayable.js\");\n\nvar zrUtil = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar textContain = __webpack_require__(/*! ../contain/text */ \"./node_modules/zrender/lib/contain/text.js\");\n\nvar textHelper = __webpack_require__(/*! ./helper/text */ \"./node_modules/zrender/lib/graphic/helper/text.js\");\n\nvar _constant = __webpack_require__(/*! ./constant */ \"./node_modules/zrender/lib/graphic/constant.js\");\n\nvar ContextCachedBy = _constant.ContextCachedBy;\n\n/**\n * @alias zrender/graphic/Text\n * @extends module:zrender/graphic/Displayable\n * @constructor\n * @param {Object} opts\n */\nvar Text = function (opts) {\n // jshint ignore:line\n Displayable.call(this, opts);\n};\n\nText.prototype = {\n constructor: Text,\n type: 'text',\n brush: function (ctx, prevEl) {\n var style = this.style; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true); // Use props with prefix 'text'.\n\n style.fill = style.stroke = style.shadowBlur = style.shadowColor = style.shadowOffsetX = style.shadowOffsetY = null;\n var text = style.text; // Convert to string\n\n text != null && (text += ''); // Do not apply style.bind in Text node. Because the real bind job\n // is in textHelper.renderText, and performance of text render should\n // be considered.\n // style.bind(ctx, this, prevEl);\n\n if (!textHelper.needDrawText(text, style)) {\n // The current el.style is not applied\n // and should not be used as cache.\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n return;\n }\n\n this.setTransform(ctx);\n textHelper.renderText(this, ctx, text, style, null, prevEl);\n this.restoreTransform(ctx);\n },\n getBoundingRect: function () {\n var style = this.style; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true);\n\n if (!this._rect) {\n var text = style.text;\n text != null ? text += '' : text = '';\n var rect = textContain.getBoundingRect(style.text + '', style.font, style.textAlign, style.textVerticalAlign, style.textPadding, style.textLineHeight, style.rich);\n rect.x += style.x || 0;\n rect.y += style.y || 0;\n\n if (textHelper.getStroke(style.textStroke, style.textStrokeWidth)) {\n var w = style.textStrokeWidth;\n rect.x -= w / 2;\n rect.y -= w / 2;\n rect.width += w;\n rect.height += w;\n }\n\n this._rect = rect;\n }\n\n return this._rect;\n }\n};\nzrUtil.inherits(Text, Displayable);\nvar _default = Text;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9UZXh0LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvVGV4dC5qcz83NmE1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBEaXNwbGF5YWJsZSA9IHJlcXVpcmUoXCIuL0Rpc3BsYXlhYmxlXCIpO1xuXG52YXIgenJVdGlsID0gcmVxdWlyZShcIi4uL2NvcmUvdXRpbFwiKTtcblxudmFyIHRleHRDb250YWluID0gcmVxdWlyZShcIi4uL2NvbnRhaW4vdGV4dFwiKTtcblxudmFyIHRleHRIZWxwZXIgPSByZXF1aXJlKFwiLi9oZWxwZXIvdGV4dFwiKTtcblxudmFyIF9jb25zdGFudCA9IHJlcXVpcmUoXCIuL2NvbnN0YW50XCIpO1xuXG52YXIgQ29udGV4dENhY2hlZEJ5ID0gX2NvbnN0YW50LkNvbnRleHRDYWNoZWRCeTtcblxuLyoqXG4gKiBAYWxpYXMgenJlbmRlci9ncmFwaGljL1RleHRcbiAqIEBleHRlbmRzIG1vZHVsZTp6cmVuZGVyL2dyYXBoaWMvRGlzcGxheWFibGVcbiAqIEBjb25zdHJ1Y3RvclxuICogQHBhcmFtIHtPYmplY3R9IG9wdHNcbiAqL1xudmFyIFRleHQgPSBmdW5jdGlvbiAob3B0cykge1xuICAvLyBqc2hpbnQgaWdub3JlOmxpbmVcbiAgRGlzcGxheWFibGUuY2FsbCh0aGlzLCBvcHRzKTtcbn07XG5cblRleHQucHJvdG90eXBlID0ge1xuICBjb25zdHJ1Y3RvcjogVGV4dCxcbiAgdHlwZTogJ3RleHQnLFxuICBicnVzaDogZnVuY3Rpb24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1xuICAgICAgICByZWN0LndpZHRoICs9IHc7XG4gICAgICAgIHJlY3QuaGVpZ2h0ICs9IHc7XG4gICAgICB9XG5cbiAgICAgIHRoaXMuX3JlY3QgPSByZWN0O1xuICAgIH1cblxuICAgIHJldHVybiB0aGlzLl9yZWN0O1xuICB9XG59O1xuenJVdGlsLmluaGVyaXRzKFRleHQsIERpc3BsYXlhYmxlKTtcbnZhciBfZGVmYXVsdCA9IFRleHQ7XG5tb2R1bGUuZXhwb3J0cyA9IF9kZWZhdWx0OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/Text.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/constant.js": +/*!******************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/constant.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var ContextCachedBy = {\n NONE: 0,\n STYLE_BIND: 1,\n PLAIN_TEXT: 2\n}; // Avoid confused with 0/false.\n\nvar WILL_BE_RESTORED = 9;\nexports.ContextCachedBy = ContextCachedBy;\nexports.WILL_BE_RESTORED = WILL_BE_RESTORED;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9jb25zdGFudC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL2NvbnN0YW50LmpzPzgyZWIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIENvbnRleHRDYWNoZWRCeSA9IHtcbiAgTk9ORTogMCxcbiAgU1RZTEVfQklORDogMSxcbiAgUExBSU5fVEVYVDogMlxufTsgLy8gQXZvaWQgY29uZnVzZWQgd2l0aCAwL2ZhbHNlLlxuXG52YXIgV0lMTF9CRV9SRVNUT1JFRCA9IDk7XG5leHBvcnRzLkNvbnRleHRDYWNoZWRCeSA9IENvbnRleHRDYWNoZWRCeTtcbmV4cG9ydHMuV0lMTF9CRV9SRVNUT1JFRCA9IFdJTExfQkVfUkVTVE9SRUQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/constant.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js": +/*!**********************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var env = __webpack_require__(/*! ../../core/env */ \"./node_modules/zrender/lib/core/env.js\");\n\n// Fix weird bug in some version of IE11 (like 11.0.9600.178**),\n// where exception \"unexpected call to method or property access\"\n// might be thrown when calling ctx.fill or ctx.stroke after a path\n// whose area size is zero is drawn and ctx.clip() is called and\n// shadowBlur is set. See #4572, #3112, #5777.\n// (e.g.,\n// ctx.moveTo(10, 10);\n// ctx.lineTo(20, 10);\n// ctx.closePath();\n// ctx.clip();\n// ctx.shadowBlur = 10;\n// ...\n// ctx.fill();\n// )\nvar shadowTemp = [['shadowBlur', 0], ['shadowColor', '#000'], ['shadowOffsetX', 0], ['shadowOffsetY', 0]];\n\nfunction _default(orignalBrush) {\n // version string can be: '11.0'\n return env.browser.ie && env.browser.version >= 11 ? function () {\n var clipPaths = this.__clipPaths;\n var style = this.style;\n var modified;\n\n if (clipPaths) {\n for (var i = 0; i < clipPaths.length; i++) {\n var clipPath = clipPaths[i];\n var shape = clipPath && clipPath.shape;\n var type = clipPath && clipPath.type;\n\n if (shape && (type === 'sector' && shape.startAngle === shape.endAngle || type === 'rect' && (!shape.width || !shape.height))) {\n for (var j = 0; j < shadowTemp.length; j++) {\n // It is save to put shadowTemp static, because shadowTemp\n // will be all modified each item brush called.\n shadowTemp[j][2] = style[shadowTemp[j][0]];\n style[shadowTemp[j][0]] = shadowTemp[j][1];\n }\n\n modified = true;\n break;\n }\n }\n }\n\n orignalBrush.apply(this, arguments);\n\n if (modified) {\n for (var j = 0; j < shadowTemp.length; j++) {\n style[shadowTemp[j][0]] = shadowTemp[j][2];\n }\n }\n } : orignalBrush;\n}\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvZml4Q2xpcFdpdGhTaGFkb3cuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9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GlmaWVkID0gdHJ1ZTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cblxuICAgIG9yaWduYWxCcnVzaC5hcHBseSh0aGlzLCBhcmd1bWVudHMpO1xuXG4gICAgaWYgKG1vZGlmaWVkKSB7XG4gICAgICBmb3IgKHZhciBqID0gMDsgaiA8IHNoYWRvd1RlbXAubGVuZ3RoOyBqKyspIHtcbiAgICAgICAgc3R5bGVbc2hhZG93VGVtcFtqXVswXV0gPSBzaGFkb3dUZW1wW2pdWzJdO1xuICAgICAgfVxuICAgIH1cbiAgfSA6IG9yaWduYWxCcnVzaDtcbn1cblxubW9kdWxlLmV4cG9ydHMgPSBfZGVmYXVsdDsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/fixShadow.js": +/*!**************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/fixShadow.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var SHADOW_PROPS = {\n 'shadowBlur': 1,\n 'shadowOffsetX': 1,\n 'shadowOffsetY': 1,\n 'textShadowBlur': 1,\n 'textShadowOffsetX': 1,\n 'textShadowOffsetY': 1,\n 'textBoxShadowBlur': 1,\n 'textBoxShadowOffsetX': 1,\n 'textBoxShadowOffsetY': 1\n};\n\nfunction _default(ctx, propName, value) {\n if (SHADOW_PROPS.hasOwnProperty(propName)) {\n return value *= ctx.dpr;\n }\n\n return value;\n}\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvZml4U2hhZG93LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvaGVscGVyL2ZpeFNoYWRvdy5qcz83ZDZkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBTSEFET1dfUFJPUFMgPSB7XG4gICdzaGFkb3dCbHVyJzogMSxcbiAgJ3NoYWRvd09mZnNldFgnOiAxLFxuICAnc2hhZG93T2Zmc2V0WSc6IDEsXG4gICd0ZXh0U2hhZG93Qmx1cic6IDEsXG4gICd0ZXh0U2hhZG93T2Zmc2V0WCc6IDEsXG4gICd0ZXh0U2hhZG93T2Zmc2V0WSc6IDEsXG4gICd0ZXh0Qm94U2hhZG93Qmx1cic6IDEsXG4gICd0ZXh0Qm94U2hhZG93T2Zmc2V0WCc6IDEsXG4gICd0ZXh0Qm94U2hhZG93T2Zmc2V0WSc6IDFcbn07XG5cbmZ1bmN0aW9uIF9kZWZhdWx0KGN0eCwgcHJvcE5hbWUsIHZhbHVlKSB7XG4gIGlmIChTSEFET1dfUFJPUFMuaGFzT3duUHJvcGVydHkocHJvcE5hbWUpKSB7XG4gICAgcmV0dXJuIHZhbHVlICo9IGN0eC5kcHI7XG4gIH1cblxuICByZXR1cm4gdmFsdWU7XG59XG5cbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/fixShadow.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/image.js": +/*!**********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/image.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var LRU = __webpack_require__(/*! ../../core/LRU */ \"./node_modules/zrender/lib/core/LRU.js\");\n\nvar globalImageCache = new LRU(50);\n/**\n * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc\n * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image\n */\n\nfunction findExistImage(newImageOrSrc) {\n if (typeof newImageOrSrc === 'string') {\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n return cachedImgObj && cachedImgObj.image;\n } else {\n return newImageOrSrc;\n }\n}\n/**\n * Caution: User should cache loaded images, but not just count on LRU.\n * Consider if required images more than LRU size, will dead loop occur?\n *\n * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc\n * @param {HTMLImageElement|HTMLCanvasElement|Canvas} image Existent image.\n * @param {module:zrender/Element} [hostEl] For calling `dirty`.\n * @param {Function} [cb] params: (image, cbPayload)\n * @param {Object} [cbPayload] Payload on cb calling.\n * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image\n */\n\n\nfunction createOrUpdateImage(newImageOrSrc, image, hostEl, cb, cbPayload) {\n if (!newImageOrSrc) {\n return image;\n } else if (typeof newImageOrSrc === 'string') {\n // Image should not be loaded repeatly.\n if (image && image.__zrImageSrc === newImageOrSrc || !hostEl) {\n return image;\n } // Only when there is no existent image or existent image src\n // is different, this method is responsible for load.\n\n\n var cachedImgObj = globalImageCache.get(newImageOrSrc);\n var pendingWrap = {\n hostEl: hostEl,\n cb: cb,\n cbPayload: cbPayload\n };\n\n if (cachedImgObj) {\n image = cachedImgObj.image;\n !isImageReady(image) && cachedImgObj.pending.push(pendingWrap);\n } else {\n image = new Image();\n image.onload = image.onerror = imageOnLoad;\n globalImageCache.put(newImageOrSrc, image.__cachedImgObj = {\n image: image,\n pending: [pendingWrap]\n });\n image.src = image.__zrImageSrc = newImageOrSrc;\n }\n\n return image;\n } // newImageOrSrc is an HTMLImageElement or HTMLCanvasElement or Canvas\n else {\n return newImageOrSrc;\n }\n}\n\nfunction imageOnLoad() {\n var cachedImgObj = this.__cachedImgObj;\n this.onload = this.onerror = this.__cachedImgObj = null;\n\n for (var i = 0; i < cachedImgObj.pending.length; i++) {\n var pendingWrap = cachedImgObj.pending[i];\n var cb = pendingWrap.cb;\n cb && cb(this, pendingWrap.cbPayload);\n pendingWrap.hostEl.dirty();\n }\n\n cachedImgObj.pending.length = 0;\n}\n\nfunction isImageReady(image) {\n return image && image.width && image.height;\n}\n\nexports.findExistImage = findExistImage;\nexports.createOrUpdateImage = createOrUpdateImage;\nexports.isImageReady = isImageReady;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvaW1hZ2UuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvaW1hZ2UuanM/NWU3NiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgTFJVID0gcmVxd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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/image.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/poly.js": +/*!*********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/poly.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var smoothSpline = __webpack_require__(/*! ./smoothSpline */ \"./node_modules/zrender/lib/graphic/helper/smoothSpline.js\");\n\nvar smoothBezier = __webpack_require__(/*! ./smoothBezier */ \"./node_modules/zrender/lib/graphic/helper/smoothBezier.js\");\n\nfunction buildPath(ctx, shape, closePath) {\n var points = shape.points;\n var smooth = shape.smooth;\n\n if (points && points.length >= 2) {\n if (smooth && smooth !== 'spline') {\n var controlPoints = smoothBezier(points, smooth, closePath, shape.smoothConstraint);\n ctx.moveTo(points[0][0], points[0][1]);\n var len = points.length;\n\n for (var i = 0; i < (closePath ? len : len - 1); i++) {\n var cp1 = controlPoints[i * 2];\n var cp2 = controlPoints[i * 2 + 1];\n var p = points[(i + 1) % len];\n ctx.bezierCurveTo(cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]);\n }\n } else {\n if (smooth === 'spline') {\n points = smoothSpline(points, closePath);\n }\n\n ctx.moveTo(points[0][0], points[0][1]);\n\n for (var i = 1, l = points.length; i < l; i++) {\n ctx.lineTo(points[i][0], points[i][1]);\n }\n }\n\n closePath && ctx.closePath();\n }\n}\n\nexports.buildPath = buildPath;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvcG9seS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxd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YgKHNtb290aCA9PT0gJ3NwbGluZScpIHtcbiAgICAgICAgcG9pbnRzID0gc21vb3RoU3BsaW5lKHBvaW50cywgY2xvc2VQYXRoKTtcbiAgICAgIH1cblxuICAgICAgY3R4Lm1vdmVUbyhwb2ludHNbMF1bMF0sIHBvaW50c1swXVsxXSk7XG5cbiAgICAgIGZvciAodmFyIGkgPSAxLCBsID0gcG9pbnRzLmxlbmd0aDsgaSA8IGw7IGkrKykge1xuICAgICAgICBjdHgubGluZVRvKHBvaW50c1tpXVswXSwgcG9pbnRzW2ldWzFdKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBjbG9zZVBhdGggJiYgY3R4LmNsb3NlUGF0aCgpO1xuICB9XG59XG5cbmV4cG9ydHMuYnVpbGRQYXRoID0gYnVpbGRQYXRoOyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/poly.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/roundRect.js": +/*!**************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/roundRect.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * @param {Object} ctx\n * @param {Object} shape\n * @param {number} shape.x\n * @param {number} shape.y\n * @param {number} shape.width\n * @param {number} shape.height\n * @param {number} shape.r\n */\nfunction buildPath(ctx, shape) {\n var x = shape.x;\n var y = shape.y;\n var width = shape.width;\n var height = shape.height;\n var r = shape.r;\n var r1;\n var r2;\n var r3;\n var r4; // Convert width and height to positive for better borderRadius\n\n if (width < 0) {\n x = x + width;\n width = -width;\n }\n\n if (height < 0) {\n y = y + height;\n height = -height;\n }\n\n if (typeof r === 'number') {\n r1 = r2 = r3 = r4 = r;\n } else if (r instanceof Array) {\n if (r.length === 1) {\n r1 = r2 = r3 = r4 = r[0];\n } else if (r.length === 2) {\n r1 = r3 = r[0];\n r2 = r4 = r[1];\n } else if (r.length === 3) {\n r1 = r[0];\n r2 = r4 = r[1];\n r3 = r[2];\n } else {\n r1 = r[0];\n r2 = r[1];\n r3 = r[2];\n r4 = r[3];\n }\n } else {\n r1 = r2 = r3 = r4 = 0;\n }\n\n var total;\n\n if (r1 + r2 > width) {\n total = r1 + r2;\n r1 *= width / total;\n r2 *= width / total;\n }\n\n if (r3 + r4 > width) {\n total = r3 + r4;\n r3 *= width / total;\n r4 *= width / total;\n }\n\n if (r2 + r3 > height) {\n total = r2 + r3;\n r2 *= height / total;\n r3 *= height / total;\n }\n\n if (r1 + r4 > height) {\n total = r1 + r4;\n r1 *= height / total;\n r4 *= height / total;\n }\n\n ctx.moveTo(x + r1, y);\n ctx.lineTo(x + width - r2, y);\n r2 !== 0 && ctx.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0);\n ctx.lineTo(x + width, y + height - r3);\n r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2);\n ctx.lineTo(x + r4, y + height);\n r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI);\n ctx.lineTo(x, y + r1);\n r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5);\n}\n\nexports.buildPath = buildPath;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXI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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/roundRect.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/smoothBezier.js": +/*!*****************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/smoothBezier.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var _vector = __webpack_require__(/*! ../../core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar v2Min = _vector.min;\nvar v2Max = _vector.max;\nvar v2Scale = _vector.scale;\nvar v2Distance = _vector.distance;\nvar v2Add = _vector.add;\nvar v2Clone = _vector.clone;\nvar v2Sub = _vector.sub;\n\n/**\n * 贝塞尔平滑曲线\n * @module zrender/shape/util/smoothBezier\n * @author pissang (https://www.github.com/pissang)\n * Kener (@Kener-林峰, kener.linfeng@gmail.com)\n * errorrik (errorrik@gmail.com)\n */\n\n/**\n * 贝塞尔平滑曲线\n * @alias module:zrender/shape/util/smoothBezier\n * @param {Array} points 线段顶点数组\n * @param {number} smooth 平滑等级, 0-1\n * @param {boolean} isLoop\n * @param {Array} constraint 将计算出来的控制点约束在一个包围盒内\n * 比如 [[0, 0], [100, 100]], 这个包围盒会与\n * 整个折线的包围盒做一个并集用来约束控制点。\n * @param {Array} 计算出来的控制点数组\n */\nfunction _default(points, smooth, isLoop, constraint) {\n var cps = [];\n var v = [];\n var v1 = [];\n var v2 = [];\n var prevPoint;\n var nextPoint;\n var min;\n var max;\n\n if (constraint) {\n min = [Infinity, Infinity];\n max = [-Infinity, -Infinity];\n\n for (var i = 0, len = points.length; i < len; i++) {\n v2Min(min, min, points[i]);\n v2Max(max, max, points[i]);\n } // 与指定的包围盒做并集\n\n\n v2Min(min, min, constraint[0]);\n v2Max(max, max, constraint[1]);\n }\n\n for (var i = 0, len = points.length; i < len; i++) {\n var point = points[i];\n\n if (isLoop) {\n prevPoint = points[i ? i - 1 : len - 1];\n nextPoint = points[(i + 1) % len];\n } else {\n if (i === 0 || i === len - 1) {\n cps.push(v2Clone(points[i]));\n continue;\n } else {\n prevPoint = points[i - 1];\n nextPoint = points[i + 1];\n }\n }\n\n v2Sub(v, nextPoint, prevPoint); // use degree to scale the handle length\n\n v2Scale(v, v, smooth);\n var d0 = v2Distance(point, prevPoint);\n var d1 = v2Distance(point, nextPoint);\n var sum = d0 + d1;\n\n if (sum !== 0) {\n d0 /= sum;\n d1 /= sum;\n }\n\n v2Scale(v1, v, -d0);\n v2Scale(v2, v, d1);\n var cp0 = v2Add([], point, v1);\n var cp1 = v2Add([], point, v2);\n\n if (constraint) {\n v2Max(cp0, cp0, min);\n v2Min(cp0, cp0, max);\n v2Max(cp1, cp1, min);\n v2Min(cp1, cp1, max);\n }\n\n cps.push(cp0);\n cps.push(cp1);\n }\n\n if (isLoop) {\n cps.push(cps.shift());\n }\n\n return cps;\n}\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvc21vb3RoQmV6aWVyLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvaGVscGVyL3Ntb290aEJlemllci5qcz85YzJjIl0sIn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lib/graphic/helper/smoothBezier.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/smoothSpline.js": +/*!*****************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/smoothSpline.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var _vector = __webpack_require__(/*! ../../core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar v2Distance = _vector.distance;\n\n/**\n * Catmull-Rom spline 插值折线\n * @module zrender/shape/util/smoothSpline\n * @author pissang (https://www.github.com/pissang)\n * Kener (@Kener-林峰, kener.linfeng@gmail.com)\n * errorrik (errorrik@gmail.com)\n */\n\n/**\n * @inner\n */\nfunction interpolate(p0, p1, p2, p3, t, t2, t3) {\n var v0 = (p2 - p0) * 0.5;\n var v1 = (p3 - p1) * 0.5;\n return (2 * (p1 - p2) + v0 + v1) * t3 + (-3 * (p1 - p2) - 2 * v0 - v1) * t2 + v0 * t + p1;\n}\n/**\n * @alias module:zrender/shape/util/smoothSpline\n * @param {Array} points 线段顶点数组\n * @param {boolean} isLoop\n * @return {Array}\n */\n\n\nfunction _default(points, isLoop) {\n var len = points.length;\n var ret = [];\n var distance = 0;\n\n for (var i = 1; i < len; i++) {\n distance += v2Distance(points[i - 1], points[i]);\n }\n\n var segs = distance / 2;\n segs = segs < len ? len : segs;\n\n for (var i = 0; i < segs; i++) {\n var pos = i / (segs - 1) * (isLoop ? len : len - 1);\n var idx = Math.floor(pos);\n var w = pos - idx;\n var p0;\n var p1 = points[idx % len];\n var p2;\n var p3;\n\n if (!isLoop) {\n p0 = points[idx === 0 ? idx : idx - 1];\n p2 = points[idx > len - 2 ? len - 1 : idx + 1];\n p3 = points[idx > len - 3 ? len - 1 : idx + 2];\n } else {\n p0 = points[(idx - 1 + len) % len];\n p2 = points[(idx + 1) % len];\n p3 = points[(idx + 2) % len];\n }\n\n var w2 = w * w;\n var w3 = w * w2;\n 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)]);\n }\n\n return ret;\n}\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvc21vb3RoU3BsaW5lLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvaGVscGVyL3Ntb290aFNwbGluZS5qcz82MjBiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBfdmVjdG9yID0gcmVxdWlyZShcIi4uLy4uL2NvcmUvdmVjdG9yXCIpO1xuXG52YXIgdjJEaXN0YW5jZSA9IF92ZWN0b3IuZGlzdGFuY2U7XG5cbi8qKlxuICogQ2F0bXVsbC1Sb20gc3BsaW5lIOaPkuWAvOaKmOe6v1xuICogQG1vZHVsZSB6cmVuZGVyL3NoYXBlL3V0aWwvc21vb3RoU3BsaW5lXG4gKiBAYXV0aG9yIHBpc3NhbmcgKGh0dHBzOi8vd3d3LmdpdGh1Yi5jb20vcGlzc2FuZylcbiAqICAgICAgICAgS2VuZXIgKEBLZW5lci3mnpfls7AsIGtlbmVyLmxpbmZlbmdAZ21haWwuY29tKVxuICogICAgICAgICBlcnJvcnJpayAoZXJyb3JyaWtAZ21haWwuY29tKVxuICovXG5cbi8qKlxuICogQGlubmVyXG4gKi9cbmZ1bmN0aW9uIGludGVycG9sYXRlKHAwLCBwMSwgcDIsIHAzLCB0LCB0MiwgdDMpIHtcbiAgdmFyIHYwID0gKHAyIC0gcDApICogMC41O1xuICB2YXIgdjEgPSAocDMgLSBwMSkgKiAwLjU7XG4gIHJldHVybiAoMiAqIChwMSAtIHAyKSArIHYwICsgdjEpICogdDMgKyAoLTMgKiAocDEgL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ourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/smoothSpline.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js": +/*!*********************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * Sub-pixel optimize for canvas rendering, prevent from blur\n * when rendering a thin vertical/horizontal line.\n */\nvar round = Math.round;\n/**\n * Sub pixel optimize line for canvas\n *\n * @param {Object} outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x1`, `x2`, `y1`, `y2` will be assigned in this method.\n * @param {Object} [inputShape]\n * @param {number} [inputShape.x1]\n * @param {number} [inputShape.y1]\n * @param {number} [inputShape.x2]\n * @param {number} [inputShape.y2]\n * @param {Object} [style]\n * @param {number} [style.lineWidth]\n */\n\nfunction subPixelOptimizeLine(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\n return;\n }\n\n var x1 = inputShape.x1;\n var x2 = inputShape.x2;\n var y1 = inputShape.y1;\n var y2 = inputShape.y2;\n\n if (round(x1 * 2) === round(x2 * 2)) {\n outputShape.x1 = outputShape.x2 = subPixelOptimize(x1, lineWidth, true);\n } else {\n outputShape.x1 = x1;\n outputShape.x2 = x2;\n }\n\n if (round(y1 * 2) === round(y2 * 2)) {\n outputShape.y1 = outputShape.y2 = subPixelOptimize(y1, lineWidth, true);\n } else {\n outputShape.y1 = y1;\n outputShape.y2 = y2;\n }\n}\n/**\n * Sub pixel optimize rect for canvas\n *\n * @param {Object} outputShape The modification will be performed on `outputShape`.\n * `outputShape` and `inputShape` can be the same object.\n * `outputShape` object can be used repeatly, because all of\n * the `x`, `y`, `width`, `height` will be assigned in this method.\n * @param {Object} [inputShape]\n * @param {number} [inputShape.x]\n * @param {number} [inputShape.y]\n * @param {number} [inputShape.width]\n * @param {number} [inputShape.height]\n * @param {Object} [style]\n * @param {number} [style.lineWidth]\n */\n\n\nfunction subPixelOptimizeRect(outputShape, inputShape, style) {\n var lineWidth = style && style.lineWidth;\n\n if (!inputShape || !lineWidth) {\n return;\n }\n\n var originX = inputShape.x;\n var originY = inputShape.y;\n var originWidth = inputShape.width;\n var originHeight = inputShape.height;\n outputShape.x = subPixelOptimize(originX, lineWidth, true);\n outputShape.y = subPixelOptimize(originY, lineWidth, true);\n outputShape.width = Math.max(subPixelOptimize(originX + originWidth, lineWidth, false) - outputShape.x, originWidth === 0 ? 0 : 1);\n outputShape.height = Math.max(subPixelOptimize(originY + originHeight, lineWidth, false) - outputShape.y, originHeight === 0 ? 0 : 1);\n}\n/**\n * Sub pixel optimize for canvas\n *\n * @param {number} position Coordinate, such as x, y\n * @param {number} lineWidth Should be nonnegative integer.\n * @param {boolean=} positiveOrNegative Default false (negative).\n * @return {number} Optimized position.\n */\n\n\nfunction subPixelOptimize(position, lineWidth, positiveOrNegative) {\n // Assure that (position + lineWidth / 2) is near integer edge,\n // otherwise line will be fuzzy in canvas.\n var doubledPosition = round(position * 2);\n return (doubledPosition + round(lineWidth)) % 2 === 0 ? doubledPosition / 2 : (doubledPosition + (positiveOrNegative ? 1 : -1)) / 2;\n}\n\nexports.subPixelOptimizeLine = subPixelOptimizeLine;\nexports.subPixelOptimizeRect = subPixelOptimizeRect;\nexports.subPixelOptimize = subPixelOptimize;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvc3ViUGl4ZWxPcHRpbWl6ZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL2hlbHBlci9zdWJQaXhlbE9wdGltaXplLmp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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/helper/text.js": +/*!*********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/helper/text.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var _util = __webpack_require__(/*! ../../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar retrieve2 = _util.retrieve2;\nvar retrieve3 = _util.retrieve3;\nvar each = _util.each;\nvar normalizeCssArray = _util.normalizeCssArray;\nvar isString = _util.isString;\nvar isObject = _util.isObject;\n\nvar textContain = __webpack_require__(/*! ../../contain/text */ \"./node_modules/zrender/lib/contain/text.js\");\n\nvar roundRectHelper = __webpack_require__(/*! ./roundRect */ \"./node_modules/zrender/lib/graphic/helper/roundRect.js\");\n\nvar imageHelper = __webpack_require__(/*! ./image */ \"./node_modules/zrender/lib/graphic/helper/image.js\");\n\nvar fixShadow = __webpack_require__(/*! ./fixShadow */ \"./node_modules/zrender/lib/graphic/helper/fixShadow.js\");\n\nvar _constant = __webpack_require__(/*! ../constant */ \"./node_modules/zrender/lib/graphic/constant.js\");\n\nvar ContextCachedBy = _constant.ContextCachedBy;\nvar WILL_BE_RESTORED = _constant.WILL_BE_RESTORED;\nvar DEFAULT_FONT = textContain.DEFAULT_FONT; // TODO: Have not support 'start', 'end' yet.\n\nvar VALID_TEXT_ALIGN = {\n left: 1,\n right: 1,\n center: 1\n};\nvar VALID_TEXT_VERTICAL_ALIGN = {\n top: 1,\n bottom: 1,\n middle: 1\n}; // Different from `STYLE_COMMON_PROPS` of `graphic/Style`,\n// the default value of shadowColor is `'transparent'`.\n\nvar SHADOW_STYLE_COMMON_PROPS = [['textShadowBlur', 'shadowBlur', 0], ['textShadowOffsetX', 'shadowOffsetX', 0], ['textShadowOffsetY', 'shadowOffsetY', 0], ['textShadowColor', 'shadowColor', 'transparent']];\n/**\n * @param {module:zrender/graphic/Style} style\n * @return {module:zrender/graphic/Style} The input style.\n */\n\nfunction normalizeTextStyle(style) {\n normalizeStyle(style);\n each(style.rich, normalizeStyle);\n return style;\n}\n\nfunction normalizeStyle(style) {\n if (style) {\n style.font = textContain.makeFont(style);\n var textAlign = style.textAlign;\n textAlign === 'middle' && (textAlign = 'center');\n style.textAlign = textAlign == null || VALID_TEXT_ALIGN[textAlign] ? textAlign : 'left'; // Compatible with textBaseline.\n\n var textVerticalAlign = style.textVerticalAlign || style.textBaseline;\n textVerticalAlign === 'center' && (textVerticalAlign = 'middle');\n style.textVerticalAlign = textVerticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[textVerticalAlign] ? textVerticalAlign : 'top';\n var textPadding = style.textPadding;\n\n if (textPadding) {\n style.textPadding = normalizeCssArray(style.textPadding);\n }\n }\n}\n/**\n * @param {CanvasRenderingContext2D} ctx\n * @param {string} text\n * @param {module:zrender/graphic/Style} style\n * @param {Object|boolean} [rect] {x, y, width, height}\n * If set false, rect text is not used.\n * @param {Element|module:zrender/graphic/helper/constant.WILL_BE_RESTORED} [prevEl] For ctx prop cache.\n */\n\n\nfunction renderText(hostEl, ctx, text, style, rect, prevEl) {\n style.rich ? renderRichText(hostEl, ctx, text, style, rect, prevEl) : renderPlainText(hostEl, ctx, text, style, rect, prevEl);\n} // Avoid setting to ctx according to prevEl if possible for\n// performance in scenarios of large amount text.\n\n\nfunction renderPlainText(hostEl, ctx, text, style, rect, prevEl) {\n 'use strict';\n\n var needDrawBg = needDrawBackground(style);\n var prevStyle;\n var checkCache = false;\n var cachedByMe = ctx.__attrCachedBy === ContextCachedBy.PLAIN_TEXT; // Only take and check cache for `Text` el, but not RectText.\n\n if (prevEl !== WILL_BE_RESTORED) {\n if (prevEl) {\n prevStyle = prevEl.style;\n checkCache = !needDrawBg && cachedByMe && prevStyle;\n } // Prevent from using cache in `Style::bind`, because of the case:\n // ctx property is modified by other properties than `Style::bind`\n // used, and Style::bind is called next.\n\n\n ctx.__attrCachedBy = needDrawBg ? ContextCachedBy.NONE : ContextCachedBy.PLAIN_TEXT;\n } // Since this will be restored, prevent from using these props to check cache in the next\n // entering of this method. But do not need to clear other cache like `Style::bind`.\n else if (cachedByMe) {\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n }\n\n var styleFont = style.font || DEFAULT_FONT; // PENDING\n // Only `Text` el set `font` and keep it (`RectText` will restore). So theoretically\n // we can make font cache on ctx, which can cache for text el that are discontinuous.\n // But layer save/restore needed to be considered.\n // if (styleFont !== ctx.__fontCache) {\n // ctx.font = styleFont;\n // if (prevEl !== WILL_BE_RESTORED) {\n // ctx.__fontCache = styleFont;\n // }\n // }\n\n if (!checkCache || styleFont !== (prevStyle.font || DEFAULT_FONT)) {\n ctx.font = styleFont;\n } // Use the final font from context-2d, because the final\n // font might not be the style.font when it is illegal.\n // But get `ctx.font` might be time consuming.\n\n\n var computedFont = hostEl.__computedFont;\n\n if (hostEl.__styleFont !== styleFont) {\n hostEl.__styleFont = styleFont;\n computedFont = hostEl.__computedFont = ctx.font;\n }\n\n var textPadding = style.textPadding;\n var textLineHeight = style.textLineHeight;\n var contentBlock = hostEl.__textCotentBlock;\n\n if (!contentBlock || hostEl.__dirtyText) {\n contentBlock = hostEl.__textCotentBlock = textContain.parsePlainText(text, computedFont, textPadding, textLineHeight, style.truncate);\n }\n\n var outerHeight = contentBlock.outerHeight;\n var textLines = contentBlock.lines;\n var lineHeight = contentBlock.lineHeight;\n var boxPos = getBoxPosition(outerHeight, style, rect);\n var baseX = boxPos.baseX;\n var baseY = boxPos.baseY;\n var textAlign = boxPos.textAlign || 'left';\n var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing.\n\n applyTextRotation(ctx, style, rect, baseX, baseY);\n var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);\n var textX = baseX;\n var textY = boxY;\n\n if (needDrawBg || textPadding) {\n // Consider performance, do not call getTextWidth util necessary.\n var textWidth = textContain.getWidth(text, computedFont);\n var outerWidth = textWidth;\n textPadding && (outerWidth += textPadding[1] + textPadding[3]);\n var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);\n needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);\n\n if (textPadding) {\n textX = getTextXForPadding(baseX, textAlign, textPadding);\n textY += textPadding[0];\n }\n } // Always set textAlign and textBase line, because it is difficute to calculate\n // textAlign from prevEl, and we dont sure whether textAlign will be reset if\n // font set happened.\n\n\n ctx.textAlign = textAlign; // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n\n ctx.textBaseline = 'middle'; // Set text opacity\n\n ctx.globalAlpha = style.opacity || 1; // Always set shadowBlur and shadowOffset to avoid leak from displayable.\n\n for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) {\n var propItem = SHADOW_STYLE_COMMON_PROPS[i];\n var styleProp = propItem[0];\n var ctxProp = propItem[1];\n var val = style[styleProp];\n\n if (!checkCache || val !== prevStyle[styleProp]) {\n ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]);\n }\n } // `textBaseline` is set as 'middle'.\n\n\n textY += lineHeight / 2;\n var textStrokeWidth = style.textStrokeWidth;\n var textStrokeWidthPrev = checkCache ? prevStyle.textStrokeWidth : null;\n var strokeWidthChanged = !checkCache || textStrokeWidth !== textStrokeWidthPrev;\n var strokeChanged = !checkCache || strokeWidthChanged || style.textStroke !== prevStyle.textStroke;\n var textStroke = getStroke(style.textStroke, textStrokeWidth);\n var textFill = getFill(style.textFill);\n\n if (textStroke) {\n if (strokeWidthChanged) {\n ctx.lineWidth = textStrokeWidth;\n }\n\n if (strokeChanged) {\n ctx.strokeStyle = textStroke;\n }\n }\n\n if (textFill) {\n if (!checkCache || style.textFill !== prevStyle.textFill) {\n ctx.fillStyle = textFill;\n }\n } // Optimize simply, in most cases only one line exists.\n\n\n if (textLines.length === 1) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[0], textX, textY);\n textFill && ctx.fillText(textLines[0], textX, textY);\n } else {\n for (var i = 0; i < textLines.length; i++) {\n // Fill after stroke so the outline will not cover the main part.\n textStroke && ctx.strokeText(textLines[i], textX, textY);\n textFill && ctx.fillText(textLines[i], textX, textY);\n textY += lineHeight;\n }\n }\n}\n\nfunction renderRichText(hostEl, ctx, text, style, rect, prevEl) {\n // Do not do cache for rich text because of the complexity.\n // But `RectText` this will be restored, do not need to clear other cache like `Style::bind`.\n if (prevEl !== WILL_BE_RESTORED) {\n ctx.__attrCachedBy = ContextCachedBy.NONE;\n }\n\n var contentBlock = hostEl.__textCotentBlock;\n\n if (!contentBlock || hostEl.__dirtyText) {\n contentBlock = hostEl.__textCotentBlock = textContain.parseRichText(text, style);\n }\n\n drawRichText(hostEl, ctx, contentBlock, style, rect);\n}\n\nfunction drawRichText(hostEl, ctx, contentBlock, style, rect) {\n var contentWidth = contentBlock.width;\n var outerWidth = contentBlock.outerWidth;\n var outerHeight = contentBlock.outerHeight;\n var textPadding = style.textPadding;\n var boxPos = getBoxPosition(outerHeight, style, rect);\n var baseX = boxPos.baseX;\n var baseY = boxPos.baseY;\n var textAlign = boxPos.textAlign;\n var textVerticalAlign = boxPos.textVerticalAlign; // Origin of textRotation should be the base point of text drawing.\n\n applyTextRotation(ctx, style, rect, baseX, baseY);\n var boxX = textContain.adjustTextX(baseX, outerWidth, textAlign);\n var boxY = textContain.adjustTextY(baseY, outerHeight, textVerticalAlign);\n var xLeft = boxX;\n var lineTop = boxY;\n\n if (textPadding) {\n xLeft += textPadding[3];\n lineTop += textPadding[0];\n }\n\n var xRight = xLeft + contentWidth;\n needDrawBackground(style) && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight);\n\n for (var i = 0; i < contentBlock.lines.length; i++) {\n var line = contentBlock.lines[i];\n var tokens = line.tokens;\n var tokenCount = tokens.length;\n var lineHeight = line.lineHeight;\n var usedWidth = line.width;\n var leftIndex = 0;\n var lineXLeft = xLeft;\n var lineXRight = xRight;\n var rightIndex = tokenCount - 1;\n var token;\n\n while (leftIndex < tokenCount && (token = tokens[leftIndex], !token.textAlign || token.textAlign === 'left')) {\n placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft, 'left');\n usedWidth -= token.width;\n lineXLeft += token.width;\n leftIndex++;\n }\n\n while (rightIndex >= 0 && (token = tokens[rightIndex], token.textAlign === 'right')) {\n placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXRight, 'right');\n usedWidth -= token.width;\n lineXRight -= token.width;\n rightIndex--;\n } // The other tokens are placed as textAlign 'center' if there is enough space.\n\n\n lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - usedWidth) / 2;\n\n while (leftIndex <= rightIndex) {\n token = tokens[leftIndex]; // Consider width specified by user, use 'center' rather than 'left'.\n\n placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center');\n lineXLeft += token.width;\n leftIndex++;\n }\n\n lineTop += lineHeight;\n }\n}\n\nfunction applyTextRotation(ctx, style, rect, x, y) {\n // textRotation only apply in RectText.\n if (rect && style.textRotation) {\n var origin = style.textOrigin;\n\n if (origin === 'center') {\n x = rect.width / 2 + rect.x;\n y = rect.height / 2 + rect.y;\n } else if (origin) {\n x = origin[0] + rect.x;\n y = origin[1] + rect.y;\n }\n\n ctx.translate(x, y); // Positive: anticlockwise\n\n ctx.rotate(-style.textRotation);\n ctx.translate(-x, -y);\n }\n}\n\nfunction placeToken(hostEl, ctx, token, style, lineHeight, lineTop, x, textAlign) {\n var tokenStyle = style.rich[token.styleName] || {};\n tokenStyle.text = token.text; // 'ctx.textBaseline' is always set as 'middle', for sake of\n // the bias of \"Microsoft YaHei\".\n\n var textVerticalAlign = token.textVerticalAlign;\n var y = lineTop + lineHeight / 2;\n\n if (textVerticalAlign === 'top') {\n y = lineTop + token.height / 2;\n } else if (textVerticalAlign === 'bottom') {\n y = lineTop + lineHeight - token.height / 2;\n }\n\n !token.isLineHolder && needDrawBackground(tokenStyle) && drawBackground(hostEl, ctx, tokenStyle, textAlign === 'right' ? x - token.width : textAlign === 'center' ? x - token.width / 2 : x, y - token.height / 2, token.width, token.height);\n var textPadding = token.textPadding;\n\n if (textPadding) {\n x = getTextXForPadding(x, textAlign, textPadding);\n y -= token.height / 2 - textPadding[2] - token.textHeight / 2;\n }\n\n setCtx(ctx, 'shadowBlur', retrieve3(tokenStyle.textShadowBlur, style.textShadowBlur, 0));\n setCtx(ctx, 'shadowColor', tokenStyle.textShadowColor || style.textShadowColor || 'transparent');\n setCtx(ctx, 'shadowOffsetX', retrieve3(tokenStyle.textShadowOffsetX, style.textShadowOffsetX, 0));\n setCtx(ctx, 'shadowOffsetY', retrieve3(tokenStyle.textShadowOffsetY, style.textShadowOffsetY, 0));\n setCtx(ctx, 'textAlign', textAlign); // Force baseline to be \"middle\". Otherwise, if using \"top\", the\n // text will offset downward a little bit in font \"Microsoft YaHei\".\n\n setCtx(ctx, 'textBaseline', 'middle');\n setCtx(ctx, 'font', token.font || DEFAULT_FONT);\n var textStroke = getStroke(tokenStyle.textStroke || style.textStroke, textStrokeWidth);\n var textFill = getFill(tokenStyle.textFill || style.textFill);\n var textStrokeWidth = retrieve2(tokenStyle.textStrokeWidth, style.textStrokeWidth); // Fill after stroke so the outline will not cover the main part.\n\n if (textStroke) {\n setCtx(ctx, 'lineWidth', textStrokeWidth);\n setCtx(ctx, 'strokeStyle', textStroke);\n ctx.strokeText(token.text, x, y);\n }\n\n if (textFill) {\n setCtx(ctx, 'fillStyle', textFill);\n ctx.fillText(token.text, x, y);\n }\n}\n\nfunction needDrawBackground(style) {\n return !!(style.textBackgroundColor || style.textBorderWidth && style.textBorderColor);\n} // style: {textBackgroundColor, textBorderWidth, textBorderColor, textBorderRadius, text}\n// shape: {x, y, width, height}\n\n\nfunction drawBackground(hostEl, ctx, style, x, y, width, height) {\n var textBackgroundColor = style.textBackgroundColor;\n var textBorderWidth = style.textBorderWidth;\n var textBorderColor = style.textBorderColor;\n var isPlainBg = isString(textBackgroundColor);\n setCtx(ctx, 'shadowBlur', style.textBoxShadowBlur || 0);\n setCtx(ctx, 'shadowColor', style.textBoxShadowColor || 'transparent');\n setCtx(ctx, 'shadowOffsetX', style.textBoxShadowOffsetX || 0);\n setCtx(ctx, 'shadowOffsetY', style.textBoxShadowOffsetY || 0);\n\n if (isPlainBg || textBorderWidth && textBorderColor) {\n ctx.beginPath();\n var textBorderRadius = style.textBorderRadius;\n\n if (!textBorderRadius) {\n ctx.rect(x, y, width, height);\n } else {\n roundRectHelper.buildPath(ctx, {\n x: x,\n y: y,\n width: width,\n height: height,\n r: textBorderRadius\n });\n }\n\n ctx.closePath();\n }\n\n if (isPlainBg) {\n setCtx(ctx, 'fillStyle', textBackgroundColor);\n\n if (style.fillOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.fillOpacity * style.opacity;\n ctx.fill();\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n ctx.fill();\n }\n } else if (isObject(textBackgroundColor)) {\n var image = textBackgroundColor.image;\n image = imageHelper.createOrUpdateImage(image, null, hostEl, onBgImageLoaded, textBackgroundColor);\n\n if (image && imageHelper.isImageReady(image)) {\n ctx.drawImage(image, x, y, width, height);\n }\n }\n\n if (textBorderWidth && textBorderColor) {\n setCtx(ctx, 'lineWidth', textBorderWidth);\n setCtx(ctx, 'strokeStyle', textBorderColor);\n\n if (style.strokeOpacity != null) {\n var originalGlobalAlpha = ctx.globalAlpha;\n ctx.globalAlpha = style.strokeOpacity * style.opacity;\n ctx.stroke();\n ctx.globalAlpha = originalGlobalAlpha;\n } else {\n ctx.stroke();\n }\n }\n}\n\nfunction onBgImageLoaded(image, textBackgroundColor) {\n // Replace image, so that `contain/text.js#parseRichText`\n // will get correct result in next tick.\n textBackgroundColor.image = image;\n}\n\nfunction getBoxPosition(blockHeiht, style, rect) {\n var baseX = style.x || 0;\n var baseY = style.y || 0;\n var textAlign = style.textAlign;\n var textVerticalAlign = style.textVerticalAlign; // Text position represented by coord\n\n if (rect) {\n var textPosition = style.textPosition;\n\n if (textPosition instanceof Array) {\n // Percent\n baseX = rect.x + parsePercent(textPosition[0], rect.width);\n baseY = rect.y + parsePercent(textPosition[1], rect.height);\n } else {\n var res = textContain.adjustTextPositionOnRect(textPosition, rect, style.textDistance);\n baseX = res.x;\n baseY = res.y; // Default align and baseline when has textPosition\n\n textAlign = textAlign || res.textAlign;\n textVerticalAlign = textVerticalAlign || res.textVerticalAlign;\n } // textOffset is only support in RectText, otherwise\n // we have to adjust boundingRect for textOffset.\n\n\n var textOffset = style.textOffset;\n\n if (textOffset) {\n baseX += textOffset[0];\n baseY += textOffset[1];\n }\n }\n\n return {\n baseX: baseX,\n baseY: baseY,\n textAlign: textAlign,\n textVerticalAlign: textVerticalAlign\n };\n}\n\nfunction setCtx(ctx, prop, value) {\n ctx[prop] = fixShadow(ctx, prop, value);\n return ctx[prop];\n}\n/**\n * @param {string} [stroke] If specified, do not check style.textStroke.\n * @param {string} [lineWidth] If specified, do not check style.textStroke.\n * @param {number} style\n */\n\n\nfunction getStroke(stroke, lineWidth) {\n return stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none' ? null // TODO pattern and gradient?\n : stroke.image || stroke.colorStops ? '#000' : stroke;\n}\n\nfunction getFill(fill) {\n return fill == null || fill === 'none' ? null // TODO pattern and gradient?\n : fill.image || fill.colorStops ? '#000' : fill;\n}\n\nfunction parsePercent(value, maxValue) {\n if (typeof value === 'string') {\n if (value.lastIndexOf('%') >= 0) {\n return parseFloat(value) / 100 * maxValue;\n }\n\n return parseFloat(value);\n }\n\n return value;\n}\n\nfunction getTextXForPadding(x, textAlign, textPadding) {\n return textAlign === 'right' ? x - textPadding[1] : textAlign === 'center' ? x + textPadding[3] / 2 - textPadding[1] / 2 : x + textPadding[3];\n}\n/**\n * @param {string} text\n * @param {module:zrender/Style} style\n * @return {boolean}\n */\n\n\nfunction needDrawText(text, style) {\n return text != null && (text || style.textBackgroundColor || style.textBorderWidth && style.textBorderColor || style.textPadding);\n}\n\nexports.normalizeTextStyle = normalizeTextStyle;\nexports.renderText = renderText;\nexports.getStroke = getStroke;\nexports.getFill = getFill;\nexports.needDrawText = needDrawText;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9oZWxwZXIvdGV4dC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL2hlbHBlci90ZXh0LmpzP2E3M2MiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIF91dGlsID0gcmVxdWlyZShcIi4uLy4uL2NvcmUvdXRpbFwiKTtcblxudmFyIHJldHJpZXZlMiA9IF91dGlsLnJldHJpZXZlMjtcbnZhciByZXRyaWV2ZTMgPSBfdXRpbC5yZXRyaWV2ZTM7XG52YXIgZWFjaCA9IF91dGlsLmVhY2g7XG52YXIgbm9ybWFsaXplQ3NzQXJyYXkgPSBfdXRpbC5ub3JtYWxpemVDc3NBcnJheTtcbnZhciBpc1N0cmluZyA9IF91dGlsLmlzU3RyaW5nO1xudmFyIGlzT2JqZWN0ID0gX3V0aWwuaXNPYmplY3Q7XG5cbnZhciB0ZXh0Q29udGFpbiA9IHJlcXVpcmUoXCIuLi8uLi9jb250YWluL3RleHRcIik7XG5cbnZhciByb3VuZFJlY3RIZWxwZXIgPSByZXF1aXJlKFwiLi9yb3VuZFJlY3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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/helper/text.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/mixin/RectText.js": +/*!************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/mixin/RectText.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var textHelper = __webpack_require__(/*! ../helper/text */ \"./node_modules/zrender/lib/graphic/helper/text.js\");\n\nvar BoundingRect = __webpack_require__(/*! ../../core/BoundingRect */ \"./node_modules/zrender/lib/core/BoundingRect.js\");\n\nvar _constant = __webpack_require__(/*! ../constant */ \"./node_modules/zrender/lib/graphic/constant.js\");\n\nvar WILL_BE_RESTORED = _constant.WILL_BE_RESTORED;\n\n/**\n * Mixin for drawing text in a element bounding rect\n * @module zrender/mixin/RectText\n */\nvar tmpRect = new BoundingRect();\n\nvar RectText = function () {};\n\nRectText.prototype = {\n constructor: RectText,\n\n /**\n * Draw text in a rect with specified position.\n * @param {CanvasRenderingContext2D} ctx\n * @param {Object} rect Displayable rect\n */\n drawRectText: function (ctx, rect) {\n var style = this.style;\n rect = style.textRect || rect; // Optimize, avoid normalize every time.\n\n this.__dirty && textHelper.normalizeTextStyle(style, true);\n var text = style.text; // Convert to string\n\n text != null && (text += '');\n\n if (!textHelper.needDrawText(text, style)) {\n return;\n } // FIXME\n // Do not provide prevEl to `textHelper.renderText` for ctx prop cache,\n // but use `ctx.save()` and `ctx.restore()`. Because the cache for rect\n // text propably break the cache for its host elements.\n\n\n ctx.save(); // Transform rect to view space\n\n var transform = this.transform;\n\n if (!style.transformText) {\n if (transform) {\n tmpRect.copy(rect);\n tmpRect.applyTransform(transform);\n rect = tmpRect;\n }\n } else {\n this.setTransform(ctx);\n } // transformText and textRotation can not be used at the same time.\n\n\n textHelper.renderText(this, ctx, text, style, rect, WILL_BE_RESTORED);\n ctx.restore();\n }\n};\nvar _default = RectText;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9taXhpbi9SZWN0VGV4dC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL21peGluL1JlY3RUZXh0LmpzPzllMmUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRleHRIZWxwZXIgPSByZXF1aXJlKFwiLi4vaGVscGVyL3RleHRcIik7XG5cbnZhciBCb3VuZGluZ1JlY3QgPSByZXF1aXJlKFwiLi4vLi4vY29yZS9Cb3VuZGluZ1JlY3RcIik7XG5cbnZhciBfY29uc3RhbnQgPSByZXF1aXJlKFwiLi4vY29uc3RhbnRcIik7XG5cbnZhciBXSUxMX0JFX1JFU1RP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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/mixin/RectText.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Arc.js": +/*!*******************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Arc.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\n/**\n * 圆弧\n * @module zrender/graphic/shape/Arc\n */\nvar _default = Path.extend({\n type: 'arc',\n shape: {\n cx: 0,\n cy: 0,\n r: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n clockwise: true\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var r = Math.max(shape.r, 0);\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var unitX = Math.cos(startAngle);\n var unitY = Math.sin(startAngle);\n ctx.moveTo(unitX * r + x, unitY * r + y);\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n }\n});\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf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PSBNYXRoLnNpbihzdGFydEFuZ2xlKTtcbiAgICBjdHgubW92ZVRvKHVuaXRYICogciArIHgsIHVuaXRZICogciArIHkpO1xuICAgIGN0eC5hcmMoeCwgeSwgciwgc3RhcnRBbmdsZSwgZW5kQW5nbGUsICFjbG9ja3dpc2UpO1xuICB9XG59KTtcblxubW9kdWxlLmV4cG9ydHMgPSBfZGVmYXVsdDsiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Arc.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/BezierCurve.js": +/*!***************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/BezierCurve.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar vec2 = __webpack_require__(/*! ../../core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar _curve = __webpack_require__(/*! ../../core/curve */ \"./node_modules/zrender/lib/core/curve.js\");\n\nvar quadraticSubdivide = _curve.quadraticSubdivide;\nvar cubicSubdivide = _curve.cubicSubdivide;\nvar quadraticAt = _curve.quadraticAt;\nvar cubicAt = _curve.cubicAt;\nvar quadraticDerivativeAt = _curve.quadraticDerivativeAt;\nvar cubicDerivativeAt = _curve.cubicDerivativeAt;\n\n/**\n * 贝塞尔曲线\n * @module zrender/shape/BezierCurve\n */\nvar out = [];\n\nfunction someVectorAt(shape, t, isTangent) {\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n\n if (cpx2 === null || cpy2 === null) {\n return [(isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t), (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t)];\n } else {\n return [(isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t), (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t)];\n }\n}\n\nvar _default = Path.extend({\n type: 'bezier-curve',\n shape: {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n cpx1: 0,\n cpy1: 0,\n // cpx2: 0,\n // cpy2: 0\n // Curve show percent, for animating\n percent: 1\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x1 = shape.x1;\n var y1 = shape.y1;\n var x2 = shape.x2;\n var y2 = shape.y2;\n var cpx1 = shape.cpx1;\n var cpy1 = shape.cpy1;\n var cpx2 = shape.cpx2;\n var cpy2 = shape.cpy2;\n var percent = shape.percent;\n\n if (percent === 0) {\n return;\n }\n\n ctx.moveTo(x1, y1);\n\n if (cpx2 == null || cpy2 == null) {\n if (percent < 1) {\n quadraticSubdivide(x1, cpx1, x2, percent, out);\n cpx1 = out[1];\n x2 = out[2];\n quadraticSubdivide(y1, cpy1, y2, percent, out);\n cpy1 = out[1];\n y2 = out[2];\n }\n\n ctx.quadraticCurveTo(cpx1, cpy1, x2, y2);\n } else {\n if (percent < 1) {\n cubicSubdivide(x1, cpx1, cpx2, x2, percent, out);\n cpx1 = out[1];\n cpx2 = out[2];\n x2 = out[3];\n cubicSubdivide(y1, cpy1, cpy2, y2, percent, out);\n cpy1 = out[1];\n cpy2 = out[2];\n y2 = out[3];\n }\n\n ctx.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, x2, y2);\n }\n },\n\n /**\n * Get point at percent\n * @param {number} t\n * @return {Array.}\n */\n pointAt: function (t) {\n return someVectorAt(this.shape, t, false);\n },\n\n /**\n * Get tangent at percent\n * @param {number} t\n * @return {Array.}\n */\n tangentAt: function (t) {\n var p = someVectorAt(this.shape, t, true);\n return vec2.normalize(p, p);\n }\n});\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9CZXppZXJDdXJ2ZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL3NoYXBlL0JlemllckN1cnZlLmpzP2FjMGYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIFBhdGggPSByZXF1aXJlKFwiLi4vUGF0aFwiKTtcblxudmFyIHZlYzIgPSByZXF1aXJlKFwiLi4vLi4vY29yZS92ZWN0b3JcIik7XG5cbnZhciBfY3VydmUgPSByZXF1aXJlKFwiLi4vLi4vY29yZS9jdXJ2ZVwiKTtcblxudmFyIHF1YWRyYXRpY1N1YmRpdmlkZSA9IF9jdXJ2ZS5xdWFkcmF0aWNTdWJkaXZpZGU7XG52YXIgY3ViaWNTdWJkaXZpZGUgPSBfY3VydmUuY3ViaWNTdWJkaXZpZGU7XG52YXIgcXVhZHJhdGljQXQgPSBfY3VydmUucXVhZHJhdGljQXQ7XG52YXIgY3ViaWNBdCA9IF9jdXJ2ZS5jdWJpY0F0O1xudmFyIHF1YWRyYXRpY0Rlcml2YXRpdmVBdCA9IF9jdXJ2ZS5xdWFkcmF0aWNEZXJpdmF0aXZlQXQ7XG52YXIgY3ViaWNEZXJpdmF0aXZlQXQgPSBfY3VydmUuY3ViaWNEZXJpdmF0aXZlQXQ7XG5cb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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/BezierCurve.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Circle.js": +/*!**********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Circle.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\n/**\n * 圆形\n * @module zrender/shape/Circle\n */\nvar _default = Path.extend({\n type: 'circle',\n shape: {\n cx: 0,\n cy: 0,\n r: 0\n },\n buildPath: function (ctx, shape, inBundle) {\n // Better stroking in ShapeBundle\n // Always do it may have performence issue ( fill may be 2x more cost)\n if (inBundle) {\n ctx.moveTo(shape.cx + shape.r, shape.cy);\n } // else {\n // if (ctx.allocate && !ctx.data.length) {\n // ctx.allocate(ctx.CMD_MEM_SIZE.A);\n // }\n // }\n // Better stroking in ShapeBundle\n // ctx.moveTo(shape.cx + shape.r, shape.cy);\n\n\n ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2, true);\n }\n});\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9DaXJjbGUuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9DaXJjbGUuanM/ZDlmYyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgUGF0aCA9IHJlcXVpcmUoXCIuLi9QYXRoXCIpO1xuXG4vKipcbiAqIOWchuW9olxuICogQG1vZHVsZSB6cmVuZGVyL3NoYXBlL0NpcmNsZVxuICovXG52YXIgX2RlZmF1bHQgPSBQYXRoLmV4dGVuZCh7XG4gIHR5cGU6ICdjaXJjbGUnLFxuICBzaGFwZToge1xuICAgIGN4OiAwLFxuICAgIGN5OiAwLFxuICAgIHI6IDBcbiAgfSxcbiAgYnVpbGRQYXRoOiBmdW5jdGlvbiAoY3R4LCBzaGFwZSwgaW5CdW5kbGUpIHtcbiAgICAvLyBCZXR0ZXIgc3Ryb2tpbmcgaW4gU2hhcGVCdW5kbGVcbiAgICAvLyBBbHdheXMgZG8gaXQgbWF5IGhhdmUgcGVyZm9ybWVuY2UgaXNzdWUgKCBmaWxsIG1heSBiZSAyeCBtb3JlIGNvc3QpXG4gICAgaWYgKGluQnVuZGxlKSB7XG4gICAgICBjdHgubW92ZVRvKHNoYXBlLmN4ICsgc2hhcGUuciwgc2hhcGUuY3kpO1xuICAgIH0gLy8gZWxzZSB7XG4gICAgLy8gICAgIGlmIChjdHguYWxsb2NhdGUgJiYgIWN0eC5kYXRhLmxlbmd0aCkge1xuICAgIC8vICAgICAgICAgY3R4LmFsbG9jYXRlKGN0eC5DTURfTUVNX1NJWkUuQSk7XG4gICAgLy8gICAgIH1cbiAgICAvLyB9XG4gICAgLy8gQmV0dGVyIHN0cm9raW5nIGluIFNoYXBlQnVuZGxlXG4gICAgLy8gY3R4Lm1vdmVUbyhzaGFwZS5jeCArIHNoYXBlLnIsIHNoYXBlLmN5KTtcblxuXG4gICAgY3R4LmFyYyhzaGFwZS5jeCwgc2hhcGUuY3ksIHNoYXBlLnIsIDAsIE1hdGguUEkgKiAyLCB0cnVlKTtcbiAgfVxufSk7XG5cbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Circle.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Line.js": +/*!********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Line.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar _subPixelOptimize = __webpack_require__(/*! ../helper/subPixelOptimize */ \"./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js\");\n\nvar subPixelOptimizeLine = _subPixelOptimize.subPixelOptimizeLine;\n\n/**\n * 直线\n * @module zrender/graphic/shape/Line\n */\n// Avoid create repeatly.\nvar subPixelOptimizeOutputShape = {};\n\nvar _default = Path.extend({\n type: 'line',\n shape: {\n // Start point\n x1: 0,\n y1: 0,\n // End point\n x2: 0,\n y2: 0,\n percent: 1\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n var x1;\n var y1;\n var x2;\n var y2;\n\n if (this.subPixelOptimize) {\n subPixelOptimizeLine(subPixelOptimizeOutputShape, shape, this.style);\n x1 = subPixelOptimizeOutputShape.x1;\n y1 = subPixelOptimizeOutputShape.y1;\n x2 = subPixelOptimizeOutputShape.x2;\n y2 = subPixelOptimizeOutputShape.y2;\n } else {\n x1 = shape.x1;\n y1 = shape.y1;\n x2 = shape.x2;\n y2 = shape.y2;\n }\n\n var percent = shape.percent;\n\n if (percent === 0) {\n return;\n }\n\n ctx.moveTo(x1, y1);\n\n if (percent < 1) {\n x2 = x1 * (1 - percent) + x2 * percent;\n y2 = y1 * (1 - percent) + y2 * percent;\n }\n\n ctx.lineTo(x2, y2);\n },\n\n /**\n * Get point at percent\n * @param {number} percent\n * @return {Array.}\n */\n pointAt: function (p) {\n var shape = this.shape;\n return [shape.x1 * (1 - p) + shape.x2 * p, shape.y1 * (1 - p) + shape.y2 * p];\n }\n});\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9MaW5lLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi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bm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Line.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Polygon.js": +/*!***********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Polygon.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar polyHelper = __webpack_require__(/*! ../helper/poly */ \"./node_modules/zrender/lib/graphic/helper/poly.js\");\n\n/**\n * 多边形\n * @module zrender/shape/Polygon\n */\nvar _default = Path.extend({\n type: 'polygon',\n shape: {\n points: null,\n smooth: false,\n smoothConstraint: null\n },\n buildPath: function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, true);\n }\n});\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9Qb2x5Z29uLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvc2hhcGUvUG9seWdvbi5qcz84N2IxIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoID0gcmVxdWlyZShcIi4uL1BhdGhcIik7XG5cbnZhciBwb2x5SGVscGVyID0gcmVxdWlyZShcIi4uL2hlbHBlci9wb2x5XCIpO1xuXG4vKipcbiAqIOWkmui+ueW9olxuICogQG1vZHVsZSB6cmVuZGVyL3NoYXBlL1BvbHlnb25cbiAqL1xudmFyIF9kZWZhdWx0ID0gUGF0aC5leHRlbmQoe1xuICB0eXBlOiAncG9seWdvbicsXG4gIHNoYXBlOiB7XG4gICAgcG9pbnRzOiBudWxsLFxuICAgIHNtb290aDogZmFsc2UsXG4gICAgc21vb3RoQ29uc3RyYWludDogbnVsbFxuICB9LFxuICBidWlsZFBhdGg6IGZ1bmN0aW9uIChjdHgsIHNoYXBlKSB7XG4gICAgcG9seUhlbHBlci5idWlsZFBhdGgoY3R4LCBzaGFwZSwgdHJ1ZSk7XG4gIH1cbn0pO1xuXG5tb2R1bGUuZXhwb3J0cyA9IF9kZWZhdWx0OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Polygon.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Polyline.js": +/*!************************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Polyline.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar polyHelper = __webpack_require__(/*! ../helper/poly */ \"./node_modules/zrender/lib/graphic/helper/poly.js\");\n\n/**\n * @module zrender/graphic/shape/Polyline\n */\nvar _default = Path.extend({\n type: 'polyline',\n shape: {\n points: null,\n smooth: false,\n smoothConstraint: null\n },\n style: {\n stroke: '#000',\n fill: null\n },\n buildPath: function (ctx, shape) {\n polyHelper.buildPath(ctx, shape, false);\n }\n});\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9Qb2x5bGluZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9ncmFwaGljL3NoYXBlL1BvbHlsaW5lLmpzP2Q0OTgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIFBhdGggPSByZXF1aXJlKFwiLi4vUGF0aFwiKTtcblxudmFyIHBvbHlIZWxwZXIgPSByZXF1aXJlKFwiLi4vaGVscGVyL3BvbHlcIik7XG5cbi8qKlxuICogQG1vZHVsZSB6cmVuZGVyL2dyYXBoaWMvc2hhcGUvUG9seWxpbmVcbiAqL1xudmFyIF9kZWZhdWx0ID0gUGF0aC5leHRlbmQoe1xuICB0eXBlOiAncG9seWxpbmUnLFxuICBzaGFwZToge1xuICAgIHBvaW50czogbnVsbCxcbiAgICBzbW9vdGg6IGZhbHNlLFxuICAgIHNtb290aENvbnN0cmFpbnQ6IG51bGxcbiAgfSxcbiAgc3R5bGU6IHtcbiAgICBzdHJva2U6ICcjMDAwJyxcbiAgICBmaWxsOiBudWxsXG4gIH0sXG4gIGJ1aWxkUGF0aDogZnVuY3Rpb24gKGN0eCwgc2hhcGUpIHtcbiAgICBwb2x5SGVscGVyLmJ1aWxkUGF0aChjdHgsIHNoYXBlLCBmYWxzZSk7XG4gIH1cbn0pO1xuXG5tb2R1bGUuZXhwb3J0cyA9IF9kZWZhdWx0OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Polyline.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Rect.js": +/*!********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Rect.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar roundRectHelper = __webpack_require__(/*! ../helper/roundRect */ \"./node_modules/zrender/lib/graphic/helper/roundRect.js\");\n\nvar _subPixelOptimize = __webpack_require__(/*! ../helper/subPixelOptimize */ \"./node_modules/zrender/lib/graphic/helper/subPixelOptimize.js\");\n\nvar subPixelOptimizeRect = _subPixelOptimize.subPixelOptimizeRect;\n\n/**\n * 矩形\n * @module zrender/graphic/shape/Rect\n */\n// Avoid create repeatly.\nvar subPixelOptimizeOutputShape = {};\n\nvar _default = Path.extend({\n type: 'rect',\n shape: {\n // 左上、右上、右下、左下角的半径依次为r1、r2、r3、r4\n // r缩写为1 相当于 [1, 1, 1, 1]\n // r缩写为[1] 相当于 [1, 1, 1, 1]\n // r缩写为[1, 2] 相当于 [1, 2, 1, 2]\n // r缩写为[1, 2, 3] 相当于 [1, 2, 3, 2]\n r: 0,\n x: 0,\n y: 0,\n width: 0,\n height: 0\n },\n buildPath: function (ctx, shape) {\n var x;\n var y;\n var width;\n var height;\n\n if (this.subPixelOptimize) {\n subPixelOptimizeRect(subPixelOptimizeOutputShape, shape, this.style);\n x = subPixelOptimizeOutputShape.x;\n y = subPixelOptimizeOutputShape.y;\n width = subPixelOptimizeOutputShape.width;\n height = subPixelOptimizeOutputShape.height;\n subPixelOptimizeOutputShape.r = shape.r;\n shape = subPixelOptimizeOutputShape;\n } else {\n x = shape.x;\n y = shape.y;\n width = shape.width;\n height = shape.height;\n }\n\n if (!shape.r) {\n ctx.rect(x, y, width, height);\n } else {\n roundRectHelper.buildPath(ctx, shape);\n }\n\n ctx.closePath();\n return;\n }\n});\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9SZWN0LmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvc2hhcGUvUmVjdC5qcz9jN2EyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoID0gcmVxdWlyZShcIi4uL1BhdGhcIik7XG5cbnZhciByb3VuZFJlY3RIZWxwZXIgPSByZXF1aXJlKFwiLi4vaGVscGVyL3JvdW5kUmVjdFwiKTtcblxudmFyIF9zdWJQaXhlbE9wdGltaXplID0gcmVxdWlyZShcIi4uL2hlbHBlci9zdWJQaXhlbE9wdGltaXplXCIpO1xuXG52YXIgc3ViUGl4ZWxPcHRpbWl6ZVJlY3QgP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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Rect.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Ring.js": +/*!********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Ring.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\n/**\n * 圆环\n * @module zrender/graphic/shape/Ring\n */\nvar _default = Path.extend({\n type: 'ring',\n shape: {\n cx: 0,\n cy: 0,\n r: 0,\n r0: 0\n },\n buildPath: function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var PI2 = Math.PI * 2;\n ctx.moveTo(x + shape.r, y);\n ctx.arc(x, y, shape.r, 0, PI2, false);\n ctx.moveTo(x + shape.r0, y);\n ctx.arc(x, y, shape.r0, 0, PI2, true);\n }\n});\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9SaW5nLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL3pyZW5kZXIvbGliL2dyYXBoaWMvc2hhcGUvUmluZy5qcz80NTczIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBQYXRoID0gcmVxdWlyZShcIi4uL1BhdGhcIik7XG5cbi8qKlxuICog5ZyG546vXG4gKiBAbW9kdWxlIHpyZW5kZXIvZ3JhcGhpYy9zaGFwZS9SaW5nXG4gKi9cbnZhciBfZGVmYXVsdCA9IFBhdGguZXh0ZW5kKHtcbiAgdHlwZTogJ3JpbmcnLFxuICBzaGFwZToge1xuICAgIGN4OiAwLFxuICAgIGN5OiAwLFxuICAgIHI6IDAsXG4gICAgcjA6IDBcbiAgfSxcbiAgYnVpbGRQYXRoOiBmdW5jdGlvbiAoY3R4LCBzaGFwZSkge1xuICAgIHZhciB4ID0gc2hhcGUuY3g7XG4gICAgdmFyIHkgPSBzaGFwZS5jeTtcbiAgICB2YXIgUEkyID0gTWF0aC5QSSAqIDI7XG4gICAgY3R4Lm1vdmVUbyh4ICsgc2hhcGUuciwgeSk7XG4gICAgY3R4LmFyYyh4LCB5LCBzaGFwZS5yLCAwLCBQSTIsIGZhbHNlKTtcbiAgICBjdHgubW92ZVRvKHggKyBzaGFwZS5yMCwgeSk7XG4gICAgY3R4LmFyYyh4LCB5LCBzaGFwZS5yMCwgMCwgUEkyLCB0cnVlKTtcbiAgfVxufSk7XG5cbm1vZHVsZS5leHBvcnRzID0gX2RlZmF1bHQ7Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Ring.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/graphic/shape/Sector.js": +/*!**********************************************************!*\ + !*** ./node_modules/zrender/lib/graphic/shape/Sector.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ../Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar fixClipWithShadow = __webpack_require__(/*! ../helper/fixClipWithShadow */ \"./node_modules/zrender/lib/graphic/helper/fixClipWithShadow.js\");\n\n/**\n * 扇形\n * @module zrender/graphic/shape/Sector\n */\nvar _default = Path.extend({\n type: 'sector',\n shape: {\n cx: 0,\n cy: 0,\n r0: 0,\n r: 0,\n startAngle: 0,\n endAngle: Math.PI * 2,\n clockwise: true\n },\n brush: fixClipWithShadow(Path.prototype.brush),\n buildPath: function (ctx, shape) {\n var x = shape.cx;\n var y = shape.cy;\n var r0 = Math.max(shape.r0 || 0, 0);\n var r = Math.max(shape.r, 0);\n var startAngle = shape.startAngle;\n var endAngle = shape.endAngle;\n var clockwise = shape.clockwise;\n var unitX = Math.cos(startAngle);\n var unitY = Math.sin(startAngle);\n ctx.moveTo(unitX * r0 + x, unitY * r0 + y);\n ctx.lineTo(unitX * r + x, unitY * r + y);\n ctx.arc(x, y, r, startAngle, endAngle, !clockwise);\n ctx.lineTo(Math.cos(endAngle) * r0 + x, Math.sin(endAngle) * r0 + y);\n\n if (r0 !== 0) {\n ctx.arc(x, y, r0, endAngle, startAngle, clockwise);\n }\n\n ctx.closePath();\n }\n});\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9TZWN0b3IuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvZ3JhcGhpYy9zaGFwZS9TZWN0b3IuanM/NGFhMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgUGF0aCA9IHJlcXVpcmUoXCIuLi9QYXRoXCIpO1xuXG52YXIgZml4Q2xpcFdpdGhTaGFkb3cgPSByZXF1aXJlKFwiLi4v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sICFjbG9ja3dpc2UpO1xuICAgIGN0eC5saW5lVG8oTWF0aC5jb3MoZW5kQW5nbGUpICogcjAgKyB4LCBNYXRoLnNpbihlbmRBbmdsZSkgKiByMCArIHkpO1xuXG4gICAgaWYgKHIwICE9PSAwKSB7XG4gICAgICBjdHguYXJjKHgsIHksIHIwLCBlbmRBbmdsZSwgc3RhcnRBbmdsZSwgY2xvY2t3aXNlKTtcbiAgICB9XG5cbiAgICBjdHguY2xvc2VQYXRoKCk7XG4gIH1cbn0pO1xuXG5tb2R1bGUuZXhwb3J0cyA9IF9kZWZhdWx0OyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/graphic/shape/Sector.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/mixin/Animatable.js": +/*!******************************************************!*\ + !*** ./node_modules/zrender/lib/mixin/Animatable.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Animator = __webpack_require__(/*! ../animation/Animator */ \"./node_modules/zrender/lib/animation/Animator.js\");\n\nvar log = __webpack_require__(/*! ../core/log */ \"./node_modules/zrender/lib/core/log.js\");\n\nvar _util = __webpack_require__(/*! ../core/util */ \"./node_modules/zrender/lib/core/util.js\");\n\nvar isString = _util.isString;\nvar isFunction = _util.isFunction;\nvar isObject = _util.isObject;\nvar isArrayLike = _util.isArrayLike;\nvar indexOf = _util.indexOf;\n\n/**\n * @alias modue:zrender/mixin/Animatable\n * @constructor\n */\nvar Animatable = function () {\n /**\n * @type {Array.}\n * @readOnly\n */\n this.animators = [];\n};\n\nAnimatable.prototype = {\n constructor: Animatable,\n\n /**\n * 动画\n *\n * @param {string} path The path to fetch value from object, like 'a.b.c'.\n * @param {boolean} [loop] Whether to loop animation.\n * @return {module:zrender/animation/Animator}\n * @example:\n * el.animate('style', false)\n * .when(1000, {x: 10} )\n * .done(function(){ // Animation done })\n * .start()\n */\n animate: function (path, loop) {\n var target;\n var animatingShape = false;\n var el = this;\n var zr = this.__zr;\n\n if (path) {\n var pathSplitted = path.split('.');\n var prop = el; // If animating shape\n\n animatingShape = pathSplitted[0] === 'shape';\n\n for (var i = 0, l = pathSplitted.length; i < l; i++) {\n if (!prop) {\n continue;\n }\n\n prop = prop[pathSplitted[i]];\n }\n\n if (prop) {\n target = prop;\n }\n } else {\n target = el;\n }\n\n if (!target) {\n log('Property \"' + path + '\" is not existed in element ' + el.id);\n return;\n }\n\n var animators = el.animators;\n var animator = new Animator(target, loop);\n animator.during(function (target) {\n el.dirty(animatingShape);\n }).done(function () {\n // FIXME Animator will not be removed if use `Animator#stop` to stop animation\n animators.splice(indexOf(animators, animator), 1);\n });\n animators.push(animator); // If animate after added to the zrender\n\n if (zr) {\n zr.animation.addAnimator(animator);\n }\n\n return animator;\n },\n\n /**\n * 停止动画\n * @param {boolean} forwardToLast If move to last frame before stop\n */\n stopAnimation: function (forwardToLast) {\n var animators = this.animators;\n var len = animators.length;\n\n for (var i = 0; i < len; i++) {\n animators[i].stop(forwardToLast);\n }\n\n animators.length = 0;\n return this;\n },\n\n /**\n * Caution: this method will stop previous animation.\n * So do not use this method to one element twice before\n * animation starts, unless you know what you are doing.\n * @param {Object} target\n * @param {number} [time=500] Time in ms\n * @param {string} [easing='linear']\n * @param {number} [delay=0]\n * @param {Function} [callback]\n * @param {Function} [forceAnimate] Prevent stop animation and callback\n * immediently when target values are the same as current values.\n *\n * @example\n * // Animate position\n * el.animateTo({\n * position: [10, 10]\n * }, function () { // done })\n *\n * // Animate shape, style and position in 100ms, delayed 100ms, with cubicOut easing\n * el.animateTo({\n * shape: {\n * width: 500\n * },\n * style: {\n * fill: 'red'\n * }\n * position: [10, 10]\n * }, 100, 100, 'cubicOut', function () { // done })\n */\n // TODO Return animation key\n animateTo: function (target, time, delay, easing, callback, forceAnimate) {\n animateTo(this, target, time, delay, easing, callback, forceAnimate);\n },\n\n /**\n * Animate from the target state to current state.\n * The params and the return value are the same as `this.animateTo`.\n */\n animateFrom: function (target, time, delay, easing, callback, forceAnimate) {\n animateTo(this, target, time, delay, easing, callback, forceAnimate, true);\n }\n};\n\nfunction animateTo(animatable, target, time, delay, easing, callback, forceAnimate, reverse) {\n // animateTo(target, time, easing, callback);\n if (isString(delay)) {\n callback = easing;\n easing = delay;\n delay = 0;\n } // animateTo(target, time, delay, callback);\n else if (isFunction(easing)) {\n callback = easing;\n easing = 'linear';\n delay = 0;\n } // animateTo(target, time, callback);\n else if (isFunction(delay)) {\n callback = delay;\n delay = 0;\n } // animateTo(target, callback)\n else if (isFunction(time)) {\n callback = time;\n time = 500;\n } // animateTo(target)\n else if (!time) {\n time = 500;\n } // Stop all previous animations\n\n\n animatable.stopAnimation();\n animateToShallow(animatable, '', animatable, target, time, delay, reverse); // Animators may be removed immediately after start\n // if there is nothing to animate\n\n var animators = animatable.animators.slice();\n var count = animators.length;\n\n function done() {\n count--;\n\n if (!count) {\n callback && callback();\n }\n } // No animators. This should be checked before animators[i].start(),\n // because 'done' may be executed immediately if no need to animate.\n\n\n if (!count) {\n callback && callback();\n } // Start after all animators created\n // Incase any animator is done immediately when all animation properties are not changed\n\n\n for (var i = 0; i < animators.length; i++) {\n animators[i].done(done).start(easing, forceAnimate);\n }\n}\n/**\n * @param {string} path=''\n * @param {Object} source=animatable\n * @param {Object} target\n * @param {number} [time=500]\n * @param {number} [delay=0]\n * @param {boolean} [reverse] If `true`, animate\n * from the `target` to current state.\n *\n * @example\n * // Animate position\n * el._animateToShallow({\n * position: [10, 10]\n * })\n *\n * // Animate shape, style and position in 100ms, delayed 100ms\n * el._animateToShallow({\n * shape: {\n * width: 500\n * },\n * style: {\n * fill: 'red'\n * }\n * position: [10, 10]\n * }, 100, 100)\n */\n\n\nfunction animateToShallow(animatable, path, source, target, time, delay, reverse) {\n var objShallow = {};\n var propertyCount = 0;\n\n for (var name in target) {\n if (!target.hasOwnProperty(name)) {\n continue;\n }\n\n if (source[name] != null) {\n if (isObject(target[name]) && !isArrayLike(target[name])) {\n animateToShallow(animatable, path ? path + '.' + name : name, source[name], target[name], time, delay, reverse);\n } else {\n if (reverse) {\n objShallow[name] = source[name];\n setAttrByPath(animatable, path, name, target[name]);\n } else {\n objShallow[name] = target[name];\n }\n\n propertyCount++;\n }\n } else if (target[name] != null && !reverse) {\n setAttrByPath(animatable, path, name, target[name]);\n }\n }\n\n if (propertyCount > 0) {\n animatable.animate(path, false).when(time == null ? 500 : time, objShallow).delay(delay || 0);\n }\n}\n\nfunction setAttrByPath(el, path, name, value) {\n // Attr directly if not has property\n // FIXME, if some property not needed for element ?\n if (!path) {\n el.attr(name, value);\n } else {\n // Only support set shape or style\n var props = {};\n props[path] = {};\n props[path][name] = value;\n el.attr(props);\n }\n}\n\nvar _default = Animatable;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvbWl4aW4vQW5pbWF0YWJsZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9taXhpbi9BbmltYXRhYmxlLmpzP2JkNmIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIEFuaW1hdG9yID0gcmVxdWlyZShcIi4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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/mixin/Animatable.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/mixin/Eventful.js": +/*!****************************************************!*\ + !*** ./node_modules/zrender/lib/mixin/Eventful.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/**\n * Event Mixin\n * @module zrender/mixin/Eventful\n * @author Kener (@Kener-林峰, kener.linfeng@gmail.com)\n * pissang (https://www.github.com/pissang)\n */\nvar arrySlice = Array.prototype.slice;\n/**\n * Event dispatcher.\n *\n * @alias module:zrender/mixin/Eventful\n * @constructor\n * @param {Object} [eventProcessor] The object eventProcessor is the scope when\n * `eventProcessor.xxx` called.\n * @param {Function} [eventProcessor.normalizeQuery]\n * param: {string|Object} Raw query.\n * return: {string|Object} Normalized query.\n * @param {Function} [eventProcessor.filter] Event will be dispatched only\n * if it returns `true`.\n * param: {string} eventType\n * param: {string|Object} query\n * return: {boolean}\n * @param {Function} [eventProcessor.afterTrigger] Call after all handlers called.\n * param: {string} eventType\n */\n\nvar Eventful = function (eventProcessor) {\n this._$handlers = {};\n this._$eventProcessor = eventProcessor;\n};\n\nEventful.prototype = {\n constructor: Eventful,\n\n /**\n * The handler can only be triggered once, then removed.\n *\n * @param {string} event The event name.\n * @param {string|Object} [query] Condition used on event filter.\n * @param {Function} handler The event handler.\n * @param {Object} context\n */\n one: function (event, query, handler, context) {\n return on(this, event, query, handler, context, true);\n },\n\n /**\n * Bind a handler.\n *\n * @param {string} event The event name.\n * @param {string|Object} [query] Condition used on event filter.\n * @param {Function} handler The event handler.\n * @param {Object} [context]\n */\n on: function (event, query, handler, context) {\n return on(this, event, query, handler, context, false);\n },\n\n /**\n * Whether any handler has bound.\n *\n * @param {string} event\n * @return {boolean}\n */\n isSilent: function (event) {\n var _h = this._$handlers;\n return !_h[event] || !_h[event].length;\n },\n\n /**\n * Unbind a event.\n *\n * @param {string} event The event name.\n * @param {Function} [handler] The event handler.\n */\n off: function (event, handler) {\n var _h = this._$handlers;\n\n if (!event) {\n this._$handlers = {};\n return this;\n }\n\n if (handler) {\n if (_h[event]) {\n var newList = [];\n\n for (var i = 0, l = _h[event].length; i < l; i++) {\n if (_h[event][i].h !== handler) {\n newList.push(_h[event][i]);\n }\n }\n\n _h[event] = newList;\n }\n\n if (_h[event] && _h[event].length === 0) {\n delete _h[event];\n }\n } else {\n delete _h[event];\n }\n\n return this;\n },\n\n /**\n * Dispatch a event.\n *\n * @param {string} type The event name.\n */\n trigger: function (type) {\n var _h = this._$handlers[type];\n var eventProcessor = this._$eventProcessor;\n\n if (_h) {\n var args = arguments;\n var argLen = args.length;\n\n if (argLen > 3) {\n args = arrySlice.call(args, 1);\n }\n\n var len = _h.length;\n\n for (var i = 0; i < len;) {\n var hItem = _h[i];\n\n if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) {\n i++;\n continue;\n } // Optimize advise from backbone\n\n\n switch (argLen) {\n case 1:\n hItem.h.call(hItem.ctx);\n break;\n\n case 2:\n hItem.h.call(hItem.ctx, args[1]);\n break;\n\n case 3:\n hItem.h.call(hItem.ctx, args[1], args[2]);\n break;\n\n default:\n // have more than 2 given arguments\n hItem.h.apply(hItem.ctx, args);\n break;\n }\n\n if (hItem.one) {\n _h.splice(i, 1);\n\n len--;\n } else {\n i++;\n }\n }\n }\n\n eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type);\n return this;\n },\n\n /**\n * Dispatch a event with context, which is specified at the last parameter.\n *\n * @param {string} type The event name.\n */\n triggerWithContext: function (type) {\n var _h = this._$handlers[type];\n var eventProcessor = this._$eventProcessor;\n\n if (_h) {\n var args = arguments;\n var argLen = args.length;\n\n if (argLen > 4) {\n args = arrySlice.call(args, 1, args.length - 1);\n }\n\n var ctx = args[args.length - 1];\n var len = _h.length;\n\n for (var i = 0; i < len;) {\n var hItem = _h[i];\n\n if (eventProcessor && eventProcessor.filter && hItem.query != null && !eventProcessor.filter(type, hItem.query)) {\n i++;\n continue;\n } // Optimize advise from backbone\n\n\n switch (argLen) {\n case 1:\n hItem.h.call(ctx);\n break;\n\n case 2:\n hItem.h.call(ctx, args[1]);\n break;\n\n case 3:\n hItem.h.call(ctx, args[1], args[2]);\n break;\n\n default:\n // have more than 2 given arguments\n hItem.h.apply(ctx, args);\n break;\n }\n\n if (hItem.one) {\n _h.splice(i, 1);\n\n len--;\n } else {\n i++;\n }\n }\n }\n\n eventProcessor && eventProcessor.afterTrigger && eventProcessor.afterTrigger(type);\n return this;\n }\n};\n\nfunction normalizeQuery(host, query) {\n var eventProcessor = host._$eventProcessor;\n\n if (query != null && eventProcessor && eventProcessor.normalizeQuery) {\n query = eventProcessor.normalizeQuery(query);\n }\n\n return query;\n}\n\nfunction on(eventful, event, query, handler, context, isOnce) {\n var _h = eventful._$handlers;\n\n if (typeof query === 'function') {\n context = handler;\n handler = query;\n query = null;\n }\n\n if (!handler || !event) {\n return eventful;\n }\n\n query = normalizeQuery(eventful, query);\n\n if (!_h[event]) {\n _h[event] = [];\n }\n\n for (var i = 0; i < _h[event].length; i++) {\n if (_h[event][i].h === handler) {\n return eventful;\n }\n }\n\n var wrap = {\n h: handler,\n one: isOnce,\n query: query,\n ctx: context || eventful,\n // FIXME\n // Do not publish this feature util it is proved that it makes sense.\n callAtLast: handler.zrEventfulCallAtLast\n };\n var lastIndex = _h[event].length - 1;\n var lastWrap = _h[event][lastIndex];\n lastWrap && lastWrap.callAtLast ? _h[event].splice(lastIndex, 0, wrap) : _h[event].push(wrap);\n return eventful;\n} // ----------------------\n// The events in zrender\n// ----------------------\n\n/**\n * @event module:zrender/mixin/Eventful#onclick\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmouseover\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmouseout\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmousemove\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmousewheel\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmousedown\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#onmouseup\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondrag\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragstart\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragend\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragenter\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragleave\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondragover\n * @type {Function}\n * @default null\n */\n\n/**\n * @event module:zrender/mixin/Eventful#ondrop\n * @type {Function}\n * @default null\n */\n\n\nvar _default = Eventful;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvbWl4aW4vRXZlbnRmdWwuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvbWl4aW4vRXZlbnRmdWwuanM/MWZhYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEV2ZW50IE1peGluXG4gKiBAbW9kdWxlIHpyZW5kZXIvbWl4aW4vRXZlbnRmdWx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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/mixin/Eventful.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/mixin/Transformable.js": +/*!*********************************************************!*\ + !*** ./node_modules/zrender/lib/mixin/Transformable.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var matrix = __webpack_require__(/*! ../core/matrix */ \"./node_modules/zrender/lib/core/matrix.js\");\n\nvar vector = __webpack_require__(/*! ../core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\n/**\n * 提供变换扩展\n * @module zrender/mixin/Transformable\n * @author pissang (https://www.github.com/pissang)\n */\nvar mIdentity = matrix.identity;\nvar EPSILON = 5e-5;\n\nfunction isNotAroundZero(val) {\n return val > EPSILON || val < -EPSILON;\n}\n/**\n * @alias module:zrender/mixin/Transformable\n * @constructor\n */\n\n\nvar Transformable = function (opts) {\n opts = opts || {}; // If there are no given position, rotation, scale\n\n if (!opts.position) {\n /**\n * 平移\n * @type {Array.}\n * @default [0, 0]\n */\n this.position = [0, 0];\n }\n\n if (opts.rotation == null) {\n /**\n * 旋转\n * @type {Array.}\n * @default 0\n */\n this.rotation = 0;\n }\n\n if (!opts.scale) {\n /**\n * 缩放\n * @type {Array.}\n * @default [1, 1]\n */\n this.scale = [1, 1];\n }\n /**\n * 旋转和缩放的原点\n * @type {Array.}\n * @default null\n */\n\n\n this.origin = this.origin || null;\n};\n\nvar transformableProto = Transformable.prototype;\ntransformableProto.transform = null;\n/**\n * 判断是否需要有坐标变换\n * 如果有坐标变换, 则从position, rotation, scale以及父节点的transform计算出自身的transform矩阵\n */\n\ntransformableProto.needLocalTransform = function () {\n return isNotAroundZero(this.rotation) || isNotAroundZero(this.position[0]) || isNotAroundZero(this.position[1]) || isNotAroundZero(this.scale[0] - 1) || isNotAroundZero(this.scale[1] - 1);\n};\n\nvar scaleTmp = [];\n\ntransformableProto.updateTransform = function () {\n var parent = this.parent;\n var parentHasTransform = parent && parent.transform;\n var needLocalTransform = this.needLocalTransform();\n var m = this.transform;\n\n if (!(needLocalTransform || parentHasTransform)) {\n m && mIdentity(m);\n return;\n }\n\n m = m || matrix.create();\n\n if (needLocalTransform) {\n this.getLocalTransform(m);\n } else {\n mIdentity(m);\n } // 应用父节点变换\n\n\n if (parentHasTransform) {\n if (needLocalTransform) {\n matrix.mul(m, parent.transform, m);\n } else {\n matrix.copy(m, parent.transform);\n }\n } // 保存这个变换矩阵\n\n\n this.transform = m;\n var globalScaleRatio = this.globalScaleRatio;\n\n if (globalScaleRatio != null && globalScaleRatio !== 1) {\n this.getGlobalScale(scaleTmp);\n var relX = scaleTmp[0] < 0 ? -1 : 1;\n var relY = scaleTmp[1] < 0 ? -1 : 1;\n var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0;\n var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0;\n m[0] *= sx;\n m[1] *= sx;\n m[2] *= sy;\n m[3] *= sy;\n }\n\n this.invTransform = this.invTransform || matrix.create();\n matrix.invert(this.invTransform, m);\n};\n\ntransformableProto.getLocalTransform = function (m) {\n return Transformable.getLocalTransform(this, m);\n};\n/**\n * 将自己的transform应用到context上\n * @param {CanvasRenderingContext2D} ctx\n */\n\n\ntransformableProto.setTransform = function (ctx) {\n var m = this.transform;\n var dpr = ctx.dpr || 1;\n\n if (m) {\n ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]);\n } else {\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n }\n};\n\ntransformableProto.restoreTransform = function (ctx) {\n var dpr = ctx.dpr || 1;\n ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n};\n\nvar tmpTransform = [];\nvar originTransform = matrix.create();\n\ntransformableProto.setLocalTransform = function (m) {\n if (!m) {\n // TODO return or set identity?\n return;\n }\n\n var sx = m[0] * m[0] + m[1] * m[1];\n var sy = m[2] * m[2] + m[3] * m[3];\n var position = this.position;\n var scale = this.scale;\n\n if (isNotAroundZero(sx - 1)) {\n sx = Math.sqrt(sx);\n }\n\n if (isNotAroundZero(sy - 1)) {\n sy = Math.sqrt(sy);\n }\n\n if (m[0] < 0) {\n sx = -sx;\n }\n\n if (m[3] < 0) {\n sy = -sy;\n }\n\n position[0] = m[4];\n position[1] = m[5];\n scale[0] = sx;\n scale[1] = sy;\n this.rotation = Math.atan2(-m[1] / sy, m[0] / sx);\n};\n/**\n * 分解`transform`矩阵到`position`, `rotation`, `scale`\n */\n\n\ntransformableProto.decomposeTransform = function () {\n if (!this.transform) {\n return;\n }\n\n var parent = this.parent;\n var m = this.transform;\n\n if (parent && parent.transform) {\n // Get local transform and decompose them to position, scale, rotation\n matrix.mul(tmpTransform, parent.invTransform, m);\n m = tmpTransform;\n }\n\n var origin = this.origin;\n\n if (origin && (origin[0] || origin[1])) {\n originTransform[4] = origin[0];\n originTransform[5] = origin[1];\n matrix.mul(tmpTransform, m, originTransform);\n tmpTransform[4] -= origin[0];\n tmpTransform[5] -= origin[1];\n m = tmpTransform;\n }\n\n this.setLocalTransform(m);\n};\n/**\n * Get global scale\n * @return {Array.}\n */\n\n\ntransformableProto.getGlobalScale = function (out) {\n var m = this.transform;\n out = out || [];\n\n if (!m) {\n out[0] = 1;\n out[1] = 1;\n return out;\n }\n\n out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]);\n out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]);\n\n if (m[0] < 0) {\n out[0] = -out[0];\n }\n\n if (m[3] < 0) {\n out[1] = -out[1];\n }\n\n return out;\n};\n/**\n * 变换坐标位置到 shape 的局部坐标空间\n * @method\n * @param {number} x\n * @param {number} y\n * @return {Array.}\n */\n\n\ntransformableProto.transformCoordToLocal = function (x, y) {\n var v2 = [x, y];\n var invTransform = this.invTransform;\n\n if (invTransform) {\n vector.applyTransform(v2, v2, invTransform);\n }\n\n return v2;\n};\n/**\n * 变换局部坐标位置到全局坐标空间\n * @method\n * @param {number} x\n * @param {number} y\n * @return {Array.}\n */\n\n\ntransformableProto.transformCoordToGlobal = function (x, y) {\n var v2 = [x, y];\n var transform = this.transform;\n\n if (transform) {\n vector.applyTransform(v2, v2, transform);\n }\n\n return v2;\n};\n/**\n * @static\n * @param {Object} target\n * @param {Array.} target.origin\n * @param {number} target.rotation\n * @param {Array.} target.position\n * @param {Array.} [m]\n */\n\n\nTransformable.getLocalTransform = function (target, m) {\n m = m || [];\n mIdentity(m);\n var origin = target.origin;\n var scale = target.scale || [1, 1];\n var rotation = target.rotation || 0;\n var position = target.position || [0, 0];\n\n if (origin) {\n // Translate to origin\n m[4] -= origin[0];\n m[5] -= origin[1];\n }\n\n matrix.scale(m, m, scale);\n\n if (rotation) {\n matrix.rotate(m, m, rotation);\n }\n\n if (origin) {\n // Translate back from origin\n m[4] += origin[0];\n m[5] += origin[1];\n }\n\n m[4] += position[0];\n m[5] += position[1];\n return m;\n};\n\nvar _default = Transformable;\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvbWl4aW4vVHJhbnNmb3JtYWJsZS5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi9taXhpbi9UcmFuc2Zvcm1hYmxlLmpzPzBjZGUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIG1hdHJpeCA9IHJlcXVpcmUoXCIuLi9jb3JlL21hdHJpeFwiKTtcblxudmFyIHZlY3RvciA9IHJlcXVpcmUoXCIuLi9jb3JlL3ZlY3RvclwiKTtcblxuLyoqXG4gKiDmj5Dkvpvlj5jmjaLmianlsZVcbiAqIEBtb2R1bGUgenJlbmRlci9taXhpbi9UcmFuc2Zvcm1hYmxlXG4gKiBAYXV0aG9yIHBpc3NhbmcgKGh0dHBzOi8vd3d3LmdpdGh1Yi5jb20vcGlzc2FuZylcbiAqL1xudmFyIG1JZGVudGl0eSA9IG1hdHJpeC5pZGVudGl0eTtcbnZhciBFUFNJTE9OID0gNWUtNTtcblxuZnVuY3Rpb24gaXNOb3RBcm91bmRaZXJvKHZhbCkge1xuICByZXR1cm4gdmFsID4gRVBTSUxPTiB8fCB2YWwgPCAtRVBTSUxPTjtcbn1cbi8qKlxuICogQGFsaWFzIG1vZHVsZTp6cmVuZGVyL21peGluL1RyYW5zZm9ybWFibGVcbiAqIEBjb25zdHJ1Y3RvclxuICovXG5cblxudmFyIFRyYW5zZm9ybWFib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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/mixin/Transformable.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/tool/color.js": +/*!************************************************!*\ + !*** ./node_modules/zrender/lib/tool/color.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var LRU = __webpack_require__(/*! ../core/LRU */ \"./node_modules/zrender/lib/core/LRU.js\");\n\nvar kCSSColorTable = {\n 'transparent': [0, 0, 0, 0],\n 'aliceblue': [240, 248, 255, 1],\n 'antiquewhite': [250, 235, 215, 1],\n 'aqua': [0, 255, 255, 1],\n 'aquamarine': [127, 255, 212, 1],\n 'azure': [240, 255, 255, 1],\n 'beige': [245, 245, 220, 1],\n 'bisque': [255, 228, 196, 1],\n 'black': [0, 0, 0, 1],\n 'blanchedalmond': [255, 235, 205, 1],\n 'blue': [0, 0, 255, 1],\n 'blueviolet': [138, 43, 226, 1],\n 'brown': [165, 42, 42, 1],\n 'burlywood': [222, 184, 135, 1],\n 'cadetblue': [95, 158, 160, 1],\n 'chartreuse': [127, 255, 0, 1],\n 'chocolate': [210, 105, 30, 1],\n 'coral': [255, 127, 80, 1],\n 'cornflowerblue': [100, 149, 237, 1],\n 'cornsilk': [255, 248, 220, 1],\n 'crimson': [220, 20, 60, 1],\n 'cyan': [0, 255, 255, 1],\n 'darkblue': [0, 0, 139, 1],\n 'darkcyan': [0, 139, 139, 1],\n 'darkgoldenrod': [184, 134, 11, 1],\n 'darkgray': [169, 169, 169, 1],\n 'darkgreen': [0, 100, 0, 1],\n 'darkgrey': [169, 169, 169, 1],\n 'darkkhaki': [189, 183, 107, 1],\n 'darkmagenta': [139, 0, 139, 1],\n 'darkolivegreen': [85, 107, 47, 1],\n 'darkorange': [255, 140, 0, 1],\n 'darkorchid': [153, 50, 204, 1],\n 'darkred': [139, 0, 0, 1],\n 'darksalmon': [233, 150, 122, 1],\n 'darkseagreen': [143, 188, 143, 1],\n 'darkslateblue': [72, 61, 139, 1],\n 'darkslategray': [47, 79, 79, 1],\n 'darkslategrey': [47, 79, 79, 1],\n 'darkturquoise': [0, 206, 209, 1],\n 'darkviolet': [148, 0, 211, 1],\n 'deeppink': [255, 20, 147, 1],\n 'deepskyblue': [0, 191, 255, 1],\n 'dimgray': [105, 105, 105, 1],\n 'dimgrey': [105, 105, 105, 1],\n 'dodgerblue': [30, 144, 255, 1],\n 'firebrick': [178, 34, 34, 1],\n 'floralwhite': [255, 250, 240, 1],\n 'forestgreen': [34, 139, 34, 1],\n 'fuchsia': [255, 0, 255, 1],\n 'gainsboro': [220, 220, 220, 1],\n 'ghostwhite': [248, 248, 255, 1],\n 'gold': [255, 215, 0, 1],\n 'goldenrod': [218, 165, 32, 1],\n 'gray': [128, 128, 128, 1],\n 'green': [0, 128, 0, 1],\n 'greenyellow': [173, 255, 47, 1],\n 'grey': [128, 128, 128, 1],\n 'honeydew': [240, 255, 240, 1],\n 'hotpink': [255, 105, 180, 1],\n 'indianred': [205, 92, 92, 1],\n 'indigo': [75, 0, 130, 1],\n 'ivory': [255, 255, 240, 1],\n 'khaki': [240, 230, 140, 1],\n 'lavender': [230, 230, 250, 1],\n 'lavenderblush': [255, 240, 245, 1],\n 'lawngreen': [124, 252, 0, 1],\n 'lemonchiffon': [255, 250, 205, 1],\n 'lightblue': [173, 216, 230, 1],\n 'lightcoral': [240, 128, 128, 1],\n 'lightcyan': [224, 255, 255, 1],\n 'lightgoldenrodyellow': [250, 250, 210, 1],\n 'lightgray': [211, 211, 211, 1],\n 'lightgreen': [144, 238, 144, 1],\n 'lightgrey': [211, 211, 211, 1],\n 'lightpink': [255, 182, 193, 1],\n 'lightsalmon': [255, 160, 122, 1],\n 'lightseagreen': [32, 178, 170, 1],\n 'lightskyblue': [135, 206, 250, 1],\n 'lightslategray': [119, 136, 153, 1],\n 'lightslategrey': [119, 136, 153, 1],\n 'lightsteelblue': [176, 196, 222, 1],\n 'lightyellow': [255, 255, 224, 1],\n 'lime': [0, 255, 0, 1],\n 'limegreen': [50, 205, 50, 1],\n 'linen': [250, 240, 230, 1],\n 'magenta': [255, 0, 255, 1],\n 'maroon': [128, 0, 0, 1],\n 'mediumaquamarine': [102, 205, 170, 1],\n 'mediumblue': [0, 0, 205, 1],\n 'mediumorchid': [186, 85, 211, 1],\n 'mediumpurple': [147, 112, 219, 1],\n 'mediumseagreen': [60, 179, 113, 1],\n 'mediumslateblue': [123, 104, 238, 1],\n 'mediumspringgreen': [0, 250, 154, 1],\n 'mediumturquoise': [72, 209, 204, 1],\n 'mediumvioletred': [199, 21, 133, 1],\n 'midnightblue': [25, 25, 112, 1],\n 'mintcream': [245, 255, 250, 1],\n 'mistyrose': [255, 228, 225, 1],\n 'moccasin': [255, 228, 181, 1],\n 'navajowhite': [255, 222, 173, 1],\n 'navy': [0, 0, 128, 1],\n 'oldlace': [253, 245, 230, 1],\n 'olive': [128, 128, 0, 1],\n 'olivedrab': [107, 142, 35, 1],\n 'orange': [255, 165, 0, 1],\n 'orangered': [255, 69, 0, 1],\n 'orchid': [218, 112, 214, 1],\n 'palegoldenrod': [238, 232, 170, 1],\n 'palegreen': [152, 251, 152, 1],\n 'paleturquoise': [175, 238, 238, 1],\n 'palevioletred': [219, 112, 147, 1],\n 'papayawhip': [255, 239, 213, 1],\n 'peachpuff': [255, 218, 185, 1],\n 'peru': [205, 133, 63, 1],\n 'pink': [255, 192, 203, 1],\n 'plum': [221, 160, 221, 1],\n 'powderblue': [176, 224, 230, 1],\n 'purple': [128, 0, 128, 1],\n 'red': [255, 0, 0, 1],\n 'rosybrown': [188, 143, 143, 1],\n 'royalblue': [65, 105, 225, 1],\n 'saddlebrown': [139, 69, 19, 1],\n 'salmon': [250, 128, 114, 1],\n 'sandybrown': [244, 164, 96, 1],\n 'seagreen': [46, 139, 87, 1],\n 'seashell': [255, 245, 238, 1],\n 'sienna': [160, 82, 45, 1],\n 'silver': [192, 192, 192, 1],\n 'skyblue': [135, 206, 235, 1],\n 'slateblue': [106, 90, 205, 1],\n 'slategray': [112, 128, 144, 1],\n 'slategrey': [112, 128, 144, 1],\n 'snow': [255, 250, 250, 1],\n 'springgreen': [0, 255, 127, 1],\n 'steelblue': [70, 130, 180, 1],\n 'tan': [210, 180, 140, 1],\n 'teal': [0, 128, 128, 1],\n 'thistle': [216, 191, 216, 1],\n 'tomato': [255, 99, 71, 1],\n 'turquoise': [64, 224, 208, 1],\n 'violet': [238, 130, 238, 1],\n 'wheat': [245, 222, 179, 1],\n 'white': [255, 255, 255, 1],\n 'whitesmoke': [245, 245, 245, 1],\n 'yellow': [255, 255, 0, 1],\n 'yellowgreen': [154, 205, 50, 1]\n};\n\nfunction clampCssByte(i) {\n // Clamp to integer 0 .. 255.\n i = Math.round(i); // Seems to be what Chrome does (vs truncation).\n\n return i < 0 ? 0 : i > 255 ? 255 : i;\n}\n\nfunction clampCssAngle(i) {\n // Clamp to integer 0 .. 360.\n i = Math.round(i); // Seems to be what Chrome does (vs truncation).\n\n return i < 0 ? 0 : i > 360 ? 360 : i;\n}\n\nfunction clampCssFloat(f) {\n // Clamp to float 0.0 .. 1.0.\n return f < 0 ? 0 : f > 1 ? 1 : f;\n}\n\nfunction parseCssInt(str) {\n // int or percentage.\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssByte(parseFloat(str) / 100 * 255);\n }\n\n return clampCssByte(parseInt(str, 10));\n}\n\nfunction parseCssFloat(str) {\n // float or percentage.\n if (str.length && str.charAt(str.length - 1) === '%') {\n return clampCssFloat(parseFloat(str) / 100);\n }\n\n return clampCssFloat(parseFloat(str));\n}\n\nfunction cssHueToRgb(m1, m2, h) {\n if (h < 0) {\n h += 1;\n } else if (h > 1) {\n h -= 1;\n }\n\n if (h * 6 < 1) {\n return m1 + (m2 - m1) * h * 6;\n }\n\n if (h * 2 < 1) {\n return m2;\n }\n\n if (h * 3 < 2) {\n return m1 + (m2 - m1) * (2 / 3 - h) * 6;\n }\n\n return m1;\n}\n\nfunction lerpNumber(a, b, p) {\n return a + (b - a) * p;\n}\n\nfunction setRgba(out, r, g, b, a) {\n out[0] = r;\n out[1] = g;\n out[2] = b;\n out[3] = a;\n return out;\n}\n\nfunction copyRgba(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n\nvar colorCache = new LRU(20);\nvar lastRemovedArr = null;\n\nfunction putToCache(colorStr, rgbaArr) {\n // Reuse removed array\n if (lastRemovedArr) {\n copyRgba(lastRemovedArr, rgbaArr);\n }\n\n lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || rgbaArr.slice());\n}\n/**\n * @param {string} colorStr\n * @param {Array.} out\n * @return {Array.}\n * @memberOf module:zrender/util/color\n */\n\n\nfunction parse(colorStr, rgbaArr) {\n if (!colorStr) {\n return;\n }\n\n rgbaArr = rgbaArr || [];\n var cached = colorCache.get(colorStr);\n\n if (cached) {\n return copyRgba(rgbaArr, cached);\n } // colorStr may be not string\n\n\n colorStr = colorStr + ''; // Remove all whitespace, not compliant, but should just be more accepting.\n\n var str = colorStr.replace(/ /g, '').toLowerCase(); // Color keywords (and transparent) lookup.\n\n if (str in kCSSColorTable) {\n copyRgba(rgbaArr, kCSSColorTable[str]);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n } // #abc and #abc123 syntax.\n\n\n if (str.charAt(0) === '#') {\n if (str.length === 4) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n\n if (!(iv >= 0 && iv <= 0xfff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return; // Covers NaN.\n }\n\n setRgba(rgbaArr, (iv & 0xf00) >> 4 | (iv & 0xf00) >> 8, iv & 0xf0 | (iv & 0xf0) >> 4, iv & 0xf | (iv & 0xf) << 4, 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n } else if (str.length === 7) {\n var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing.\n\n if (!(iv >= 0 && iv <= 0xffffff)) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return; // Covers NaN.\n }\n\n setRgba(rgbaArr, (iv & 0xff0000) >> 16, (iv & 0xff00) >> 8, iv & 0xff, 1);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n }\n\n return;\n }\n\n var op = str.indexOf('(');\n var ep = str.indexOf(')');\n\n if (op !== -1 && ep + 1 === str.length) {\n var fname = str.substr(0, op);\n var params = str.substr(op + 1, ep - (op + 1)).split(',');\n var alpha = 1; // To allow case fallthrough.\n\n switch (fname) {\n case 'rgba':\n if (params.length !== 4) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n\n alpha = parseCssFloat(params.pop());\n // jshint ignore:line\n // Fall through.\n\n case 'rgb':\n if (params.length !== 3) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n\n setRgba(rgbaArr, parseCssInt(params[0]), parseCssInt(params[1]), parseCssInt(params[2]), alpha);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n\n case 'hsla':\n if (params.length !== 4) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n\n params[3] = parseCssFloat(params[3]);\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n\n case 'hsl':\n if (params.length !== 3) {\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n }\n\n hsla2rgba(params, rgbaArr);\n putToCache(colorStr, rgbaArr);\n return rgbaArr;\n\n default:\n return;\n }\n }\n\n setRgba(rgbaArr, 0, 0, 0, 1);\n return;\n}\n/**\n * @param {Array.} hsla\n * @param {Array.} rgba\n * @return {Array.} rgba\n */\n\n\nfunction hsla2rgba(hsla, rgba) {\n var h = (parseFloat(hsla[0]) % 360 + 360) % 360 / 360; // 0 .. 1\n // NOTE(deanm): According to the CSS spec s/l should only be\n // percentages, but we don't bother and let float or percentage.\n\n var s = parseCssFloat(hsla[1]);\n var l = parseCssFloat(hsla[2]);\n var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;\n var m1 = l * 2 - m2;\n rgba = rgba || [];\n setRgba(rgba, clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), clampCssByte(cssHueToRgb(m1, m2, h) * 255), clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), 1);\n\n if (hsla.length === 4) {\n rgba[3] = hsla[3];\n }\n\n return rgba;\n}\n/**\n * @param {Array.} rgba\n * @return {Array.} hsla\n */\n\n\nfunction rgba2hsla(rgba) {\n if (!rgba) {\n return;\n } // RGB from 0 to 255\n\n\n var R = rgba[0] / 255;\n var G = rgba[1] / 255;\n var B = rgba[2] / 255;\n var vMin = Math.min(R, G, B); // Min. value of RGB\n\n var vMax = Math.max(R, G, B); // Max. value of RGB\n\n var delta = vMax - vMin; // Delta RGB value\n\n var L = (vMax + vMin) / 2;\n var H;\n var S; // HSL results from 0 to 1\n\n if (delta === 0) {\n H = 0;\n S = 0;\n } else {\n if (L < 0.5) {\n S = delta / (vMax + vMin);\n } else {\n S = delta / (2 - vMax - vMin);\n }\n\n var deltaR = ((vMax - R) / 6 + delta / 2) / delta;\n var deltaG = ((vMax - G) / 6 + delta / 2) / delta;\n var deltaB = ((vMax - B) / 6 + delta / 2) / delta;\n\n if (R === vMax) {\n H = deltaB - deltaG;\n } else if (G === vMax) {\n H = 1 / 3 + deltaR - deltaB;\n } else if (B === vMax) {\n H = 2 / 3 + deltaG - deltaR;\n }\n\n if (H < 0) {\n H += 1;\n }\n\n if (H > 1) {\n H -= 1;\n }\n }\n\n var hsla = [H * 360, S, L];\n\n if (rgba[3] != null) {\n hsla.push(rgba[3]);\n }\n\n return hsla;\n}\n/**\n * @param {string} color\n * @param {number} level\n * @return {string}\n * @memberOf module:zrender/util/color\n */\n\n\nfunction lift(color, level) {\n var colorArr = parse(color);\n\n if (colorArr) {\n for (var i = 0; i < 3; i++) {\n if (level < 0) {\n colorArr[i] = colorArr[i] * (1 - level) | 0;\n } else {\n colorArr[i] = (255 - colorArr[i]) * level + colorArr[i] | 0;\n }\n\n if (colorArr[i] > 255) {\n colorArr[i] = 255;\n } else if (color[i] < 0) {\n colorArr[i] = 0;\n }\n }\n\n return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb');\n }\n}\n/**\n * @param {string} color\n * @return {string}\n * @memberOf module:zrender/util/color\n */\n\n\nfunction toHex(color) {\n var colorArr = parse(color);\n\n if (colorArr) {\n return ((1 << 24) + (colorArr[0] << 16) + (colorArr[1] << 8) + +colorArr[2]).toString(16).slice(1);\n }\n}\n/**\n * Map value to color. Faster than lerp methods because color is represented by rgba array.\n * @param {number} normalizedValue A float between 0 and 1.\n * @param {Array.>} colors List of rgba color array\n * @param {Array.} [out] Mapped gba color array\n * @return {Array.} will be null/undefined if input illegal.\n */\n\n\nfunction fastLerp(normalizedValue, colors, out) {\n if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\n }\n\n out = out || [];\n var value = normalizedValue * (colors.length - 1);\n var leftIndex = Math.floor(value);\n var rightIndex = Math.ceil(value);\n var leftColor = colors[leftIndex];\n var rightColor = colors[rightIndex];\n var dv = value - leftIndex;\n out[0] = clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv));\n out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv));\n out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv));\n out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv));\n return out;\n}\n/**\n * @deprecated\n */\n\n\nvar fastMapToColor = fastLerp;\n/**\n * @param {number} normalizedValue A float between 0 and 1.\n * @param {Array.} colors Color list.\n * @param {boolean=} fullOutput Default false.\n * @return {(string|Object)} Result color. If fullOutput,\n * return {color: ..., leftIndex: ..., rightIndex: ..., value: ...},\n * @memberOf module:zrender/util/color\n */\n\nfunction lerp(normalizedValue, colors, fullOutput) {\n if (!(colors && colors.length) || !(normalizedValue >= 0 && normalizedValue <= 1)) {\n return;\n }\n\n var value = normalizedValue * (colors.length - 1);\n var leftIndex = Math.floor(value);\n var rightIndex = Math.ceil(value);\n var leftColor = parse(colors[leftIndex]);\n var rightColor = parse(colors[rightIndex]);\n var dv = value - leftIndex;\n var color = stringify([clampCssByte(lerpNumber(leftColor[0], rightColor[0], dv)), clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)), clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)), clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv))], 'rgba');\n return fullOutput ? {\n color: color,\n leftIndex: leftIndex,\n rightIndex: rightIndex,\n value: value\n } : color;\n}\n/**\n * @deprecated\n */\n\n\nvar mapToColor = lerp;\n/**\n * @param {string} color\n * @param {number=} h 0 ~ 360, ignore when null.\n * @param {number=} s 0 ~ 1, ignore when null.\n * @param {number=} l 0 ~ 1, ignore when null.\n * @return {string} Color string in rgba format.\n * @memberOf module:zrender/util/color\n */\n\nfunction modifyHSL(color, h, s, l) {\n color = parse(color);\n\n if (color) {\n color = rgba2hsla(color);\n h != null && (color[0] = clampCssAngle(h));\n s != null && (color[1] = parseCssFloat(s));\n l != null && (color[2] = parseCssFloat(l));\n return stringify(hsla2rgba(color), 'rgba');\n }\n}\n/**\n * @param {string} color\n * @param {number=} alpha 0 ~ 1\n * @return {string} Color string in rgba format.\n * @memberOf module:zrender/util/color\n */\n\n\nfunction modifyAlpha(color, alpha) {\n color = parse(color);\n\n if (color && alpha != null) {\n color[3] = clampCssFloat(alpha);\n return stringify(color, 'rgba');\n }\n}\n/**\n * @param {Array.} arrColor like [12,33,44,0.4]\n * @param {string} type 'rgba', 'hsva', ...\n * @return {string} Result color. (If input illegal, return undefined).\n */\n\n\nfunction stringify(arrColor, type) {\n if (!arrColor || !arrColor.length) {\n return;\n }\n\n var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];\n\n if (type === 'rgba' || type === 'hsva' || type === 'hsla') {\n colorStr += ',' + arrColor[3];\n }\n\n return type + '(' + colorStr + ')';\n}\n\nexports.parse = parse;\nexports.lift = lift;\nexports.toHex = toHex;\nexports.fastLerp = fastLerp;\nexports.fastMapToColor = fastMapToColor;\nexports.lerp = lerp;\nexports.mapToColor = mapToColor;\nexports.modifyHSL = modifyHSL;\nexports.modifyAlpha = modifyAlpha;\nexports.stringify = stringify;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvdG9vbC9jb2xvci5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL25vZGVfbW9kdWxlcy96cmVuZGVyL2xpYi90b29sL2NvbG9yLmpzPzQxZWYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIExSVSA9IHJlcXVpcmUoXCIuLi9jb3JlL0xSVVwiKTtcblxudmFyIGtDU1NDb2xvclRhYmxlID0ge1xuICAndHJhbnNwYXJlbnQnOiBbMCwgMCwgMCwgMF0sXG4gICdhbGljZWJsdWUnOiBbMjQwLCAyNDgsIDI1NSwgMV0sXG4gICdhbnRpcXVld2hpdGUnOiBbMjUwLCAyMzUsIDIxNSwgMV0sXG4gICdhcXVhJzogWzAsIDI1NSwgMjU1LCAxXSxcbi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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/tool/color.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/tool/path.js": +/*!***********************************************!*\ + !*** ./node_modules/zrender/lib/tool/path.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var Path = __webpack_require__(/*! ../graphic/Path */ \"./node_modules/zrender/lib/graphic/Path.js\");\n\nvar PathProxy = __webpack_require__(/*! ../core/PathProxy */ \"./node_modules/zrender/lib/core/PathProxy.js\");\n\nvar transformPath = __webpack_require__(/*! ./transformPath */ \"./node_modules/zrender/lib/tool/transformPath.js\");\n\n// command chars\n// var cc = [\n// 'm', 'M', 'l', 'L', 'v', 'V', 'h', 'H', 'z', 'Z',\n// 'c', 'C', 'q', 'Q', 't', 'T', 's', 'S', 'a', 'A'\n// ];\nvar mathSqrt = Math.sqrt;\nvar mathSin = Math.sin;\nvar mathCos = Math.cos;\nvar PI = Math.PI;\n\nvar vMag = function (v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n};\n\nvar vRatio = function (u, v) {\n return (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v));\n};\n\nvar vAngle = function (u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n};\n\nfunction processArc(x1, y1, x2, y2, fa, fs, rx, ry, psiDeg, cmd, path) {\n var psi = psiDeg * (PI / 180.0);\n var xp = mathCos(psi) * (x1 - x2) / 2.0 + mathSin(psi) * (y1 - y2) / 2.0;\n var yp = -1 * mathSin(psi) * (x1 - x2) / 2.0 + mathCos(psi) * (y1 - y2) / 2.0;\n var lambda = xp * xp / (rx * rx) + yp * yp / (ry * ry);\n\n if (lambda > 1) {\n rx *= mathSqrt(lambda);\n ry *= mathSqrt(lambda);\n }\n\n 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;\n var cxp = f * rx * yp / ry;\n var cyp = f * -ry * xp / rx;\n var cx = (x1 + x2) / 2.0 + mathCos(psi) * cxp - mathSin(psi) * cyp;\n var cy = (y1 + y2) / 2.0 + mathSin(psi) * cxp + mathCos(psi) * cyp;\n var theta = vAngle([1, 0], [(xp - cxp) / rx, (yp - cyp) / ry]);\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n var dTheta = vAngle(u, v);\n\n if (vRatio(u, v) <= -1) {\n dTheta = PI;\n }\n\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n\n if (fs === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * PI;\n }\n\n if (fs === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * PI;\n }\n\n path.addData(cmd, cx, cy, rx, ry, theta, dTheta, psi, fs);\n}\n\nvar commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig; // Consider case:\n// (1) delimiter can be comma or space, where continuous commas\n// or spaces should be seen as one comma.\n// (2) value can be like:\n// '2e-4', 'l.5.9' (ignore 0), 'M-10-10', 'l-2.43e-1,34.9983',\n// 'l-.5E1,54', '121-23-44-11' (no delimiter)\n\nvar numberReg = /-?([0-9]*\\.)?[0-9]+([eE]-?[0-9]+)?/g; // var valueSplitReg = /[\\s,]+/;\n\nfunction createPathProxyFromString(data) {\n if (!data) {\n return new PathProxy();\n } // var data = data.replace(/-/g, ' -')\n // .replace(/ /g, ' ')\n // .replace(/ /g, ',')\n // .replace(/,,/g, ',');\n // var n;\n // create pipes so that we can split the data\n // for (n = 0; n < cc.length; n++) {\n // cs = cs.replace(new RegExp(cc[n], 'g'), '|' + cc[n]);\n // }\n // data = data.replace(/-/g, ',-');\n // create array\n // var arr = cs.split('|');\n // init context point\n\n\n var cpx = 0;\n var cpy = 0;\n var subpathX = cpx;\n var subpathY = cpy;\n var prevCmd;\n var path = new PathProxy();\n var CMD = PathProxy.CMD; // commandReg.lastIndex = 0;\n // var cmdResult;\n // while ((cmdResult = commandReg.exec(data)) != null) {\n // var cmdStr = cmdResult[1];\n // var cmdContent = cmdResult[2];\n\n var cmdList = data.match(commandReg);\n\n for (var l = 0; l < cmdList.length; l++) {\n var cmdText = cmdList[l];\n var cmdStr = cmdText.charAt(0);\n var cmd; // String#split is faster a little bit than String#replace or RegExp#exec.\n // var p = cmdContent.split(valueSplitReg);\n // var pLen = 0;\n // for (var i = 0; i < p.length; i++) {\n // // '' and other invalid str => NaN\n // var val = parseFloat(p[i]);\n // !isNaN(val) && (p[pLen++] = val);\n // }\n\n var p = cmdText.match(numberReg) || [];\n var pLen = p.length;\n\n for (var i = 0; i < pLen; i++) {\n p[i] = parseFloat(p[i]);\n }\n\n var off = 0;\n\n while (off < pLen) {\n var ctlPtx;\n var ctlPty;\n var rx;\n var ry;\n var psi;\n var fa;\n var fs;\n var x1 = cpx;\n var y1 = cpy; // convert l, H, h, V, and v to L\n\n switch (cmdStr) {\n case 'l':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'L':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'm':\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'l';\n break;\n\n case 'M':\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.M;\n path.addData(cmd, cpx, cpy);\n subpathX = cpx;\n subpathY = cpy;\n cmdStr = 'L';\n break;\n\n case 'h':\n cpx += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'H':\n cpx = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'v':\n cpy += p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'V':\n cpy = p[off++];\n cmd = CMD.L;\n path.addData(cmd, cpx, cpy);\n break;\n\n case 'C':\n cmd = CMD.C;\n path.addData(cmd, p[off++], p[off++], p[off++], p[off++], p[off++], p[off++]);\n cpx = p[off - 2];\n cpy = p[off - 1];\n break;\n\n case 'c':\n cmd = CMD.C;\n path.addData(cmd, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy, p[off++] + cpx, p[off++] + cpy);\n cpx += p[off - 2];\n cpy += p[off - 1];\n break;\n\n case 'S':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 's':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.C) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cmd = CMD.C;\n x1 = cpx + p[off++];\n y1 = cpy + p[off++];\n cpx += p[off++];\n cpy += p[off++];\n path.addData(cmd, ctlPtx, ctlPty, x1, y1, cpx, cpy);\n break;\n\n case 'Q':\n x1 = p[off++];\n y1 = p[off++];\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'q':\n x1 = p[off++] + cpx;\n y1 = p[off++] + cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, x1, y1, cpx, cpy);\n break;\n\n case 'T':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 't':\n ctlPtx = cpx;\n ctlPty = cpy;\n var len = path.len();\n var pathData = path.data;\n\n if (prevCmd === CMD.Q) {\n ctlPtx += cpx - pathData[len - 4];\n ctlPty += cpy - pathData[len - 3];\n }\n\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.Q;\n path.addData(cmd, ctlPtx, ctlPty, cpx, cpy);\n break;\n\n case 'A':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx = p[off++];\n cpy = p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n\n case 'a':\n rx = p[off++];\n ry = p[off++];\n psi = p[off++];\n fa = p[off++];\n fs = p[off++];\n x1 = cpx, y1 = cpy;\n cpx += p[off++];\n cpy += p[off++];\n cmd = CMD.A;\n processArc(x1, y1, cpx, cpy, fa, fs, rx, ry, psi, cmd, path);\n break;\n }\n }\n\n if (cmdStr === 'z' || cmdStr === 'Z') {\n cmd = CMD.Z;\n path.addData(cmd); // z may be in the middle of the path.\n\n cpx = subpathX;\n cpy = subpathY;\n }\n\n prevCmd = cmd;\n }\n\n path.toStatic();\n return path;\n} // TODO Optimize double memory cost problem\n\n\nfunction createPathOptions(str, opts) {\n var pathProxy = createPathProxyFromString(str);\n opts = opts || {};\n\n opts.buildPath = function (path) {\n if (path.setData) {\n path.setData(pathProxy.data); // Svg and vml renderer don't have context\n\n var ctx = path.getContext();\n\n if (ctx) {\n path.rebuildPath(ctx);\n }\n } else {\n var ctx = path;\n pathProxy.rebuildPath(ctx);\n }\n };\n\n opts.applyTransform = function (m) {\n transformPath(pathProxy, m);\n this.dirty(true);\n };\n\n return opts;\n}\n/**\n * Create a Path object from path string data\n * http://www.w3.org/TR/SVG/paths.html#PathData\n * @param {Object} opts Other options\n */\n\n\nfunction createFromString(str, opts) {\n return new Path(createPathOptions(str, opts));\n}\n/**\n * Create a Path class from path string data\n * @param {string} str\n * @param {Object} opts Other options\n */\n\n\nfunction extendFromString(str, opts) {\n return Path.extend(createPathOptions(str, opts));\n}\n/**\n * Merge multiple paths\n */\n// TODO Apply transform\n// TODO stroke dash\n// TODO Optimize double memory cost problem\n\n\nfunction mergePath(pathEls, opts) {\n var pathList = [];\n var len = pathEls.length;\n\n for (var i = 0; i < len; i++) {\n var pathEl = pathEls[i];\n\n if (!pathEl.path) {\n pathEl.createPathProxy();\n }\n\n if (pathEl.__dirtyPath) {\n pathEl.buildPath(pathEl.path, pathEl.shape, true);\n }\n\n pathList.push(pathEl.path);\n }\n\n var pathBundle = new Path(opts); // Need path proxy.\n\n pathBundle.createPathProxy();\n\n pathBundle.buildPath = function (path) {\n path.appendPath(pathList); // Svg and vml renderer don't have context\n\n var ctx = path.getContext();\n\n if (ctx) {\n path.rebuildPath(ctx);\n }\n };\n\n return pathBundle;\n}\n\nexports.createFromString = createFromString;\nexports.extendFromString = extendFromString;\nexports.mergePath = mergePath;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvdG9vbC9wYXRoLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vZWNoYXJ0cy1saXF1aWRmaWxsLy4vbm9kZV9tb2R1bGVzL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IHZhciBwc2k7XG4gICAgICB2YXIgZmE7XG4gICAgICB2YXIgZnM7XG4gICAgICB2YXIgeDEgPSBjcHg7XG4gICAgICB2YXIgeTEgPSBjcHk7IC8vIGNvbnZlcnQgbCwgSCwgaCwgViwgYW5kIHYgdG8gTFxuXG4gICAgICBzd2l0Y2ggKGNtZFN0cikge1xuICAgICAgICBjYXNlICdsJzpcbiAgICAgICAgICBjcHggKz0gcFtvZmYrK107XG4gICAgICAgICAgY3B5ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5MO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGNweCwgY3B5KTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdMJzpcbiAgICAgICAgICBjcHggPSBwW29mZisrXTtcbiAgICAgICAgICBjcHkgPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuTDtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjcHgsIGNweSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnbSc6XG4gICAgICAgICAgY3B4ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweSArPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuTTtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjcHgsIGNweSk7XG4gICAgICAgICAgc3VicGF0aFggPSBjcHg7XG4gICAgICAgICAgc3VicGF0aFkgPSBjcHk7XG4gICAgICAgICAgY21kU3RyID0gJ2wnO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ00nOlxuICAgICAgICAgIGNweCA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweSA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5NO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGNweCwgY3B5KTtcbiAgICAgICAgICBzdWJwYXRoWCA9IGNweDtcbiAgICAgICAgICBzdWJwYXRoWSA9IGNweTtcbiAgICAgICAgICBjbWRTdHIgPSAnTCc7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnaCc6XG4gICAgICAgICAgY3B4ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5MO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGNweCwgY3B5KTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdIJzpcbiAgICAgICAgICBjcHggPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuTDtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjcHgsIGNweSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAndic6XG4gICAgICAgICAgY3B5ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5MO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGNweCwgY3B5KTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdWJzpcbiAgICAgICAgICBjcHkgPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuTDtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjcHgsIGNweSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnQyc6XG4gICAgICAgICAgY21kID0gQ01ELkM7XG4gICAgICAgICAgcGF0aC5hZGREYXRhKGNtZCwgcFtvZmYrK10sIHBbb2ZmKytdLCBwW29mZisrXSwgcFtvZmYrK10sIHBbb2ZmKytdLCBwW29mZisrXSk7XG4gICAgICAgICAgY3B4ID0gcFtvZmYgLSAyXTtcbiAgICAgICAgICBjcHkgPSBwW29mZiAtIDFdO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ2MnOlxuICAgICAgICAgIGNtZCA9IENNRC5DO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIHBbb2ZmKytdICsgY3B4LCBwW29mZisrXSArIGNweSwgcFtvZmYrK10gKyBjcHgsIHBbb2ZmKytdICsgY3B5LCBwW29mZisrXSArIGNweCwgcFtvZmYrK10gKyBjcHkpO1xuICAgICAgICAgIGNweCArPSBwW29mZiAtIDJdO1xuICAgICAgICAgIGNweSArPSBwW29mZiAtIDFdO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ1MnOlxuICAgICAgICAgIGN0bFB0eCA9IGNweDtcbiAgICAgICAgICBjdGxQdHkgPSBjcHk7XG4gICAgICAgICAgdmFyIGxlbiA9IHBhdGgubGVuKCk7XG4gICAgICAgICAgdmFyIHBhdGhEYXRhID0gcGF0aC5kYXRhO1xuXG4gICAgICAgICAgaWYgKHByZXZDbWQgPT09IENNRC5DKSB7XG4gICAgICAgICAgICBjdGxQdHggKz0gY3B4IC0gcGF0aERhdGFbbGVuIC0gNF07XG4gICAgICAgICAgICBjdGxQdHkgKz0gY3B5IC0gcGF0aERhdGFbbGVuIC0gM107XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY21kID0gQ01ELkM7XG4gICAgICAgICAgeDEgPSBwW29mZisrXTtcbiAgICAgICAgICB5MSA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweCA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweSA9IHBbb2ZmKytdO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGN0bFB0eCwgY3RsUHR5LCB4MSwgeTEsIGNweCwgY3B5KTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdzJzpcbiAgICAgICAgICBjdGxQdHggPSBjcHg7XG4gICAgICAgICAgY3RsUHR5ID0gY3B5O1xuICAgICAgICAgIHZhciBsZW4gPSBwYXRoLmxlbigpO1xuICAgICAgICAgIHZhciBwYXRoRGF0YSA9IHBhdGguZGF0YTtcblxuICAgICAgICAgIGlmIChwcmV2Q21kID09PSBDTUQuQykge1xuICAgICAgICAgICAgY3RsUHR4ICs9IGNweCAtIHBhdGhEYXRhW2xlbiAtIDRdO1xuICAgICAgICAgICAgY3RsUHR5ICs9IGNweSAtIHBhdGhEYXRhW2xlbiAtIDNdO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGNtZCA9IENNRC5DO1xuICAgICAgICAgIHgxID0gY3B4ICsgcFtvZmYrK107XG4gICAgICAgICAgeTEgPSBjcHkgKyBwW29mZisrXTtcbiAgICAgICAgICBjcHggKz0gcFtvZmYrK107XG4gICAgICAgICAgY3B5ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIHBhdGguYWRkRGF0YShjbWQsIGN0bFB0eCwgY3RsUHR5LCB4MSwgeTEsIGNweCwgY3B5KTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdRJzpcbiAgICAgICAgICB4MSA9IHBbb2ZmKytdO1xuICAgICAgICAgIHkxID0gcFtvZmYrK107XG4gICAgICAgICAgY3B4ID0gcFtvZmYrK107XG4gICAgICAgICAgY3B5ID0gcFtvZmYrK107XG4gICAgICAgICAgY21kID0gQ01ELlE7XG4gICAgICAgICAgcGF0aC5hZGREYXRhKGNtZCwgeDEsIHkxLCBjcHgsIGNweSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAncSc6XG4gICAgICAgICAgeDEgPSBwW29mZisrXSArIGNweDtcbiAgICAgICAgICB5MSA9IHBbb2ZmKytdICsgY3B5O1xuICAgICAgICAgIGNweCArPSBwW29mZisrXTtcbiAgICAgICAgICBjcHkgKz0gcFtvZmYrK107XG4gICAgICAgICAgY21kID0gQ01ELlE7XG4gICAgICAgICAgcGF0aC5hZGREYXRhKGNtZCwgeDEsIHkxLCBjcHgsIGNweSk7XG4gICAgICAgICAgYnJlYWs7XG5cbiAgICAgICAgY2FzZSAnVCc6XG4gICAgICAgICAgY3RsUHR4ID0gY3B4O1xuICAgICAgICAgIGN0bFB0eSA9IGNweTtcbiAgICAgICAgICB2YXIgbGVuID0gcGF0aC5sZW4oKTtcbiAgICAgICAgICB2YXIgcGF0aERhdGEgPSBwYXRoLmRhdGE7XG5cbiAgICAgICAgICBpZiAocHJldkNtZCA9PT0gQ01ELlEpIHtcbiAgICAgICAgICAgIGN0bFB0eCArPSBjcHggLSBwYXRoRGF0YVtsZW4gLSA0XTtcbiAgICAgICAgICAgIGN0bFB0eSArPSBjcHkgLSBwYXRoRGF0YVtsZW4gLSAzXTtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBjcHggPSBwW29mZisrXTtcbiAgICAgICAgICBjcHkgPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuUTtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjdGxQdHgsIGN0bFB0eSwgY3B4LCBjcHkpO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ3QnOlxuICAgICAgICAgIGN0bFB0eCA9IGNweDtcbiAgICAgICAgICBjdGxQdHkgPSBjcHk7XG4gICAgICAgICAgdmFyIGxlbiA9IHBhdGgubGVuKCk7XG4gICAgICAgICAgdmFyIHBhdGhEYXRhID0gcGF0aC5kYXRhO1xuXG4gICAgICAgICAgaWYgKHByZXZDbWQgPT09IENNRC5RKSB7XG4gICAgICAgICAgICBjdGxQdHggKz0gY3B4IC0gcGF0aERhdGFbbGVuIC0gNF07XG4gICAgICAgICAgICBjdGxQdHkgKz0gY3B5IC0gcGF0aERhdGFbbGVuIC0gM107XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgY3B4ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweSArPSBwW29mZisrXTtcbiAgICAgICAgICBjbWQgPSBDTUQuUTtcbiAgICAgICAgICBwYXRoLmFkZERhdGEoY21kLCBjdGxQdHgsIGN0bFB0eSwgY3B4LCBjcHkpO1xuICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgIGNhc2UgJ0EnOlxuICAgICAgICAgIHJ4ID0gcFtvZmYrK107XG4gICAgICAgICAgcnkgPSBwW29mZisrXTtcbiAgICAgICAgICBwc2kgPSBwW29mZisrXTtcbiAgICAgICAgICBmYSA9IHBbb2ZmKytdO1xuICAgICAgICAgIGZzID0gcFtvZmYrK107XG4gICAgICAgICAgeDEgPSBjcHgsIHkxID0gY3B5O1xuICAgICAgICAgIGNweCA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNweSA9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5BO1xuICAgICAgICAgIHByb2Nlc3NBcmMoeDEsIHkxLCBjcHgsIGNweSwgZmEsIGZzLCByeCwgcnksIHBzaSwgY21kLCBwYXRoKTtcbiAgICAgICAgICBicmVhaztcblxuICAgICAgICBjYXNlICdhJzpcbiAgICAgICAgICByeCA9IHBbb2ZmKytdO1xuICAgICAgICAgIHJ5ID0gcFtvZmYrK107XG4gICAgICAgICAgcHNpID0gcFtvZmYrK107XG4gICAgICAgICAgZmEgPSBwW29mZisrXTtcbiAgICAgICAgICBmcyA9IHBbb2ZmKytdO1xuICAgICAgICAgIHgxID0gY3B4LCB5MSA9IGNweTtcbiAgICAgICAgICBjcHggKz0gcFtvZmYrK107XG4gICAgICAgICAgY3B5ICs9IHBbb2ZmKytdO1xuICAgICAgICAgIGNtZCA9IENNRC5BO1xuICAgICAgICAgIHByb2Nlc3NBcmMoeDEsIHkxLCBjcHgsIGNweSwgZmEsIGZzLCByeCwgcnksIHBzaSwgY21kLCBwYXRoKTtcbiAgICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoY21kU3RyID09PSAneicgfHwgY21kU3RyID09PSAnWicpIHtcbiAgICAgIGNtZCA9IENNRC5aO1xuICAgICAgcGF0aC5hZGREYXRhKGNtZCk7IC8vIHogbWF5IGJlIGluIHRoZSBtaWRkbGUgb2YgdGhlIHBhdGguXG5cbiAgICAgIGNweCA9IHN1YnBhdGhYO1xuICAgICAgY3B5ID0gc3VicGF0aFk7XG4gICAgfVxuXG4gICAgcHJldkN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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/tool/path.js\n"); + +/***/ }), + +/***/ "./node_modules/zrender/lib/tool/transformPath.js": +/*!********************************************************!*\ + !*** ./node_modules/zrender/lib/tool/transformPath.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var PathProxy = __webpack_require__(/*! ../core/PathProxy */ \"./node_modules/zrender/lib/core/PathProxy.js\");\n\nvar _vector = __webpack_require__(/*! ../core/vector */ \"./node_modules/zrender/lib/core/vector.js\");\n\nvar v2ApplyTransform = _vector.applyTransform;\nvar CMD = PathProxy.CMD;\nvar points = [[], [], []];\nvar mathSqrt = Math.sqrt;\nvar mathAtan2 = Math.atan2;\n\nfunction _default(path, m) {\n var data = path.data;\n var cmd;\n var nPoint;\n var i;\n var j;\n var k;\n var p;\n var M = CMD.M;\n var C = CMD.C;\n var L = CMD.L;\n var R = CMD.R;\n var A = CMD.A;\n var Q = CMD.Q;\n\n for (i = 0, j = 0; i < data.length;) {\n cmd = data[i++];\n j = i;\n nPoint = 0;\n\n switch (cmd) {\n case M:\n nPoint = 1;\n break;\n\n case L:\n nPoint = 1;\n break;\n\n case C:\n nPoint = 3;\n break;\n\n case Q:\n nPoint = 2;\n break;\n\n case A:\n var x = m[4];\n var y = m[5];\n var sx = mathSqrt(m[0] * m[0] + m[1] * m[1]);\n var sy = mathSqrt(m[2] * m[2] + m[3] * m[3]);\n var angle = mathAtan2(-m[1] / sy, m[0] / sx); // cx\n\n data[i] *= sx;\n data[i++] += x; // cy\n\n data[i] *= sy;\n data[i++] += y; // Scale rx and ry\n // FIXME Assume psi is 0 here\n\n data[i++] *= sx;\n data[i++] *= sy; // Start angle\n\n data[i++] += angle; // end angle\n\n data[i++] += angle; // FIXME psi\n\n i += 2;\n j = i;\n break;\n\n case R:\n // x0, y0\n p[0] = data[i++];\n p[1] = data[i++];\n v2ApplyTransform(p, p, m);\n data[j++] = p[0];\n data[j++] = p[1]; // x1, y1\n\n p[0] += data[i++];\n p[1] += data[i++];\n v2ApplyTransform(p, p, m);\n data[j++] = p[0];\n data[j++] = p[1];\n }\n\n for (k = 0; k < nPoint; k++) {\n var p = points[k];\n p[0] = data[i++];\n p[1] = data[i++];\n v2ApplyTransform(p, p, m); // Write back\n\n data[j++] = p[0];\n data[j++] = p[1];\n }\n }\n}\n\nmodule.exports = _default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9ub2RlX21vZHVsZXMvenJlbmRlci9saWIvdG9vbC90cmFuc2Zvcm1QYXRoLmpzLmpzIiwic291cmNlcyI6WyJ3ZWJwYW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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/zrender/lib/tool/transformPath.js\n"); + +/***/ }), + +/***/ "./src/liquidFill.js": +/*!***************************!*\ + !*** ./src/liquidFill.js ***! + \***************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var echarts = __webpack_require__(/*! echarts/lib/echarts */ \"echarts/lib/echarts\");\n\n__webpack_require__(/*! ./liquidFillSeries */ \"./src/liquidFillSeries.js\");\n__webpack_require__(/*! ./liquidFillView */ \"./src/liquidFillView.js\");\n\n\necharts.registerVisual(\n echarts.util.curry(\n __webpack_require__(/*! echarts/lib/visual/dataColor */ \"./node_modules/echarts/lib/visual/dataColor.js\"), 'liquidFill'\n )\n);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbGlxdWlkRmlsbC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL3NyYy9saXF1aWRGaWxsLmpzP2NhOGIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGVjaGFydHMgPSByZXF1aXJlKCdlY2hhcnRzL2xpYi9lY2hhcnRzJyk7XG5cbnJlcXVpcmUoJy4vbGlxdWlkRmlsbFNlcmllcycpO1xucmVxdWlyZSgnLi9saXF1aWRGaWxsVmlldycpO1xuXG5cbmVjaGFydHMucmVnaXN0ZXJWaXN1YWwoXG4gICAgZWNoYXJ0cy51dGlsLmN1cnJ5KFxuICAgICAgICByZXF1aXJlKCdlY2hhcnRzL2xpYi92aXN1YWwvZGF0YUNvbG9yJyksICdsaXF1aWRGaWxsJ1xuICAgIClcbik7XG4iXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/liquidFill.js\n"); + +/***/ }), + +/***/ "./src/liquidFillLayout.js": +/*!*********************************!*\ + !*** ./src/liquidFillLayout.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var echarts = __webpack_require__(/*! echarts/lib/echarts */ \"echarts/lib/echarts\");\n\nmodule.exports = echarts.graphic.extendShape({\n type: 'ec-liquid-fill',\n\n shape: {\n waveLength: 0,\n radius: 0,\n radiusY: 0,\n cx: 0,\n cy: 0,\n waterLevel: 0,\n amplitude: 0,\n phase: 0,\n inverse: false\n },\n\n buildPath: function (ctx, shape) {\n if (shape.radiusY == null) {\n shape.radiusY = shape.radius;\n }\n\n /**\n * We define a sine wave having 4 waves, and make sure at least 8 curves\n * is drawn. Otherwise, it may cause blank area for some waves when\n * wave length is large enough.\n */\n var curves = Math.max(\n Math.ceil(2 * shape.radius / shape.waveLength * 4) * 2,\n 8\n );\n\n // map phase to [-Math.PI * 2, 0]\n while (shape.phase < -Math.PI * 2) {\n shape.phase += Math.PI * 2;\n }\n while (shape.phase > 0) {\n shape.phase -= Math.PI * 2;\n }\n var phase = shape.phase / Math.PI / 2 * shape.waveLength;\n\n var left = shape.cx - shape.radius + phase - shape.radius * 2;\n\n /**\n * top-left corner as start point\n *\n * draws this point\n * |\n * \\|/\n * ~~~~~~~~\n * | |\n * +------+\n */\n ctx.moveTo(left, shape.waterLevel);\n\n /**\n * top wave\n *\n * ~~~~~~~~ <- draws this sine wave\n * | |\n * +------+\n */\n var waveRight = 0;\n for (var c = 0; c < curves; ++c) {\n var stage = c % 4;\n var pos = getWaterPositions(c * shape.waveLength / 4, stage,\n shape.waveLength, shape.amplitude);\n ctx.bezierCurveTo(pos[0][0] + left, -pos[0][1] + shape.waterLevel,\n pos[1][0] + left, -pos[1][1] + shape.waterLevel,\n pos[2][0] + left, -pos[2][1] + shape.waterLevel);\n\n if (c === curves - 1) {\n waveRight = pos[2][0];\n }\n }\n\n if (shape.inverse) {\n /**\n * top-right corner\n * 2. draws this line\n * |\n * +------+\n * 3. draws this line -> | | <- 1. draws this line\n * ~~~~~~~~\n */\n ctx.lineTo(waveRight + left, shape.cy - shape.radiusY);\n ctx.lineTo(left, shape.cy - shape.radiusY);\n ctx.lineTo(left, shape.waterLevel);\n }\n else {\n /**\n * top-right corner\n *\n * ~~~~~~~~\n * 3. draws this line -> | | <- 1. draws this line\n * +------+\n * ^\n * |\n * 2. draws this line\n */\n ctx.lineTo(waveRight + left, shape.cy + shape.radiusY);\n ctx.lineTo(left, shape.cy + shape.radiusY);\n ctx.lineTo(left, shape.waterLevel);\n }\n\n ctx.closePath();\n }\n});\n\n\n\n/**\n * Using Bezier curves to fit sine wave.\n * There is 4 control points for each curve of wave,\n * which is at 1/4 wave length of the sine wave.\n *\n * The control points for a wave from (a) to (d) are a-b-c-d:\n * c *----* d\n * b *\n * |\n * ... a * ..................\n *\n * whose positions are a: (0, 0), b: (0.5, 0.5), c: (1, 1), d: (PI / 2, 1)\n *\n * @param {number} x x position of the left-most point (a)\n * @param {number} stage 0-3, stating which part of the wave it is\n * @param {number} waveLength wave length of the sine wave\n * @param {number} amplitude wave amplitude\n */\nfunction getWaterPositions(x, stage, waveLength, amplitude) {\n if (stage === 0) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2, amplitude / 2],\n [x + 1 / 2 * waveLength / Math.PI, amplitude],\n [x + waveLength / 4, amplitude]\n ];\n }\n else if (stage === 1) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2),\n amplitude],\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1),\n amplitude / 2],\n [x + waveLength / 4, 0]\n ]\n }\n else if (stage === 2) {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2, -amplitude / 2],\n [x + 1 / 2 * waveLength / Math.PI, -amplitude],\n [x + waveLength / 4, -amplitude]\n ]\n }\n else {\n return [\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 2),\n -amplitude],\n [x + 1 / 2 * waveLength / Math.PI / 2 * (Math.PI - 1),\n -amplitude / 2],\n [x + waveLength / 4, 0]\n ]\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbGlxdWlkRmlsbExheW91dC5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL3NyYy9saXF1aWRGaWxsTGF5b3V0LmpzP2U5MjMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGVjaGFydHMgPSByZXF1aXJlKCdlY2hhcnRzL2xpYi9lY2hhcnRzJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZWNoYXJ0cy5ncmFwaGljLmV4dGVuZFNoYXBlKHtcbiAgICB0eXBlOiAnZWMtbGlxdWlkLWZpbGwnLFxuXG4gICAgc2hhcGU6IHtcbiAgICAgICAgd2F2ZUxlbmd0aDogMCxcbiAgICAgICAgcmFkaXVzOiAwLFxuICAgICAgICByYWRpdXNZOiAwLFxuICAgICAgICBjeDogMCxcbiAgICAgICAgY3k6IDAsXG4gICAgICAgIHdhdGVyTGV2ZWw6IDAsXG4gICAgICAgIGFtcGxpdHVkZTogMCxcbiAgICAgICAgcGhhc2U6IDAsXG4gICAgICAgIGludmVyc2U6IGZhbHNlXG4gICAgfSxcblxuICAgIGJ1aWxkUGF0aDogZnVuY3Rpb24gKGN0eCwgc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gICAgICAvKipcbiAgICAgICAgICogdG9wLWxlZnQgY29ybmVyIGFzIHN0YXJ0IHBvaW50XG4gICAgICAgICAqXG4gICAgICAgICAqIGRyYXdzIHRoaXMgcG9pbnRcbiAgICAgICAgICogIHxcbiAgICAgICAgICogXFx8L1xuICAgICAgICAgKiAgfn5+fn5+fn5cbiAgICAgICAgICogIHwgICAgICB8XG4gICAgICAgICAqICArLS0tLS0tK1xuICAgICAgICAgKi9cbiAgICAgICAgY3R4Lm1vdmVUbyhsZWZ0LCBzaGFwZS53YXRlckxldmVsKTtcblxuICAgICAgICAvKipcbiAgICAgICAgICogdG9wIHdhdmVcbiAgICAgICAgICpcbiAgICAgICAgICogfn5+fn5+fn4gPC0gZHJhd3MgdGhpcyBzaW5lIHdhdmVcbiAgICAgICAgICogfCAgICAgIHxcbiAgICAgICAgICogKy0tLS0tLStcbiAgICAgICAgICovXG4gICAgICAgIHZhciB3YXZlUmlnaHQgPSAwO1xuICAgICAgICBmb3IgKHZhciBjID0gMDsgYyA8IGN1cnZlczsgKytjKSB7XG4gICAgICAgICAgICB2YXIgc3RhZ2UgPSBjICUgNDtcbiAgICAgICAgICAgIHZhciBwb3MgPSBnZXRXYXRlclBvc2l0aW9ucyhjICogc2hhcGUud2F2ZUxlbmd0aCAvIDQsIHN0YWdlLFxuICAgICAgICAgICAgICAgIHNoYXBlLndhdmVMZW5ndGgsIHNoYXBlLmFtcGxpdHVkZSk7XG4gICAgICAgICAgICBjdHguYmV6aWVyQ3VydmVUbyhwb3NbMF1bMF0gKyBsZWZ0LCAtcG9zWzBdWzFdICsgc2hhcGUud2F0ZXJMZXZlbCxcbiAgICAgICAgICAgICAgICBwb3NbMV1bMF0gKyBsZWZ0LCAtcG9zWzFdWzFdICsgc2hhcGUud2F0ZXJMZXZlbCxcbiAgICAgICAgICAgICAgICBwb3NbMl1bMF0gKyBsZWZ0LCAtcG9zWzJdWzFdICsgc2hhcGUud2F0ZXJMZXZlbCk7XG5cbiAgICAgICAgICAgIGlmIChjID09PSBjdXJ2ZXMgLSAxKSB7XG4gICAgICAgICAgICAgICAgd2F2ZVJpZ2h0ID0gcG9zWzJdWzBdO1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHNoYXBlLmludmVyc2UpIHtcbiAgICAgICAgICAgIC8qKlxuICAgICAgICAgICAgICogdG9wLXJpZ2h0IGNvcm5lclxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAyLiBkcmF3cyB0aGlzIGxpbmVcbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICB8XG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgKy0tLS0tLStcbiAgICAgICAgICAgICAqIDMuIGRyYXdzIHRoaXMgbGluZSAtPiB8ICAgICAgfCA8LSAxLiBkcmF3cyB0aGlzIGxpbmVcbiAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICB+fn5+fn5+flxuICAgICAgICAgICAgICovXG4gICAgICAgICAgICBjdHgubGluZVRvKHdhdmVSaWdodCArIGxlZnQsIHNoYXBlLmN5IC0gc2hhcGUucmFkaXVzWSk7XG4gICAgICAgICAgICBjdHgubGluZVRvKGxlZnQsIHNoYXBlLmN5IC0gc2hhcGUucmFkaXVzWSk7XG4gICAgICAgICAgICBjdHgubGluZVRvKGxlZnQsIHNoYXBlLndhdGVyTGV2ZWwpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgLyoqXG4gICAgICAgICAgICAgKiB0b3AtcmlnaHQgY29ybmVyXG4gICAgICAgICAgICAgKlxuICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgIH5+fn5+fn5+XG4gICAgICAgICAgICAgKiAzLiBkcmF3cyB0aGlzIGxpbmUgLT4gfCAgICAgIHwgPC0gMS4gZHJhd3MgdGhpcyBsaW5lXG4gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgKy0tLS0tLStcbiAgICAgIC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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/liquidFillLayout.js\n"); + +/***/ }), + +/***/ "./src/liquidFillSeries.js": +/*!*********************************!*\ + !*** ./src/liquidFillSeries.js ***! + \*********************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var completeDimensions = __webpack_require__(/*! echarts/lib/data/helper/completeDimensions */ \"./node_modules/echarts/lib/data/helper/completeDimensions.js\");\nvar echarts = __webpack_require__(/*! echarts/lib/echarts */ \"echarts/lib/echarts\");\n\necharts.extendSeriesModel({\n\n type: 'series.liquidFill',\n\n visualColorAccessPath: 'textStyle.normal.color',\n\n optionUpdated: function () {\n var option = this.option;\n option.gridSize = Math.max(Math.floor(option.gridSize), 4);\n },\n\n getInitialData: function (option, ecModel) {\n var dimensions = completeDimensions(['value'], option.data);\n var list = new echarts.List(dimensions, this);\n list.initData(option.data);\n return list;\n },\n\n defaultOption: {\n color: ['#294D99', '#156ACF', '#1598ED', '#45BDFF'],\n center: ['50%', '50%'],\n radius: '50%',\n amplitude: '8%',\n waveLength: '80%',\n phase: 'auto',\n period: 'auto',\n direction: 'right',\n shape: 'circle',\n\n waveAnimation: true,\n animationEasing: 'linear',\n animationEasingUpdate: 'linear',\n animationDuration: 2000,\n animationDurationUpdate: 1000,\n\n outline: {\n show: true,\n borderDistance: 8,\n itemStyle: {\n color: 'none',\n borderColor: '#294D99',\n borderWidth: 8,\n shadowBlur: 20,\n shadowColor: 'rgba(0, 0, 0, 0.25)'\n }\n },\n\n backgroundStyle: {\n color: '#E3F7FF'\n },\n\n itemStyle: {\n opacity: 0.95,\n shadowBlur: 50,\n shadowColor: 'rgba(0, 0, 0, 0.4)'\n },\n\n label: {\n show: true,\n color: '#294D99',\n insideColor: '#fff',\n fontSize: 50,\n fontWeight: 'bold',\n\n align: 'center',\n baseline: 'middle',\n position: 'inside'\n },\n\n emphasis: {\n itemStyle: {\n opacity: 0.8\n }\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbGlxdWlkRmlsbFNlcmllcy5qcy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC8uL3NyYy9saXF1aWRGaWxsU2VyaWVzLmpzP2VkYjEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGNvbXBsZXRlRGltZW5zaW9ucyA9IHJlc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sXG4gICAgICAgIHBlcmlvZDogJ2F1dG8nLFxuICAgICAgICBkaXJlY3Rpb246ICdyaWdodCcsXG4gICAgICAgIHNoYXBlOiAnY2lyY2xlJyxcblxuICAgICAgICB3YXZlQW5pbWF0aW9uOiB0cnVlLFxuICAgICAgICBhbmltYXRpb25FYXNpbmc6ICdsaW5lYXInLFxuICAgICAgICBhbmltYXRpb25FYXNpbmdVcGRhdGU6ICdsaW5lYXInLFxuICAgICAgICBhbmltYXRpb25EdXJhdGlvbjogMjAwMCxcbiAgICAgICAgYW5pbWF0aW9uRHVyYXRpb25VcGRhdGU6IDEwMDAsXG5cbiAgICAgICAgb3V0bGluZToge1xuICAgICAgICAgICAgc2hvdzogdHJ1ZSxcbiAgICAgICAgICAgIGJvcmRlckRpc3RhbmNlOiA4LFxuICAgICAgICAgICAgaXRlbVN0eWxlOiB7XG4gICAgICAgICAgICAgICAgY29sb3I6ICdub25lJyxcbiAgICAgICAgICAgICAgICBib3JkZXJDb2xvcjogJyMyOTREOTknLFxuICAgICAgICAgICAgICAgIGJvcmRlcldpZHRoOiA4LFxuICAgICAgICAgICAgICAgIHNoYWRvd0JsdXI6IDIwLFxuICAgICAgICAgICAgICAgIHNoYWRvd0NvbG9yOiAncmdiYSgwLCAwLCAwLCAwLjI1KSdcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBiYWNrZ3JvdW5kU3R5bGU6IHtcbiAgICAgICAgICAgIGNvbG9yOiAnI0UzRjdGRidcbiAgICAgICAgfSxcblxuICAgICAgICBpdGVtU3R5bGU6IHtcbiAgICAgICAgICAgIG9wYWNpdHk6IDAuOTUsXG4gICAgICAgICAgICBzaGFkb3dCbHVyOiA1MCxcbiAgICAgICAgICAgIHNoYWRvd0NvbG9yOiAncmdiYSgwLCAwLCAwLCAwLjQpJ1xuICAgICAgICB9LFxuXG4gICAgICAgIGxhYmVsOiB7XG4gICAgICAgICAgICBzaG93OiB0cnVlLFxuICAgICAgICAgICAgY29sb3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eries.js\n"); + +/***/ }), + +/***/ "./src/liquidFillView.js": +/*!*******************************!*\ + !*** ./src/liquidFillView.js ***! + \*******************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("var echarts = __webpack_require__(/*! echarts/lib/echarts */ \"echarts/lib/echarts\");\nvar numberUtil = echarts.number;\nvar symbolUtil = __webpack_require__(/*! echarts/lib/util/symbol */ \"./node_modules/echarts/lib/util/symbol.js\");\nvar parsePercent = numberUtil.parsePercent;\n\nvar LiquidLayout = __webpack_require__(/*! ./liquidFillLayout */ \"./src/liquidFillLayout.js\");\n\nfunction getShallow(model, path) {\n return model && model.getShallow(path);\n}\n\necharts.extendChartView({\n\n type: 'liquidFill',\n\n render: function (seriesModel, ecModel, api) {\n var group = this.group;\n group.removeAll();\n\n var data = seriesModel.getData();\n\n var itemModel = data.getItemModel(0);\n\n var center = itemModel.get('center');\n var radius = itemModel.get('radius');\n\n var width = api.getWidth();\n var height = api.getHeight();\n var size = Math.min(width, height);\n // itemStyle\n var outlineDistance = 0;\n var outlineBorderWidth = 0;\n var showOutline = seriesModel.get('outline.show');\n\n if (showOutline) {\n outlineDistance = seriesModel.get('outline.borderDistance');\n outlineBorderWidth = parsePercent(\n seriesModel.get('outline.itemStyle.borderWidth'), size\n );\n }\n\n var cx = parsePercent(center[0], width);\n var cy = parsePercent(center[1], height);\n\n var outterRadius;\n var innerRadius;\n var paddingRadius;\n\n var isFillContainer = false;\n\n var symbol = seriesModel.get('shape');\n if (symbol === 'container') {\n // a shape that fully fills the container\n isFillContainer = true;\n\n outterRadius = [\n width / 2,\n height / 2\n ];\n innerRadius = [\n outterRadius[0] - outlineBorderWidth / 2,\n outterRadius[1] - outlineBorderWidth / 2\n ];\n paddingRadius = [\n parsePercent(outlineDistance, width),\n parsePercent(outlineDistance, height)\n ];\n\n radius = [\n Math.max(innerRadius[0] - paddingRadius[0], 0),\n Math.max(innerRadius[1] - paddingRadius[1], 0)\n ];\n }\n else {\n outterRadius = parsePercent(radius, size) / 2;\n innerRadius = outterRadius - outlineBorderWidth / 2;\n paddingRadius = parsePercent(outlineDistance, size);\n\n radius = Math.max(innerRadius - paddingRadius, 0);\n }\n\n if (showOutline) {\n var outline = getOutline();\n outline.style.lineWidth = outlineBorderWidth;\n group.add(getOutline());\n }\n\n var left = isFillContainer ? 0 : cx - radius;\n var top = isFillContainer ? 0 : cy - radius;\n\n var wavePath = null;\n\n group.add(getBackground());\n\n // each data item for a wave\n var oldData = this._data;\n var waves = [];\n data.diff(oldData)\n .add(function (idx) {\n var wave = getWave(idx, false);\n\n var waterLevel = wave.shape.waterLevel;\n wave.shape.waterLevel = isFillContainer ? height / 2 : radius;\n echarts.graphic.initProps(wave, {\n shape: {\n waterLevel: waterLevel\n }\n }, seriesModel);\n\n wave.z2 = 2;\n setWaveAnimation(idx, wave, null);\n\n group.add(wave);\n data.setItemGraphicEl(idx, wave);\n waves.push(wave);\n })\n .update(function (newIdx, oldIdx) {\n var waveElement = oldData.getItemGraphicEl(oldIdx);\n\n // new wave is used to calculate position, but not added\n var newWave = getWave(newIdx, false, waveElement);\n\n // changes with animation\n var shape = {};\n var shapeAttrs = ['amplitude', 'cx', 'cy', 'phase', 'radius', 'radiusY', 'waterLevel', 'waveLength'];\n for (var i = 0; i < shapeAttrs.length; ++i) {\n var attr = shapeAttrs[i];\n if (newWave.shape.hasOwnProperty(attr)) {\n shape[attr] = newWave.shape[attr];\n }\n }\n\n var style = {};\n var styleAttrs = ['fill', 'opacity', 'shadowBlur', 'shadowColor'];\n for (var i = 0; i < styleAttrs.length; ++i) {\n var attr = styleAttrs[i];\n if (newWave.style.hasOwnProperty(attr)) {\n style[attr] = newWave.style[attr];\n }\n }\n\n if (isFillContainer) {\n shape.radiusY = height / 2;\n }\n\n // changes with animation\n echarts.graphic.updateProps(waveElement, {\n shape: shape,\n style: style\n }, seriesModel);\n\n // instant changes\n waveElement.position = newWave.position;\n waveElement.setClipPath(newWave.clipPath);\n waveElement.shape.inverse = newWave.inverse;\n\n setWaveAnimation(newIdx, waveElement, waveElement);\n group.add(waveElement);\n data.setItemGraphicEl(newIdx, waveElement);\n waves.push(waveElement);\n })\n .remove(function (idx) {\n var wave = oldData.getItemGraphicEl(idx);\n group.remove(wave);\n })\n .execute();\n\n if (itemModel.get('label.show')) {\n group.add(getText(waves));\n }\n\n this._data = data;\n\n /**\n * Get path for outline, background and clipping\n *\n * @param {number} r outter radius of shape\n * @param {boolean|undefined} isForClipping if the shape is used\n * for clipping\n */\n function getPath(r, isForClipping) {\n if (symbol) {\n // customed symbol path\n if (symbol.indexOf('path://') === 0) {\n var path = echarts.graphic.makePath(symbol.slice(7), {});\n var bouding = path.getBoundingRect();\n var w = bouding.width;\n var h = bouding.height;\n if (w > h) {\n h = r * 2 / w * h;\n w = r * 2;\n }\n else {\n w = r * 2 / h * w;\n h = r * 2;\n }\n\n var left = isForClipping ? 0 : cx - w / 2;\n var top = isForClipping ? 0 : cy - h / 2;\n path = echarts.graphic.makePath(\n symbol.slice(7),\n {},\n new echarts.graphic.BoundingRect(left, top, w, h)\n );\n if (isForClipping) {\n path.position = [-w / 2, -h / 2];\n }\n return path;\n }\n else if (isFillContainer) {\n // fully fill the container\n var x = isForClipping ? -r[0] : cx - r[0];\n var y = isForClipping ? -r[1] : cy - r[1];\n return symbolUtil.createSymbol(\n 'rect', x, y, r[0] * 2, r[1] * 2\n );\n }\n else {\n var x = isForClipping ? -r : cx - r;\n var y = isForClipping ? -r : cy - r;\n if (symbol === 'pin') {\n y += r;\n }\n else if (symbol === 'arrow') {\n y -= r;\n }\n return symbolUtil.createSymbol(symbol, x, y, r * 2, r * 2);\n }\n }\n\n return new echarts.graphic.Circle({\n shape: {\n cx: isForClipping ? 0 : cx,\n cy: isForClipping ? 0 : cy,\n r: r\n }\n });\n }\n /**\n * Create outline\n */\n function getOutline() {\n var outlinePath = getPath(outterRadius);\n outlinePath.style.fill = null;\n\n outlinePath.setStyle(seriesModel.getModel('outline.itemStyle')\n .getItemStyle());\n\n return outlinePath;\n }\n\n /**\n * Create background\n */\n function getBackground() {\n // Seperate stroke and fill, so we can use stroke to cover the alias of clipping.\n var strokePath = getPath(radius);\n strokePath.setStyle(seriesModel.getModel('backgroundStyle')\n .getItemStyle());\n strokePath.style.fill = null;\n\n // Stroke is front of wave\n strokePath.z2 = 5;\n\n var fillPath = getPath(radius);\n fillPath.setStyle(seriesModel.getModel('backgroundStyle')\n .getItemStyle());\n fillPath.style.stroke = null;\n\n var group = new echarts.graphic.Group();\n group.add(strokePath);\n group.add(fillPath);\n\n return group;\n }\n\n /**\n * wave shape\n */\n function getWave(idx, isInverse, oldWave) {\n var radiusX = isFillContainer ? radius[0] : radius;\n var radiusY = isFillContainer ? height / 2 : radius;\n\n var itemModel = data.getItemModel(idx);\n var itemStyleModel = itemModel.getModel('itemStyle');\n var phase = itemModel.get('phase');\n var amplitude = parsePercent(itemModel.get('amplitude'),\n radiusY * 2);\n var waveLength = parsePercent(itemModel.get('waveLength'),\n radiusX * 2);\n\n var value = data.get('value', idx);\n var waterLevel = radiusY - value * radiusY * 2;\n phase = oldWave ? oldWave.shape.phase\n : (phase === 'auto' ? idx * Math.PI / 4 : phase);\n var normalStyle = itemStyleModel.getItemStyle();\n if (!normalStyle.fill) {\n var seriesColor = seriesModel.get('color');\n var id = idx % seriesColor.length;\n normalStyle.fill = seriesColor[id];\n }\n\n var x = radiusX * 2;\n var wave = new LiquidLayout({\n shape: {\n waveLength: waveLength,\n radius: radiusX,\n radiusY: radiusY,\n cx: x,\n cy: 0,\n waterLevel: waterLevel,\n amplitude: amplitude,\n phase: phase,\n inverse: isInverse\n },\n style: normalStyle,\n position: [cx, cy]\n });\n wave.shape._waterLevel = waterLevel;\n\n var hoverStyle = itemModel.getModel('emphasis.itemStyle')\n .getItemStyle();\n hoverStyle.lineWidth = 0;\n echarts.graphic.setHoverStyle(wave, hoverStyle);\n\n // clip out the part outside the circle\n var clip = getPath(radius, true);\n // set fill for clipPath, otherwise it will not trigger hover event\n clip.setStyle({\n fill: 'white'\n });\n wave.setClipPath(clip);\n\n return wave;\n }\n\n function setWaveAnimation(idx, wave, oldWave) {\n var itemModel = data.getItemModel(idx);\n\n var maxSpeed = itemModel.get('period');\n var direction = itemModel.get('direction');\n\n var value = data.get('value', idx);\n\n var phase = itemModel.get('phase');\n phase = oldWave ? oldWave.shape.phase\n : (phase === 'auto' ? idx * Math.PI / 4 : phase);\n\n var defaultSpeed = function (maxSpeed) {\n var cnt = data.count();\n return cnt === 0 ? maxSpeed : maxSpeed *\n (0.2 + (cnt - idx) / cnt * 0.8);\n };\n var speed = 0;\n if (maxSpeed === 'auto') {\n speed = defaultSpeed(5000);\n }\n else {\n speed = typeof maxSpeed === 'function'\n ? maxSpeed(value, idx) : maxSpeed;\n }\n\n // phase for moving left/right\n var phaseOffset = 0;\n if (direction === 'right' || direction == null) {\n phaseOffset = Math.PI;\n }\n else if (direction === 'left') {\n phaseOffset = -Math.PI;\n }\n else if (direction === 'none') {\n phaseOffset = 0;\n }\n else {\n console.error('Illegal direction value for liquid fill.');\n }\n\n // wave animation of moving left/right\n if (direction !== 'none' && itemModel.get('waveAnimation')) {\n wave\n .animate('shape', true)\n .when(0, {\n phase: phase\n })\n .when(speed / 2, {\n phase: phaseOffset + phase\n })\n .when(speed, {\n phase: phaseOffset * 2 + phase\n })\n .during(function () {\n if (wavePath) {\n wavePath.dirty(true);\n }\n })\n .start();\n }\n }\n\n /**\n * text on wave\n */\n function getText(waves) {\n var labelModel = itemModel.getModel('label');\n\n function formatLabel() {\n var formatted = seriesModel.getFormattedLabel(0, 'normal');\n var defaultVal = (data.get('value', 0) * 100);\n var defaultLabel = data.getName(0) || seriesModel.name;\n if (!isNaN(defaultVal)) {\n defaultLabel = defaultVal.toFixed(0) + '%';\n }\n return formatted == null ? defaultLabel : formatted;\n }\n\n var textOption = {\n z2: 10,\n shape: {\n x: left,\n y: top,\n width: (isFillContainer ? radius[0] : radius) * 2,\n height: (isFillContainer ? radius[1] : radius) * 2\n },\n style: {\n fill: 'transparent',\n text: formatLabel(),\n textAlign: labelModel.get('align'),\n textVerticalAlign: labelModel.get('baseline')\n },\n silent: true\n };\n\n var outsideTextRect = new echarts.graphic.Rect(textOption);\n var color = labelModel.get('color');\n echarts.graphic.setText(outsideTextRect.style, labelModel, color);\n\n var insideTextRect = new echarts.graphic.Rect(textOption);\n var insColor = labelModel.get('insideColor');\n echarts.graphic.setText(insideTextRect.style, labelModel, insColor);\n insideTextRect.style.textFill = insColor;\n\n var group = new echarts.graphic.Group();\n group.add(outsideTextRect);\n group.add(insideTextRect);\n\n // clip out waves for insideText\n var boundingCircle = getPath(radius, true);\n\n wavePath = new echarts.graphic.CompoundPath({\n shape: {\n paths: waves\n },\n position: [cx, cy]\n });\n\n wavePath.setClipPath(boundingCircle);\n insideTextRect.setClipPath(wavePath);\n\n return group;\n }\n },\n\n dispose: function () {\n // dispose nothing here\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvbGlxdWlkRmlsbFZpZXcuanMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9lY2hhcnRzLWxpcXVpZGZpbGwvLi9zcmMvbGlxdWlkRmlsbFZpZXcuanM/NmE0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZWNoYXJ0cyA9IHJlcXVpcmUoJ2VjaGFydHMvbGliL2VjaGFydHMnKTtcbnZhciBudW1iZXJVdGlsID0gZWNoYXJ0cy5udW1iZXI7XG52YXIgc3ltYm9sVXRpbCA9IHJlcXVpcmUoJ2VjaGFydHMvbGliL3V0aWwvc3ltYm9sJyk7XG52YXIgcGFyc2VQZXJjZW50ID0gbnVtYmVyVXRpbC5wYXJzZVBlcmNlbnQ7XG5cbnZhciBMaXF1aWRMYXlvdXQgPSByZXF1aXJlKCcuL2xpcXVpZEZpbGxMYXlvdXQnKTtcblxuZnVuY3Rpb24gZ2V0U2hhbGxvdyhtb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mRlcldpZHRoID0gcGFyc2VQZXJjZW50KFxuICAgICAgICAgICAgICAgIHNlcmllc01vZGVsLmdldCgnb3V0bGluZS5pdGVtU3R5bGUuYm9yZGVyV2lkdGgnKSwgc2l6ZVxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBjeCA9IHBhcnNlUGVyY2VudChjZW50ZXJbMF0sIHdpZHRoKTtcbiAgICAgICAgdmFyIGN5ID0gcGFyc2VQZXJjZW50KGNlbnRlclsxXSwgaGVpZ2h0KTtcblxuICAgICAgICB2YXIgb3V0dGVyUmFkaXVzO1xuICAgICAgICB2YXIgaW5uZXJSYWRpdXM7XG4gICAgICAgIHZhciBwYWRkaW5nUmFkaXVzO1xuXG4gICAgICAgIHZhciBpc0ZpbGxDb250YWluZXIgPSBmYWxzZTtcblxuICAgICAgICB2YXIgc3ltYm9sID0gc2VyaWVzTW9kZWwuZ2V0KCdzaGFwZScpO1xuICAgICAgICBpZiAoc3ltYm9sID09PSAnY29udGFpbmVyJykge1xuICAgICAgICAgICAgLy8gYSBzaGFwZSB0aGF0IGZ1bGx5IGZpbGxzIHRoZSBjb250YWluZXJcbiAgICAgICAgICAgIGlzRmlsbENvbnRhaW5lciA9IHRydWU7XG5cbiAgICAgICAgICAgIG91dHRlclJhZGl1cyA9IFtcbiAgICAgICAgICAgICAgICB3aWR0aCAvIDIsXG4gICAgICAgICAgICAgICAgaGVpZ2h0IC8gMlxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIGlubmVyUmFkaXVzID0gW1xuICAgICAgICAgICAgICAgIG91dHRlclJhZGl1c1swXSAtIG91dGxpbmVCb3JkZXJXaWR0aCAvIDIsXG4gICAgICAgICAgICAgICAgb3V0dGVyUmFkaXVzWzFdIC0gb3V0bGluZUJvcmRlcldpZHRoIC8gMlxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIHBhZGRpbmdSYWRpdXMgPSBbXG4gICAgICAgICAgICAgICAgcGFyc2VQZXJjZW50KG91dGxpbmVEaXN0YW5jZSwgd2lkdGgpLFxuICAgICAgICAgICAgICAgIHBhcnNlUGVyY2VudChvdXRsaW5lRGlzdGFuY2UsIGhlaWdodClcbiAgICAgICAgICAgIF07XG5cbiAgICAgICAgICAgIHJhZGl1cyA9IFtcbiAgICAgICAgICAgICAgICBNYXRoLm1heChpbm5lclJhZGl1c1swXSAtIHBhZGRpbmdSYWRpdXNbMF0sIDApLFxuICAgICAgICAgICAgICAgIE1hdGgubWF4KGlubmVyUmFkaXVzWzFdIC0gcGFkZGluZ1JhZGl1c1sxXSwgMClcbiAgICAgICAgICAgIF07XG4gICAgICAgIH1cbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBvdXR0ZXJSYWRpdXMgPSBwYXJzZVBlcmNlbnQocmFkaXVzLCBzaXplKSAvIDI7XG4gICAgICAgICAgICBpbm5lclJhZGl1cyA9IG91dHRlclJhZGl1cyAtIG91dGxpbmVCb3JkZXJXaWR0aCAvIDI7XG4gICAgICAgICAgICBwYWRkaW5nUmFkaXVzID0gcGFyc2VQZXJjZW50KG91dGxpbmVEaXN0YW5jZSwgc2l6ZSk7XG5cbiAgICAgICAgICAgIHJhZGl1cyA9IE1hdGgubWF4KGlubmVyUmFkaXVzIC0gcGFkZGluZ1JhZGl1cywgMCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoc2hvd091dGxpbmUpIHtcbiAgICAgICAgICAgIHZhciBvdXRsaW5lID0gZ2V0T3V0bGluZSgpO1xuICAgICAgICAgICAgb3V0bGluZS5zdHlsZS5saW5lV2lkdGggPSBvdXRsaW5lQm9yZGVyV2lkdGg7XG4gICAgICAgICAgICBncm91cC5hZGQoZ2V0T3V0bGluZSgpKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHZhciBsZWZ0ID0gaXNGaWxsQ29udGFpbmVyID8gMCA6IGN4IC0gcmFkaXVzO1xuICAgICAgICB2YXIgdG9wID0gaXNGaWxsQ29udGFpbmVyID8gMCA6IGN5IC0gcmFkaXVzO1xuXG4gICAgICAgIHZhciB3YXZlUGF0aCA9IG51bGw7XG5cbiAgICAgICAgZ3JvdXAuYWRkKGdldEJhY2tncm91bmQoKSk7XG5cbiAgICAgICAgLy8gZWFjaCBkYXRhIGl0ZW0gZm9yIGEgd2F2ZVxuICAgICAgICB2YXIgb2xkRGF0YSA9IHRoaXMuX2RhdGE7XG4gICAgICAgIHZhciB3YXZlcyA9IFtdO1xuICAgICAgICBkYXRhLmRpZmYob2xkRGF0YSlcbiAgICAgICAgICAgIC5hZGQoZnVuY3Rpb24gKGlkeCkge1xuICAgICAgICAgICAgICAgIHZhciB3YXZlID0gZ2V0V2F2ZShpZHgsIGZhbHNlKTtcblxuICAgICAgICAgICAgICAgIHZhciB3YXRlckxldmVsID0gd2F2ZS5zaGFwZS53YXRlckxldmVsO1xuICAgICAgICAgICAgICAgIHdhdmUuc2hhcGUud2F0ZXJMZXZlbCA9IGlzRmlsbENvbnRhaW5lciA/IGhlaWdodCAvIDIgOiByYWRpdXM7XG4gICAgICAgICAgICAgICAgZWNoYXJ0cy5ncmFwaGljLmluaXRQcm9wcyh3YXZlLCB7XG4gICAgICAgICAgICAgICAgICAgIHNoYXBlOiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3YXRlckxldmVsOiB3YXRlckxldmVsXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LCBzZXJpZXNNb2RlbCk7XG5cbiAgICAgICAgICAgICAgICB3YXZlLnoyID0gMjtcbiAgICAgICAgICAgICAgICBzZXRXYXZlQW5pbWF0aW9uKGlkeCwgd2F2ZSwgbnVsbCk7XG5cbiAgICAgICAgICAgICAgICBncm91cC5hZGQod2F2ZSk7XG4gICAgICAgICAgICAgICAgZGF0YS5zZXRJdGVtR3JhcGhpY0VsKGlkeCwgd2F2ZSk7XG4gICAgICAgICAgICAgICAgd2F2ZXMucHVzaCh3YXZlKTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAudXBkYXRlKGZ1bmN0aW9uIChuZXdJZHgsIG9sZElkeCkge1xuICAgICAgICAgICAgICAgIHZhciB3YXZlRWxlbWVudCA9IG9sZERhdGEuZ2V0SXRlbUdyYXBoaWNFbChvbGRJZHgpO1xuXG4gICAgICAgICAgICAgICAgLy8gbmV3IHdhdmUgaXMgdXNlZCB0byBjYWxjdWxhdGUgcG9zaXRpb24sIGJ1dCBub3QgYWRkZWRcbiAgICAgICAgICAgICAgICB2YXIgbmV3V2F2ZSA9IGdldFdhdmUobmV3SWR4LCBmYWxzZSwgd2F2ZUVsZW1lbnQpO1xuXG4gICAgICAgICAgICAgICAgLy8gY2hhbmdlcyB3aXRoIGFuaW1hdGlvblxuICAgICAgICAgICAgICAgIHZhciBzaGFwZSA9IHt9O1xuICAgICAgICAgICAgICAgIHZhciBzaGFwZUF0dHJzID0gWydhbXBsaXR1ZGUnLCAnY3gnLCAnY3knLCAncGhhc2UnLCAncmFkaXVzJywgJ3JhZGl1c1knLCAnd2F0ZXJMZXZlbCcsICd3YXZlTGVuZ3RoJ107XG4gICAgICAgICAgICAgICAgZm9yICh2YXIgaSA9IDA7IGkgPCBzaGFwZUF0dHJzLmxlbmd0aDsgKytpKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBhdHRyID0gc2hhcGVBdHRyc1tpXTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKG5ld1dhdmUuc2hhcGUuaGFzT3duUHJvcGVydHkoYXR0cikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNoYXBlW2F0dHJdID0gbmV3V2F2ZS5zaGFwZVthdHRyXTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHZhciBzdHlsZSA9IHt9O1xuICAgICAgICAgICAgICAgIHZhciBzdHlsZUF0dHJzID0gWydmaWxsJywgJ29wYWNpdHknLCAnc2hhZG93Qmx1cicsICdzaGFkb3dDb2xvciddO1xuICAgICAgICAgICAgICAgIGZvciAodmFyIGkgPSAwOyBpIDwgc3R5bGVBdHRycy5sZW5ndGg7ICsraSkge1xuICAgICAgICAgICAgICAgICAgICB2YXIgYXR0ciA9IHN0eWxlQXR0cnNbaV07XG4gICAgICAgICAgICAgICAgICAgIGlmIChuZXdXYXZlLnN0eWxlLmhhc093blByb3BlcnR5KGF0dHIpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHlsZVthdHRyXSA9IG5ld1dhdmUuc3R5bGVbYXR0cl07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBpZiAoaXNGaWxsQ29udGFpbmVyKSB7XG4gICAgICAgICAgICAgICAgICAgIHNoYXBlLnJhZGl1c1kgPSBoZWlnaHQgLyAyO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vIGNoYW5nZXMgd2l0aCBhbmltYXRpb25cbiAgICAgICAgICAgICAgICBlY2hhcnRzLmdyYXBoaWMudXBkYXRlUHJvcHMod2F2ZUVsZW1lbnQsIHtcbiAgICAgICAgICAgICAgICAgICAgc2hhcGU6IHNoYXBlLFxuICAgICAgICAgICAgICAgICAgICBzdHlsZTogc3R5bGVcbiAgICAgICAgICAgICAgICB9LCBzZXJpZXNNb2RlbCk7XG5cbiAgICAgICAgICAgICAgICAvLyBpbnN0YW50IGNoYW5nZXNcbiAgICAgICAgICAgICAgICB3YXZlRWxlbWVudC5wb3NpdGlvbiA9IG5ld1dhdmUucG9zaXRpb247XG4gICAgICAgICAgICAgICAgd2F2ZUVsZW1lbnQuc2V0Q2xpcFBhdGgobmV3V2F2ZS5jbGlwUGF0aCk7XG4gICAgICAgICAgICAgICAgd2F2ZUVsZW1lbnQuc2hhcGUuaW52ZXJzZSA9IG5ld1dhdmUuaW52ZXJzZTtcblxuICAgICAgICAgICAgICAgIHNldFdhdmVBbmltYXRpb24obmV3SWR4LCB3YXZlRWxlbWVudCwgd2F2ZUVsZW1lbnQpO1xu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yBjdXN0b21lZCBzeW1ib2wgcGF0aFxuICAgICAgICAgICAgICAgIGlmIChzeW1ib2wuaW5kZXhPZigncGF0aDovLycpID09PSAwKSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciBwYXRoID0gZWNoYXJ0cy5ncmFwaGljLm1ha2VQYXRoKHN5bWJvbC5zbGljZSg3KSwge30pO1xuICAgICAgICAgICAgICAgICAgICB2YXIgYm91ZGluZyA9IHBhdGguZ2V0Qm91bmRpbmdSZWN0KCk7XG4gICAgICAgICAgICAgICAgICAgIHZhciB3ID0gYm91ZGluZy53aWR0aDtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGggPSBib3VkaW5nLmhlaWdodDtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHcgPiBoKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBoID0gciAqIDIgLyB3ICogaDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHcgPSByICogMjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHcgPSByICogMiAvIGggKiB3O1xuICAgICAgICAgICAgICAgICAgICAgICAgaCA9IHIgKiAyO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdmFyIGxlZnQgPSBpc0ZvckNsaXBwaW5nID8gMCA6IGN4IC0gdyAvIDI7XG4gICAgICAgICAgICAgICAgICAgIHZhciB0b3AgPSBpc0ZvckNsaXBwaW5nID8gMCA6IGN5IC0gaCAvIDI7XG4gICAgICAgICAgICAgICAgICAgIHBhdGggPSBlY2hhcnRzLmdyYXBoaWMubWFrZVBhdGgoXG4gICAgICAgICAgICAgICAgICAgICAgICBzeW1ib2wuc2xpY2UoNyksXG4gICAgICAgICAgICAgICAgICAgICAgICB7fSxcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBlY2hhcnRzLmdyYXBoaWMuQm91bmRpbmdSZWN0KGxlZnQsIHRvcCwgdywgaClcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGlzRm9yQ2xpcHBpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhdGgucG9zaXRpb24gPSBbLXcgLyAyLCAtaCAvIDJdO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwYXRoO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBlbHNlIGlmIChpc0ZpbGxDb250YWluZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgLy8gZnVsbHkgZmlsbCB0aGUgY29udGFpbmVyXG4gICAgICAgICAgICAgICAgICAgIHZhciB4ID0gaXNGb3JDbGlwcGluZyA/IC1yWzBdIDogY3ggLSByWzBdO1xuICAgICAgICAgICAgICAgICAgICB2YXIgeSA9IGlzRm9yQ2xpcHBpbmcgPyAtclsxXSA6IGN5IC0gclsxXTtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN5bWJvbFV0aWwuY3JlYXRlU3ltYm9sKFxuICAgICAgICAgICAgICAgICAgICAgICAgJ3JlY3QnLCB4LCB5LCByWzBdICogMiwgclsxXSAqIDJcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHZhciB4ID0gaXNGb3JDbGlwcGluZyA/IC1yIDogY3ggLSByO1xuICAgICAgICAgICAgICAgICAgICB2YXIgeSA9IGlzRm9yQ2xpcHBpbmcgPyAtciA6IGN5IC0gcjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHN5bWJvbCA9PT0gJ3BpbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHkgKz0gcjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzeW1ib2wgPT09ICdhcnJvdycpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHkgLT0gcjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3ltYm9sVXRpbC5jcmVhdGVTeW1ib2woc3ltYm9sLCB4LCB5LCByICogMiwgciAqIDIpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIG5ldyBlY2hhcnRzLmdyYXBoaWMuQ2lyY2xlKHtcbiAgICAgICAgICAgICAgICBzaGFwZToge1xuICAgICAgICAgICAgICAgICAgICBjeDogaXNGb3JDbGlwcGluZyA/IDAgOiBjeCxcbiAgICAgICAgICAgICAgICAgICAgY3k6IGlzRm9yQ2xpcHBpbmcgPyAwIDogY3ksXG4gICAgICAgICAgICAgICAgICAgIHI6IHJcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICAvKipcbiAgICAgICAgICogQ3JlYXRlIG91dGxpbmVcbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGdldE91dGxpbmUoKSB7XG4gICAgICAgICAgICB2YXIgb3V0bGluZVBhdGggPSBnZXRQYXRoKG91dHRlclJhZGl1cyk7XG4gICAgICAgICAgICBvdXRsaW5lUGF0aC5zdHlsZS5maWxsID0gbnVsbDtcblxuICAgICAgICAgICAgb3V0bGluZVBhdGguc2V0U3R5bGUoc2VyaWVzTW9kZWwuZ2V0TW9kZWwoJ291dGxpbmUuaXRlbVN0eWxlJylcbiAgICAgICAgICAgICAgICAuZ2V0SXRlbVN0eWxlKCkpO1xuXG4gICAgICAgICAgICByZXR1cm4gb3V0bGluZVBhdGg7XG4gICAgICAgIH1cblxuICAgICAgICAvKipcbiAgICAgICAgICogQ3JlYXRlIGJhY2tncm91bmRcbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGdldEJhY2tncm91bmQoKSB7XG4gICAgICAgICAgICAvLyBTZXBlcmF0ZSB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XJpZXNDb2xvciA9IHNlcmllc01vZGVsLmdldCgnY29sb3InKTtcbiAgICAgICAgICAgICAgICB2YXIgaWQgPSBpZHggJSBzZXJpZXNDb2xvci5sZW5ndGg7XG4gICAgICAgICAgICAgICAgbm9ybWFsU3R5bGUuZmlsbCA9IHNlcmllc0NvbG9yW2lkXTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHggPSByYWRpdXNYICogMjtcbiAgICAgICAgICAgIHZhciB3YXZlID0gbmV3IExpcXVpZExheW91dCh7XG4gICAgICAgICAgICAgICAgc2hhcGU6IHtcbiAgICAgICAgICAgICAgICAgICAgd2F2ZUxlbmd0aDogd2F2ZUxlbmd0aCxcbiAgICAgICAgICAgICAgICAgICAgcmFkaXVzOiByYWRpdXNYLFxuICAgICAgICAgICAgICAgICAgICByYWRpdXNZOiByYWRpdXNZLFxuICAgICAgICAgICAgICAgICAgICBjeDogeCxcbiAgICAgICAgICAgICAgICAgICAgY3k6IDAsXG4gICAgICAgICAgICAgICAgICAgIHdhdGVyTGV2ZWw6IHdhdGVyTGV2ZWwsXG4gICAgICAgICAgICAgICAgICAgIGFtcGxpdHVkZTogYW1wbGl0dWRlLFxuICAgICAgICAgICAgICAgICAgICBwaGFzZTogcGhhc2UsXG4gICAgICAgICAgICAgICAgICAgIGludmVyc2U6IGlzSW52ZXJzZVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgc3R5bGU6IG5vcm1hbFN0eWxlLFxuICAgICAgICAgICAgICAgIHBvc2l0aW9uOiBbY3gsIGN5XVxuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB3YXZlLnNoYXBlLl93YXRlckxldmVsID0gd2F0ZXJMZXZlbDtcblxuICAgICAgICAgICAgdmFyIGhvdmVyU3R5bGUgPSBpdGVtTW9kZWwuZ2V0TW9kZWwoJ2VtcGhhc2lzLml0ZW1TdHlsZScpXG4gICAgICAgICAgICAgICAgLmdldEl0ZW1TdHlsZSgpO1xuICAg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A6IChwaGFzZSA9PT0gJ2F1dG8nID8gaWR4ICogTWF0aC5QSSAvIDQgOiBwaGFzZSk7XG5cbiAgICAgICAgICAgIHZhciBkZWZhdWx0U3BlZWQgPSBmdW5jdGlvbiAobWF4U3BlZWQpIHtcbiAgICAgICAgICAgICAgICB2YXIgY250ID0gZGF0YS5jb3VudCgpO1xuICAgICAgICAgICAgICAgIHJldHVybiBjbnQgPT09IDAgPyBtYXhTcGVlZCA6IG1heFNwZWVkICpcbiAgICAgICAgICAgICAgICAgICAgKDAuMiArIChjbnQgLSBpZHgpIC8gY250ICogMC44KTtcbiAgICAgICAgICAgIH07XG4gICAgICAgICAgICB2YXIgc3BlZWQgPSAwO1xuICAgICAgICAgICAgaWYgKG1heFNwZWVkID09PSAnYXV0bycpIHtcbiAgICAgICAgICAgICAgICBzcGVlZCA9IGRlZmF1bHRTcGVlZCg1MDAwKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgICAgIHNwZWVkID0gdHlwZW9mIG1heFNwZWVkID09PSAnZnVuY3Rpb24nXG4gICAgICAgICAgICAgICAgICAgID8gbWF4U3BlZWQodmFsdWUsIGlkeCkgOiBtYXhTcGVlZDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgLy8gcGhhc2UgZm9yIG1vdmluZyBsZWZ0L3JpZ2h0XG4gICAgICAgICAgICB2YXIgcGhhc2VPZmZzZXQgPSAwO1xuICAgICAgICAgICAgaWYgKGRpcmVjdGlvbiA9PT0gJ3JpZ2h0JyB8fCBkaXJlY3Rpb24gPT0gbnVsbCkge1xuICAgICAgICAgICAgICAgIHBoYXNlT2Zmc2V0ID0gTWF0aC5QSTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGRpcmVjdGlvbiA9PT0gJ2xlZnQnKSB7XG4gICAgICAgICAgICAgICAgcGhhc2VPZmZzZXQgPSAtTWF0aC5QSTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2UgaWYgKGRpcmVjdGlvbiA9PT0gJ25vbmUnKSB7XG4gICAgICAgICAgICAgICAgcGhhc2VPZmZzZXQgPSAwO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignSWxsZWdhbCBkaXJlY3Rpb24gdmFsdWUgZm9yIGxpcXVpZCBmaWxsLicpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyB3YXZlIGFuaW1hdGlvbiBvZiBtb3ZpbmcgbGVmdC9yaWdodFxuICAgICAgICAgICAgaWYgKGRpcmVjdGlvbiAhPT0gJ25vbmUnICYmIGl0ZW1Nb2RlbC5nZXQoJ3dhdmVBbmltYXRpb24nKSkge1xuICAgICAgICAgICAgICAgIHdhdmVcbiAgICAgICAgICAgICAgICAgICAgLmFuaW1hdGUoJ3NoYXBlJywgdHJ1ZSlcbiAgICAgICAgICAgICAgICAgICAgLndoZW4oMCwge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGhhc2U6IHBoYXNlXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC53aGVuKHNwZWVkIC8gMiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgcGhhc2U6IHBoYXNlT2Zmc2V0ICsgcGhhc2VcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLndoZW4oc3BlZWQsIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHBoYXNlOiBwaGFzZU9mZnNldCAqIDIgKyBwaGFzZVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuZHVyaW5nKGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3YXZlUGF0aCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdhdmVQYXRoLmRpcnR5KHRydWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAuc3RhcnQoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIC8qKlxuICAgICAgICAgKiB0ZXh0IG9uIHdhdmVcbiAgICAgICAgICovXG4gICAgICAgIGZ1bmN0aW9uIGdldFRleHQod2F2ZXMpIHtcbiAgICAgICAgICAgIHZhciBsYWJlbE1vZGVsID0gaXRlbU1vZGVsLmdldE1vZGVsKCdsYWJlbCcpO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiBmb3JtYXRMYWJlbCgpIHtcbiAgICAgICAgICAgICAgICB2YXIgZm9ybWF0dGVkID0gc2VyaWVzTW9kZWwuZ2V0Rm9ybWF0dGVkTGFiZWwoMCwgJ25vcm1hbCcpO1xuICAgICAgICAgICAgICAgIHZhciBkZWZhdWx0VmFsID0gKGRhdGEuZ2V0KCd2YWx1ZScsIDApICogMTAwKTtcbiAgICAgICAgICAgICAgICB2YXIgZGVmYXVsdExhYmVsID0gZGF0YS5nZXROYW1lKDApIHx8IHNlcmllc01vZGVsLm5hbWU7XG4gICAgICAgICAgICAgICAgaWYgKCFpc05hTihkZWZhdWx0VmFsKSkge1xuICAgICAgICAgICAgICAgICAgICBkZWZhdWx0TGFiZWwgPSBkZWZhdWx0VmFsLnRvRml4ZWQoMCkgKyAnJSc7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiBmb3JtYXR0ZWQgPT0gbnVsbCA/IGRlZmF1bHRMYWJlbCA6IGZvcm1hdHRlZDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdmFyIHRleHRPcHRpb24gPSB7XG4gICAgICAgICAgICAgICAgejI6IDEwLFxuICAgICAgICAgICAgICAgIHNoYXBlOiB7XG4gICAgICAgICAgICAgICAgICAgIHg6IGxlZnQsXG4gICAgICAgICAgICAgICAgICAgIHk6IHRvcCxcbiAgICAgICAgICAgICAgICAgICAgd2lkdGg6IChpc0ZpbGxDb250YWluZXIgPyByYWRpdXNbMF0gOiByYWRpdXMpICogMixcbiAgICAgICAgICAgICAgICAgICAgaGVpZ2h0OiAoaXNGaWxsQ29udGFpbmVyID8gcmFkaXVzWzFdIDogcmFkaXVzKSAqIDJcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgIHN0eWxlOiB7XG4gICAgICAgICAgICAgICAgICAgIGZpbGw6ICd0cmFuc3BhcmVudCcsXG4gICAgICAgICAgICAgICAgICAgIHRleHQ6IGZvcm1hdExhYmVsKCksXG4gICAgICAgICAgICAgICAgICAgIHRleHRBbGlnbjogbGFiZWxNb2RlbC5nZXQoJ2FsaWduJyksXG4gICAgICAgICAgICAgICAgICAgIHRleHRWZXJ0aWNhbEFsaWduOiBsYWJlbE1vZGVsLmdldCgnYmFzZWxpbmUnKVxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgc2lsZW50OiB0cnVlXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICB2YXIgb3V0c2lkZVRleHRSZWN0ID0gbmV3IGVjaGFydHMuZ3JhcGhpYy5SZWN0KHRleHRPcHRpb24pO1xuICAgICAgICAgICAgdmFyIGNvbG9yID0gbGFiZWxNb2RlbC5nZXQoJ2NvbG9yJyk7XG4gICAgICAgICAgICBlY2hhcnRzLmdyYXBoaWMuc2V0VGV4dChvdXRzaWRlVGV4dFJlY3Quc3R5bGUsIGxhYmVsTW9kZWwsIGNvbG9yKTtcblxuICAgICAgICAgICAgdmFyIGluc2lkZVRleHRSZWN0ID0gbmV3IGVjaGFydHMuZ3JhcGhpYy5SZWN0KHRleHRPcHRpb24pO1xuICAgICAgICAgICAgdmFyIGluc0NvbG9yID0gbGFiZWxNb2RlbC5nZXQoJ2luc2lkZUNvbG9yJyk7XG4gICAgICAgICAgICBlY2hhcnRzLmdyYXBoaWMuc2V0VGV4dChpbnNpZGVUZXh0UmVjdC5zdHlsZSwgbGFiZWx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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./src/liquidFillView.js\n"); + +/***/ }), + +/***/ "echarts/lib/echarts": +/*!**************************!*\ + !*** external "echarts" ***! + \**************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("module.exports = __WEBPACK_EXTERNAL_MODULE_echarts_lib_echarts__;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZWNoYXJ0cy9saWIvZWNoYXJ0cy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovL2VjaGFydHMtbGlxdWlkZmlsbC9leHRlcm5hbCBcImVjaGFydHNcIj84YzY3Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gX19XRUJQQUNLX0VYVEVSTkFMX01PRFVMRV9lY2hhcnRzX2xpYl9lY2hhcnRzX187Il0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///echarts/lib/echarts\n"); + +/***/ }) + +/******/ }); +}); \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/web/js/echarts-liquidfill.min.js b/src/main/resources/com/fr/plugin/web/js/echarts-liquidfill.min.js new file mode 100644 index 0000000..91844ee --- /dev/null +++ b/src/main/resources/com/fr/plugin/web/js/echarts-liquidfill.min.js @@ -0,0 +1,2 @@ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("echarts")):"function"==typeof define&&define.amd?define(["echarts"],e):"object"==typeof exports?exports["echarts-liquidfill"]=e(require("echarts")):t["echarts-liquidfill"]=e(t.echarts)}(window,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:n})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(e.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var i in t)e.d(n,i,function(e){return t[e]}.bind(null,i));return n},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=29)}([function(t,e){function r(t){if(null==t||"object"!=typeof t)return t;var e=t,n=v.call(t);if("[object Array]"===n){if(!c(t)){e=[];for(var i=0,a=t.length;i1e-10&&(i.width+=a/s,i.height+=a/s,i.x-=a/s/2,i.y-=a/s/2)}return i}return t},contain:function(t,e){var r=this.transformCoordToLocal(t,e),n=this.getBoundingRect(),i=this.style;if(t=r[0],e=r[1],n.contain(t,e)){var a=this.path.data;if(i.hasStroke()){var o=i.lineWidth,l=i.strokeNoScale?this.getLineScale():1;if(l>1e-10&&(i.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),s.containStroke(a,o/l,t,e)))return!0}if(i.hasFill())return s.contain(a,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):i.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var r=this.shape;if(r){if(a.isObject(t))for(var n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);else r[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&h(t[0]-1)>1e-10&&h(t[3]-1)>1e-10?Math.sqrt(h(t[0]*t[3]-t[2]*t[1])):1}},n.extend=function(t){var e=function(e){n.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var r=t.shape;if(r){this.shape=this.shape||{};var i=this.shape;for(var a in r)!i.hasOwnProperty(a)&&r.hasOwnProperty(a)&&(i[a]=r[a])}t.init&&t.init.call(this,e)};for(var r in a.inherits(e,n),t)"style"!==r&&"shape"!==r&&(e.prototype[r]=t[r]);return e},a.inherits(n,i);var c=n;t.exports=c},function(t,e){function r(t){return Math.sqrt(n(t))}function n(t){return t[0]*t[0]+t[1]*t[1]}function i(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function a(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var o="undefined"==typeof Float32Array?Array:Float32Array,s=r,l=n,h=i,u=a;e.create=function(t,e){var r=new o(2);return null==t&&(t=0),null==e&&(e=0),r[0]=t,r[1]=e,r},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.clone=function(t){var e=new o(2);return e[0]=t[0],e[1]=t[1],e},e.set=function(t,e,r){return t[0]=e,t[1]=r,t},e.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},e.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},e.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},e.len=r,e.length=s,e.lenSquare=n,e.lengthSquare=l,e.mul=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},e.div=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},e.normalize=function(t,e){var n=r(e);return 0===n?(t[0]=0,t[1]=0):(t[0]=e[0]/n,t[1]=e[1]/n),t},e.distance=i,e.dist=h,e.distanceSquare=a,e.distSquare=u,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.lerp=function(t,e,r,n){return t[0]=e[0]+n*(r[0]-e[0]),t[1]=e[1]+n*(r[1]-e[1]),t},e.applyTransform=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},e.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},e.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}},function(t,e,r){function n(t,e,r,n){r<0&&(t+=r,r=-r),n<0&&(e+=n,n=-n),this.x=t,this.y=e,this.width=r,this.height=n}var i=r(2),a=r(10),o=i.applyTransform,s=Math.min,l=Math.max;n.prototype={constructor:n,union:function(t){var e=s(t.x,this.x),r=s(t.y,this.y);this.width=l(t.x+t.width,this.x+this.width)-e,this.height=l(t.y+t.height,this.y+this.height)-r,this.x=e,this.y=r},applyTransform:function(){var t=[],e=[],r=[],n=[];return function(i){if(i){t[0]=r[0]=this.x,t[1]=n[1]=this.y,e[0]=n[0]=this.x+this.width,e[1]=r[1]=this.y+this.height,o(t,t,i),o(e,e,i),o(r,r,i),o(n,n,i),this.x=s(t[0],e[0],r[0],n[0]),this.y=s(t[1],e[1],r[1],n[1]);var a=l(t[0],e[0],r[0],n[0]),h=l(t[1],e[1],r[1],n[1]);this.width=a-this.x,this.height=h-this.y}}}(),calculateTransform:function(t){var e=this,r=t.width/e.width,n=t.height/e.height,i=a.create();return a.translate(i,i,[-e.x,-e.y]),a.scale(i,i,[r,n]),a.translate(i,i,[t.x,t.y]),i},intersect:function(t){if(!t)return!1;t instanceof n||(t=n.create(t));var e=this,r=e.x,i=e.x+e.width,a=e.y,o=e.y+e.height,s=t.x,l=t.x+t.width,h=t.y,u=t.y+t.height;return!(i=r.x&&t<=r.x+r.width&&e>=r.y&&e<=r.y+r.height},clone:function(){return new n(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},n.create=function(t){return new n(t.x,t.y,t.width,t.height)};var h=n;t.exports=h},function(t,e,r){function n(t){return t>-f&&tf||t<-f}function a(t,e,r,n,i){var a=1-i;return a*a*(a*t+3*i*e)+i*i*(i*n+3*a*r)}function o(t,e,r,n){var i=1-n;return i*(i*t+2*n*e)+n*n*r}var s=r(2),l=s.create,h=s.distSquare,u=Math.pow,c=Math.sqrt,f=1e-8,d=1e-4,p=c(3),v=1/3,g=l(),y=l(),m=l();e.cubicAt=a,e.cubicDerivativeAt=function(t,e,r,n,i){var a=1-i;return 3*(((e-t)*a+2*(r-e)*i)*a+(n-r)*i*i)},e.cubicRootAt=function(t,e,r,i,a,o){var s=i+3*(e-r)-t,l=3*(r-2*e+t),h=3*(e-t),f=t-a,d=l*l-3*s*h,g=l*h-9*s*f,y=h*h-3*l*f,m=0;if(n(d)&&n(g))n(l)?o[0]=0:(C=-h/l)>=0&&C<=1&&(o[m++]=C);else{var x=g*g-4*d*y;if(n(x)){var _=g/d,b=-_/2;(C=-l/s+_)>=0&&C<=1&&(o[m++]=C),b>=0&&b<=1&&(o[m++]=b)}else if(x>0){var w=c(x),S=d*l+1.5*s*(-g+w),T=d*l+1.5*s*(-g-w);(C=(-l-((S=S<0?-u(-S,v):u(S,v))+(T=T<0?-u(-T,v):u(T,v))))/(3*s))>=0&&C<=1&&(o[m++]=C)}else{var M=(2*d*l-3*s*g)/(2*c(d*d*d)),P=Math.acos(M)/3,k=c(d),O=Math.cos(P),C=(-l-2*k*O)/(3*s),A=(b=(-l+k*(O+p*Math.sin(P)))/(3*s),(-l+k*(O-p*Math.sin(P)))/(3*s));C>=0&&C<=1&&(o[m++]=C),b>=0&&b<=1&&(o[m++]=b),A>=0&&A<=1&&(o[m++]=A)}}return m},e.cubicExtrema=function(t,e,r,a,o){var s=6*r-12*e+6*t,l=9*e+3*a-3*t-9*r,h=3*e-3*t,u=0;if(n(l))i(s)&&(d=-h/s)>=0&&d<=1&&(o[u++]=d);else{var f=s*s-4*l*h;if(n(f))o[0]=-s/(2*l);else if(f>0){var d,p=c(f),v=(-s-p)/(2*l);(d=(-s+p)/(2*l))>=0&&d<=1&&(o[u++]=d),v>=0&&v<=1&&(o[u++]=v)}}return u},e.cubicSubdivide=function(t,e,r,n,i,a){var o=(e-t)*i+t,s=(r-e)*i+e,l=(n-r)*i+r,h=(s-o)*i+o,u=(l-s)*i+s,c=(u-h)*i+h;a[0]=t,a[1]=o,a[2]=h,a[3]=c,a[4]=c,a[5]=u,a[6]=l,a[7]=n},e.cubicProjectPoint=function(t,e,r,n,i,o,s,l,u,f,p){var v,x,_,b,w,S=.005,T=1/0;g[0]=u,g[1]=f;for(var M=0;M<1;M+=.05)y[0]=a(t,r,i,s,M),y[1]=a(e,n,o,l,M),(b=h(g,y))=0&&b=0&&d<=1&&(o[u++]=d);else{var f=l*l-4*s*h;if(n(f))(d=-l/(2*s))>=0&&d<=1&&(o[u++]=d);else if(f>0){var d,p=c(f),v=(-l-p)/(2*s);(d=(-l+p)/(2*s))>=0&&d<=1&&(o[u++]=d),v>=0&&v<=1&&(o[u++]=v)}}return u},e.quadraticExtremum=function(t,e,r){var n=t+r-2*e;return 0===n?.5:(t-e)/n},e.quadraticSubdivide=function(t,e,r,n,i){var a=(e-t)*n+t,o=(r-e)*n+e,s=(o-a)*n+a;i[0]=t,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=r},e.quadraticProjectPoint=function(t,e,r,n,i,a,s,l,u){var f,p=.005,v=1/0;g[0]=s,g[1]=l;for(var x=0;x<1;x+=.05)y[0]=o(t,r,i,x),y[1]=o(e,n,a,x),(S=h(g,y))=0&&Sthis._ux||m(e-this._yi)>this._uy||this._len<5;return this.addData(l.L,t,e),this._ctx&&r&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),r&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,r,n,i,a){return this.addData(l.C,t,e,r,n,i,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,r,n,i,a):this._ctx.bezierCurveTo(t,e,r,n,i,a)),this._xi=i,this._yi=a,this},quadraticCurveTo:function(t,e,r,n){return this.addData(l.Q,t,e,r,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,r,n):this._ctx.quadraticCurveTo(t,e,r,n)),this._xi=r,this._yi=n,this},arc:function(t,e,r,n,i,a){return this.addData(l.A,t,e,r,r,n,i-n,0,a?0:1),this._ctx&&this._ctx.arc(t,e,r,n,i,a),this._xi=v(i)*r+t,this._yi=g(i)*r+e,this},arcTo:function(t,e,r,n,i){return this._ctx&&this._ctx.arcTo(t,e,r,n,i),this},rect:function(t,e,r,n){return this._ctx&&this._ctx.rect(t,e,r,n),this.addData(l.R,t,e,r,n),this},closePath:function(){this.addData(l.Z);var t=this._ctx,e=this._x0,r=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,r),t.closePath()),this._xi=e,this._yi=r,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,r=0;re.length&&(this._expandData(),e=this.data);for(var r=0;r0&&v<=t||u<0&&v>=t||0===u&&(c>0&&g<=e||c<0&&g>=e);)v+=u*(r=o[n=this._dashIdx]),g+=c*r,this._dashIdx=(n+1)%m,u>0&&vl||c>0&&gh||s[n%2?"moveTo":"lineTo"](u>=0?d(v,t):p(v,t),c>=0?d(g,e):p(g,e));u=v-t,c=g-e,this._dashOffset=-y(u*u+c*c)},_dashedBezierTo:function(t,e,r,i,a,o){var s,l,h,u,c,f=this._dashSum,d=this._dashOffset,p=this._lineDash,v=this._ctx,g=this._xi,m=this._yi,x=n.cubicAt,_=0,b=this._dashIdx,w=p.length,S=0;for(d<0&&(d=f+d),d%=f,s=0;s<1;s+=.1)l=x(g,t,r,a,s+.1)-x(g,t,r,a,s),h=x(m,e,i,o,s+.1)-x(m,e,i,o,s),_+=y(l*l+h*h);for(;bd);b++);for(s=(S-d)/_;s<=1;)u=x(g,t,r,a,s),c=x(m,e,i,o,s),b%2?v.moveTo(u,c):v.lineTo(u,c),s+=p[b]/_,b=(b+1)%w;b%2!=0&&v.lineTo(a,o),l=a-u,h=o-c,this._dashOffset=-y(l*l+h*h)},_dashedQuadraticTo:function(t,e,r,n){var i=r,a=n;r=(r+2*t)/3,n=(n+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,r,n,i,a)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,x&&(this.data=new Float32Array(t)))},getBoundingRect:function(){h[0]=h[1]=c[0]=c[1]=Number.MAX_VALUE,u[0]=u[1]=f[0]=f[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,r=0,n=0,s=0,d=0;dh||m(o-i)>u||f===c-1)&&(t.lineTo(a,o),n=a,i=o);break;case l.C:t.bezierCurveTo(s[f++],s[f++],s[f++],s[f++],s[f++],s[f++]),n=s[f-2],i=s[f-1];break;case l.Q:t.quadraticCurveTo(s[f++],s[f++],s[f++],s[f++]),n=s[f-2],i=s[f-1];break;case l.A:var p=s[f++],y=s[f++],x=s[f++],_=s[f++],b=s[f++],w=s[f++],S=s[f++],T=s[f++],M=x>_?x:_,P=x>_?1:x/_,k=x>_?_/x:1,O=b+w;Math.abs(x-_)>.001?(t.translate(p,y),t.rotate(S),t.scale(P,k),t.arc(0,0,M,b,O,1-T),t.scale(1/P,1/k),t.rotate(-S),t.translate(-p,-y)):t.arc(p,y,M,b,O,1-T),1===f&&(e=v(b)*x+p,r=g(b)*_+y),n=v(O)*x+p,i=g(O)*_+y;break;case l.R:e=n=s[f],r=i=s[f+1],t.rect(s[f++],s[f++],s[f++],s[f++]);break;case l.Z:t.closePath(),n=e,i=r}}}},_.CMD=l;var b=_;t.exports=b},function(t,e){function r(){var t=new a(6);return n(t),t}function n(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function i(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}var a="undefined"==typeof Float32Array?Array:Float32Array;e.create=r,e.identity=n,e.copy=i,e.mul=function(t,e,r){var n=e[0]*r[0]+e[2]*r[1],i=e[1]*r[0]+e[3]*r[1],a=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t},e.translate=function(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t},e.rotate=function(t,e,r){var n=e[0],i=e[2],a=e[4],o=e[1],s=e[3],l=e[5],h=Math.sin(r),u=Math.cos(r);return t[0]=n*u+o*h,t[1]=-n*h+o*u,t[2]=i*u+s*h,t[3]=-i*h+u*s,t[4]=u*a+h*l,t[5]=u*l-h*a,t},e.scale=function(t,e,r){var n=r[0],i=r[1];return t[0]=e[0]*n,t[1]=e[1]*i,t[2]=e[2]*n,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*i,t},e.invert=function(t,e){var r=e[0],n=e[2],i=e[4],a=e[1],o=e[3],s=e[5],l=r*o-a*n;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-o*i)*l,t[5]=(a*i-r*s)*l,t):null},e.clone=function(t){var e=r();return i(e,t),e}},function(t,e,r){function n(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=r.length&&r.push({option:t})}}),r},e.makeIdAndName=function(t){var e=o.createHashMap();l(t,function(t,r){var n=t.exist;n&&e.set(n.id,t)}),l(t,function(t,r){var n=t.option;o.assert(!n||null==n.id||!e.get(n.id)||e.get(n.id)===t,"id duplicates: "+(n&&n.id)),n&&null!=n.id&&e.set(n.id,t),!t.keyInfo&&(t.keyInfo={})}),l(t,function(t,r){var n=t.exist,i=t.option,a=t.keyInfo;if(h(i)){if(a.name=null!=i.name?i.name+"":n?n.name:c+r,n)a.id=n.id;else if(null!=i.id)a.id=i.id+"";else{var o=0;do{a.id="\0"+a.name+"\0"+o++}while(e.get(a.id))}e.set(a.id,t)}})},e.isNameSpecified=function(t){var e=t.name;return!(!e||!e.indexOf(c))},e.isIdInner=i,e.compressBatches=function(t,e){function r(t,e,r){for(var i=0,a=t.length;i=11),domSupported:"undefined"!=typeof document}}(navigator.userAgent);t.exports=r},function(t,e,r){function n(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===d?{}:[]),this.sourceFormat=t.sourceFormat||c,this.seriesLayoutBy=t.seriesLayoutBy||u,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&a(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}var i=r(0),a=i.createHashMap,o=i.isTypedArray,s=r(36).enableClassCheck,l=r(15),h=l.SOURCE_FORMAT_ORIGINAL,u=l.SERIES_LAYOUT_BY_COLUMN,c=l.SOURCE_FORMAT_UNKNOWN,f=l.SOURCE_FORMAT_TYPED_ARRAY,d=l.SOURCE_FORMAT_KEYED_COLUMNS;n.seriesDataToSource=function(t){return new n({data:t,sourceFormat:o(t)?f:h,fromDataset:!1})},s(n);var p=n;t.exports=p},function(t,e){e.SOURCE_FORMAT_ORIGINAL="original",e.SOURCE_FORMAT_ARRAY_ROWS="arrayRows",e.SOURCE_FORMAT_OBJECT_ROWS="objectRows",e.SOURCE_FORMAT_KEYED_COLUMNS="keyedColumns",e.SOURCE_FORMAT_UNKNOWN="unknown",e.SOURCE_FORMAT_TYPED_ARRAY="typedArray",e.SERIES_LAYOUT_BY_COLUMN="column",e.SERIES_LAYOUT_BY_ROW="row"},function(t,e){var r={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};t.exports=function(t,e,n){return r.hasOwnProperty(e)?n*=t.dpr:n}},function(t,e,r){var n=r(43),i=r(44),a=r(18),o=r(45),s=r(0),l=function(t){a.call(this,t),i.call(this,t),o.call(this,t),this.id=t.id||n()};l.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0}var r=this.transform;r||(r=this.transform=[1,0,0,1,0,0]),r[4]+=t,r[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var r=this[t];r||(r=this[t]=[]),r[0]=e[0],r[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"==typeof t)this.attrKV(t,e);else if(s.isObject(t))for(var r in t)t.hasOwnProperty(r)&&this.attrKV(r,t[r]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),this.clipPath=t,t.__zr=e,t.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var r=0;rs||t<-s}var i=r(10),a=r(2),o=i.identity,s=5e-5,l=function(t){(t=t||{}).position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},h=l.prototype;h.transform=null,h.needLocalTransform=function(){return n(this.rotation)||n(this.position[0])||n(this.position[1])||n(this.scale[0]-1)||n(this.scale[1]-1)};var u=[];h.updateTransform=function(){var t=this.parent,e=t&&t.transform,r=this.needLocalTransform(),n=this.transform;if(r||e){n=n||i.create(),r?this.getLocalTransform(n):o(n),e&&(r?i.mul(n,t.transform,n):i.copy(n,t.transform)),this.transform=n;var a=this.globalScaleRatio;if(null!=a&&1!==a){this.getGlobalScale(u);var s=u[0]<0?-1:1,l=u[1]<0?-1:1,h=((u[0]-s)*a+s)/u[0]||0,c=((u[1]-l)*a+l)/u[1]||0;n[0]*=h,n[1]*=h,n[2]*=c,n[3]*=c}this.invTransform=this.invTransform||i.create(),i.invert(this.invTransform,n)}else n&&o(n)},h.getLocalTransform=function(t){return l.getLocalTransform(this,t)},h.setTransform=function(t){var e=this.transform,r=t.dpr||1;e?t.setTransform(r*e[0],r*e[1],r*e[2],r*e[3],r*e[4],r*e[5]):t.setTransform(r,0,0,r,0,0)},h.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var c=[],f=i.create();h.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],r=t[2]*t[2]+t[3]*t[3],i=this.position,a=this.scale;n(e-1)&&(e=Math.sqrt(e)),n(r-1)&&(r=Math.sqrt(r)),t[0]<0&&(e=-e),t[3]<0&&(r=-r),i[0]=t[4],i[1]=t[5],a[0]=e,a[1]=r,this.rotation=Math.atan2(-t[1]/r,t[0]/e)}},h.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(i.mul(c,t.invTransform,e),e=c);var r=this.origin;r&&(r[0]||r[1])&&(f[4]=r[0],f[5]=r[1],i.mul(c,e,f),c[4]-=r[0],c[5]-=r[1],e=c),this.setLocalTransform(e)}},h.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},h.transformCoordToLocal=function(t,e){var r=[t,e],n=this.invTransform;return n&&a.applyTransform(r,r,n),r},h.transformCoordToGlobal=function(t,e){var r=[t,e],n=this.transform;return n&&a.applyTransform(r,r,n),r},l.getLocalTransform=function(t,e){o(e=e||[]);var r=t.origin,n=t.scale||[1,1],a=t.rotation||0,s=t.position||[0,0];return r&&(e[4]-=r[0],e[5]-=r[1]),i.scale(e,e,n),a&&i.rotate(e,e,a),r&&(e[4]+=r[0],e[5]+=r[1]),e[4]+=s[0],e[5]+=s[1],e};var d=l;t.exports=d},function(t,e,r){function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return n(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100*255:parseInt(t,10))}function o(t){return i(t.length&&"%"===t.charAt(t.length-1)?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t,e,r){return t+(e-t)*r}function h(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}function u(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function c(t,e){x&&u(x,e),x=m.put(t,x||e.slice())}function f(t,e){if(t){e=e||[];var r=m.get(t);if(r)return u(e,r);var n=(t+="").replace(/ /g,"").toLowerCase();if(n in y)return u(e,y[n]),c(t,e),e;if("#"!==n.charAt(0)){var i=n.indexOf("("),s=n.indexOf(")");if(-1!==i&&s+1===n.length){var l=n.substr(0,i),f=n.substr(i+1,s-(i+1)).split(","),p=1;switch(l){case"rgba":if(4!==f.length)return void h(e,0,0,0,1);p=o(f.pop());case"rgb":return 3!==f.length?void h(e,0,0,0,1):(h(e,a(f[0]),a(f[1]),a(f[2]),p),c(t,e),e);case"hsla":return 4!==f.length?void h(e,0,0,0,1):(f[3]=o(f[3]),d(f,e),c(t,e),e);case"hsl":return 3!==f.length?void h(e,0,0,0,1):(d(f,e),c(t,e),e);default:return}}h(e,0,0,0,1)}else{var v;if(4===n.length)return(v=parseInt(n.substr(1),16))>=0&&v<=4095?(h(e,(3840&v)>>4|(3840&v)>>8,240&v|(240&v)>>4,15&v|(15&v)<<4,1),c(t,e),e):void h(e,0,0,0,1);if(7===n.length)return(v=parseInt(n.substr(1),16))>=0&&v<=16777215?(h(e,(16711680&v)>>16,(65280&v)>>8,255&v,1),c(t,e),e):void h(e,0,0,0,1)}}}function d(t,e){var r=(parseFloat(t[0])%360+360)%360/360,i=o(t[1]),a=o(t[2]),l=a<=.5?a*(i+1):a+i-a*i,u=2*a-l;return h(e=e||[],n(255*s(u,l,r+1/3)),n(255*s(u,l,r)),n(255*s(u,l,r-1/3)),1),4===t.length&&(e[3]=t[3]),e}function p(t,e,r){if(e&&e.length&&t>=0&&t<=1){r=r||[];var a=t*(e.length-1),o=Math.floor(a),s=Math.ceil(a),h=e[o],u=e[s],c=a-o;return r[0]=n(l(h[0],u[0],c)),r[1]=n(l(h[1],u[1],c)),r[2]=n(l(h[2],u[2],c)),r[3]=i(l(h[3],u[3],c)),r}}function v(t,e,r){if(e&&e.length&&t>=0&&t<=1){var a=t*(e.length-1),o=Math.floor(a),s=Math.ceil(a),h=f(e[o]),u=f(e[s]),c=a-o,d=g([n(l(h[0],u[0],c)),n(l(h[1],u[1],c)),n(l(h[2],u[2],c)),i(l(h[3],u[3],c))],"rgba");return r?{color:d,leftIndex:o,rightIndex:s,value:a}:d}}function g(t,e){if(t&&t.length){var r=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(r+=","+t[3]),e+"("+r+")"}}var y={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]},m=new(r(20))(20),x=null,_=p,b=v;e.parse=f,e.lift=function(t,e){var r=f(t);if(r){for(var n=0;n<3;n++)r[n]=e<0?r[n]*(1-e)|0:(255-r[n])*e+r[n]|0,r[n]>255?r[n]=255:t[n]<0&&(r[n]=0);return g(r,4===r.length?"rgba":"rgb")}},e.toHex=function(t){var e=f(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},e.fastLerp=p,e.fastMapToColor=_,e.lerp=v,e.mapToColor=b,e.modifyHSL=function(t,e,r,n){if(t=f(t))return t=function(t){if(t){var e,r,n=t[0]/255,i=t[1]/255,a=t[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o,h=(s+o)/2;if(0===l)e=0,r=0;else{r=h<.5?l/(s+o):l/(2-s-o);var u=((s-n)/6+l/2)/l,c=((s-i)/6+l/2)/l,f=((s-a)/6+l/2)/l;n===s?e=f-c:i===s?e=1/3+u-f:a===s&&(e=2/3+c-u),e<0&&(e+=1),e>1&&(e-=1)}var d=[360*e,r,h];return null!=t[3]&&d.push(t[3]),d}}(t),null!=e&&(t[0]=function(t){return(t=Math.round(t))<0?0:t>360?360:t}(e)),null!=r&&(t[1]=o(r)),null!=n&&(t[2]=o(n)),g(d(t),"rgba")},e.modifyAlpha=function(t,e){if((t=f(t))&&null!=e)return t[3]=i(e),g(t,"rgba")},e.stringify=g},function(t,e){var r=function(){this.head=null,this.tail=null,this._len=0},n=r.prototype;n.insert=function(t){var e=new i(t);return this.insertEntry(e),e},n.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},n.remove=function(t){var e=t.prev,r=t.next;e?e.next=r:this.head=r,r?r.prev=e:this.tail=e,t.next=t.prev=null,this._len--},n.len=function(){return this._len},n.clear=function(){this.head=this.tail=null,this._len=0};var i=function(t){this.value=t,this.next,this.prev},a=function(t){this._list=new r,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},o=a.prototype;o.put=function(t,e){var r=this._list,n=this._map,a=null;if(null==n[t]){var o=r.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=r.head;r.remove(l),delete n[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new i(e),s.key=t,r.insertEntry(s),n[t]=s}return a},o.get=function(t){var e=this._map[t],r=this._list;if(null!=e)return e!==r.tail&&(r.remove(e),r.insertEntry(e)),e.value},o.clear=function(){this._list.clear(),this._map={}};var s=a;t.exports=s},function(t,e){var r=1;"undefined"!=typeof window&&(r=Math.max(window.devicePixelRatio||1,1));var n=r;e.debugMode=0,e.devicePixelRatio=n},function(t,e,r){function n(t){if(t){t.font=w.makeFont(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||A[e]?e:"left";var r=t.textVerticalAlign||t.textBaseline;"center"===r&&(r="middle"),t.textVerticalAlign=null==r||I[r]?r:"top",t.textPadding&&(t.textPadding=x(t.textPadding))}}function i(t,e,r,n,i){if(r&&e.textRotation){var a=e.textOrigin;"center"===a?(n=r.width/2+r.x,i=r.height/2+r.y):a&&(n=a[0]+r.x,i=a[1]+r.y),t.translate(n,i),t.rotate(-e.textRotation),t.translate(-n,-i)}}function a(t,e,r,n,i,a,l,h){var d=n.rich[r.styleName]||{};d.text=r.text;var v=r.textVerticalAlign,m=a+i/2;"top"===v?m=a+r.height/2:"bottom"===v&&(m=a+i-r.height/2),!r.isLineHolder&&o(d)&&s(t,e,d,"right"===h?l-r.width:"center"===h?l-r.width/2:l,m-r.height/2,r.width,r.height);var x=r.textPadding;x&&(l=p(l,h,x),m-=r.height/2-x[2]-r.textHeight/2),u(e,"shadowBlur",y(d.textShadowBlur,n.textShadowBlur,0)),u(e,"shadowColor",d.textShadowColor||n.textShadowColor||"transparent"),u(e,"shadowOffsetX",y(d.textShadowOffsetX,n.textShadowOffsetX,0)),u(e,"shadowOffsetY",y(d.textShadowOffsetY,n.textShadowOffsetY,0)),u(e,"textAlign",h),u(e,"textBaseline","middle"),u(e,"font",r.font||C);var _=c(d.textStroke||n.textStroke,w),b=f(d.textFill||n.textFill),w=g(d.textStrokeWidth,n.textStrokeWidth);_&&(u(e,"lineWidth",w),u(e,"strokeStyle",_),e.strokeText(r.text,l,m)),b&&(u(e,"fillStyle",b),e.fillText(r.text,l,m))}function o(t){return!!(t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor)}function s(t,e,r,n,i,a,o){var s=r.textBackgroundColor,h=r.textBorderWidth,c=r.textBorderColor,f=_(s);if(u(e,"shadowBlur",r.textBoxShadowBlur||0),u(e,"shadowColor",r.textBoxShadowColor||"transparent"),u(e,"shadowOffsetX",r.textBoxShadowOffsetX||0),u(e,"shadowOffsetY",r.textBoxShadowOffsetY||0),f||h&&c){e.beginPath();var d=r.textBorderRadius;d?S.buildPath(e,{x:n,y:i,width:a,height:o,r:d}):e.rect(n,i,a,o),e.closePath()}if(f)if(u(e,"fillStyle",s),null!=r.fillOpacity){var p=e.globalAlpha;e.globalAlpha=r.fillOpacity*r.opacity,e.fill(),e.globalAlpha=p}else e.fill();else if(b(s)){var v=s.image;(v=T.createOrUpdateImage(v,null,t,l,s))&&T.isImageReady(v)&&e.drawImage(v,n,i,a,o)}if(h&&c)if(u(e,"lineWidth",h),u(e,"strokeStyle",c),null!=r.strokeOpacity){p=e.globalAlpha;e.globalAlpha=r.strokeOpacity*r.opacity,e.stroke(),e.globalAlpha=p}else e.stroke()}function l(t,e){e.image=t}function h(t,e,r){var n=e.x||0,i=e.y||0,a=e.textAlign,o=e.textVerticalAlign;if(r){var s=e.textPosition;if(s instanceof Array)n=r.x+d(s[0],r.width),i=r.y+d(s[1],r.height);else{var l=w.adjustTextPositionOnRect(s,r,e.textDistance);n=l.x,i=l.y,a=a||l.textAlign,o=o||l.textVerticalAlign}var h=e.textOffset;h&&(n+=h[0],i+=h[1])}return{baseX:n,baseY:i,textAlign:a,textVerticalAlign:o}}function u(t,e,r){return t[e]=M(t,e,r),t[e]}function c(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function f(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function d(t,e){return"string"==typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function p(t,e,r){return"right"===e?t-r[1]:"center"===e?t+r[3]/2-r[1]/2:t+r[3]}var v=r(0),g=v.retrieve2,y=v.retrieve3,m=v.each,x=v.normalizeCssArray,_=v.isString,b=v.isObject,w=r(23),S=r(24),T=r(11),M=r(16),P=r(8),k=P.ContextCachedBy,O=P.WILL_BE_RESTORED,C=w.DEFAULT_FONT,A={left:1,right:1,center:1},I={top:1,bottom:1,middle:1},D=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]];e.normalizeTextStyle=function(t){return n(t),m(t.rich,n),t},e.renderText=function(t,e,r,n,l,u){n.rich?function(t,e,r,n,l,u){u!==O&&(e.__attrCachedBy=k.NONE);var c=t.__textCotentBlock;c&&!t.__dirtyText||(c=t.__textCotentBlock=w.parseRichText(r,n)),function(t,e,r,n,l){var u=r.width,c=r.outerWidth,f=r.outerHeight,d=n.textPadding,p=h(0,n,l),v=p.baseX,g=p.baseY,y=p.textAlign,m=p.textVerticalAlign;i(e,n,l,v,g);var x=w.adjustTextX(v,c,y),_=w.adjustTextY(g,f,m),b=x,S=_;d&&(b+=d[3],S+=d[0]);var T=b+u;o(n)&&s(t,e,n,x,_,c,f);for(var M=0;M=0&&"right"===(P=O[B]).textAlign;)a(t,e,P,n,A,S,L,"right"),I-=P.width,L-=P.width,B--;for(R+=(u-(R-b)-(T-L)-I)/2;D<=B;)P=O[D],a(t,e,P,n,A,S,R+P.width/2,"center"),R+=P.width,D++;S+=A}}(t,e,c,n,l)}(t,e,r,n,l,u):function(t,e,r,n,a,l){"use strict";var u,d=o(n),v=!1,g=e.__attrCachedBy===k.PLAIN_TEXT;l!==O?(l&&(u=l.style,v=!d&&g&&u),e.__attrCachedBy=d?k.NONE:k.PLAIN_TEXT):g&&(e.__attrCachedBy=k.NONE);var y=n.font||C;v&&y===(u.font||C)||(e.font=y);var m=t.__computedFont;t.__styleFont!==y&&(t.__styleFont=y,m=t.__computedFont=e.font);var x=n.textPadding,_=n.textLineHeight,b=t.__textCotentBlock;b&&!t.__dirtyText||(b=t.__textCotentBlock=w.parsePlainText(r,m,x,_,n.truncate));var S=b.outerHeight,T=b.lines,P=b.lineHeight,A=h(0,n,a),I=A.baseX,R=A.baseY,L=A.textAlign||"left",B=A.textVerticalAlign;i(e,n,a,I,R);var E=w.adjustTextY(R,S,B),F=I,z=E;if(d||x){var N=w.getWidth(r,m),W=N;x&&(W+=x[1]+x[3]);var q=w.adjustTextX(I,W,L);d&&s(t,e,n,q,E,W,S),x&&(F=p(I,L,x),z+=x[0])}e.textAlign=L,e.textBaseline="middle",e.globalAlpha=n.opacity||1;for(var j=0;jk&&(P=0,M={}),P++,M[r]=i,i}function i(t,e,r,i,a,l,h){var u=p(t,e,a,l,h),c=n(t,e);a&&(c+=a[1]+a[3]);var f=u.outerHeight,d=o(0,c,r),v=s(0,f,i),g=new y(d,v,c,f);return g.lineHeight=u.lineHeight,g}function a(t,e,r,n,i,a,l,h){var u=v(t,{rich:l,truncate:h,font:e,textAlign:r,textPadding:i,textLineHeight:a}),c=u.outerWidth,f=u.outerHeight,d=o(0,c,r),p=s(0,f,n);return new y(d,p,c,f)}function o(t,e,r){return"right"===r?t-=e:"center"===r&&(t-=e/2),t}function s(t,e,r){return"middle"===r?t-=e/2:"bottom"===r&&(t-=e),t}function l(t,e,r,n,i){if(!e)return"";var a=(t+"").split("\n");i=h(e,r,n,i);for(var o=0,s=a.length;o=o;l++)s-=o;var h=n(r,e);return h>s&&(r="",h=0),s=t-h,i.ellipsis=r,i.ellipsisWidth=h,i.contentWidth=s,i.containerWidth=t,i}function u(t,e){var r=e.containerWidth,i=e.font,a=e.contentWidth;if(!r)return"";var o=n(t,i);if(o<=r)return t;for(var s=0;;s++){if(o<=a||s>=e.maxIterations){t+=e.ellipsis;break}var l=0===s?c(t,a,e.ascCharWidth,e.cnCharWidth):o>0?Math.floor(t.length*a/o):0;o=n(t=t.substr(0,l),i)}return""===t&&(t=e.placeholder),t}function c(t,e,r,n){for(var i=0,a=0,o=t.length;ac)t="",o=[];else if(null!=d)for(var p=h(d-(r?r[1]+r[3]:0),e,i.ellipsis,{minChar:i.minChar,placeholder:i.placeholder}),v=0,g=o.length;va&&g(r,t.substring(a,o)),g(r,i[2],i[1]),a=O.lastIndex}ay)return{lines:[],width:0,height:0};F.textWidth=n(F.text,C);var I=P.textWidth,D=null==I||"auto"===I;if("string"==typeof I&&"%"===I.charAt(I.length-1))F.percentWidth=I,c.push(F),I=0;else{if(D){I=F.textWidth;var R=P.textBackgroundColor,L=R&&R.image;L&&(L=m.findExistImage(L),m.isImageReady(L)&&(I=Math.max(I,L.width*A/L.height)))}var B=k?k[1]+k[3]:0;I+=B;var E=null!=v?v-T:null;null!=E&&Eh&&(r*=h/(o=r+n),n*=h/o),i+a>h&&(i*=h/(o=i+a),a*=h/o),n+i>u&&(n*=u/(o=n+i),i*=u/o),r+a>u&&(r*=u/(o=r+a),a*=u/o),t.moveTo(s+r,l),t.lineTo(s+h-n,l),0!==n&&t.arc(s+h-n,l+n,n,-Math.PI/2,0),t.lineTo(s+h,l+u-i),0!==i&&t.arc(s+h-i,l+u-i,i,0,Math.PI/2),t.lineTo(s+a,l+u),0!==a&&t.arc(s+a,l+u-a,a,Math.PI/2,Math.PI),t.lineTo(s,l+r),0!==r&&t.arc(s+r,l+r,r,Math.PI,1.5*Math.PI)}},function(t,e){var r=2*Math.PI;e.normalizeRadian=function(t){return(t%=r)<0&&(t+=r),t}},function(t,e,r){var n=r(68),i=r(69);e.buildPath=function(t,e,r){var a=e.points,o=e.smooth;if(a&&a.length>=2){if(o&&"spline"!==o){var s=i(a,o,r,e.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var l=a.length,h=0;h<(r?l:l-1);h++){var u=s[2*h],c=s[2*h+1],f=a[(h+1)%l];t.bezierCurveTo(u[0],u[1],c[0],c[1],f[0],f[1])}}else{"spline"===o&&(a=n(a,r)),t.moveTo(a[0][0],a[0][1]),h=1;for(var d=a.length;hs?(s*=2*t/o,o=2*t):(o*=2*t/s,s=2*t);var l=e?0:M-o/2,h=e?0:P-s/2;return r=n.graphic.makePath(O.slice(7),{},new n.graphic.BoundingRect(l,h,o,s)),e&&(r.position=[-o/2,-s/2]),r}if(k){var u=e?-t[0]:M-t[0],c=e?-t[1]:P-t[1];return a.createSymbol("rect",u,c,2*t[0],2*t[1])}u=e?-t:M-t,c=e?-t:P-t;return"pin"===O?c+=t:"arrow"===O&&(c-=t),a.createSymbol(O,u,c,2*t,2*t)}return new n.graphic.Circle({shape:{cx:e?0:M,cy:e?0:P,r:t}})}function l(){var e=i(w);return e.style.fill=null,e.setStyle(t.getModel("outline.itemStyle").getItemStyle()),e}function h(e,r,a){var l=k?v[0]:v,h=k?y/2:v,u=f.getItemModel(e),c=u.getModel("itemStyle"),d=u.get("phase"),p=o(u.get("amplitude"),2*h),g=o(u.get("waveLength"),2*l),m=h-f.get("value",e)*h*2;d=a?a.shape.phase:"auto"===d?e*Math.PI/4:d;var x=c.getItemStyle();if(!x.fill){var _=t.get("color"),b=e%_.length;x.fill=_[b]}var w=new s({shape:{waveLength:g,radius:l,radiusY:h,cx:2*l,cy:0,waterLevel:m,amplitude:p,phase:d,inverse:r},style:x,position:[M,P]});w.shape._waterLevel=m;var S=u.getModel("emphasis.itemStyle").getItemStyle();S.lineWidth=0,n.graphic.setHoverStyle(w,S);var T=i(v,!0);return T.setStyle({fill:"white"}),w.setClipPath(T),w}function u(t,e,r){var n=f.getItemModel(t),i=n.get("period"),a=n.get("direction"),o=f.get("value",t),s=n.get("phase");s=r?r.shape.phase:"auto"===s?t*Math.PI/4:s;var l;l="auto"===i?function(e){var r=f.count();return 0===r?e:e*(.2+(r-t)/r*.8)}(5e3):"function"==typeof i?i(o,t):i;var h=0;"right"===a||null==a?h=Math.PI:"left"===a?h=-Math.PI:"none"===a?h=0:console.error("Illegal direction value for liquid fill."),"none"!==a&&n.get("waveAnimation")&&e.animate("shape",!0).when(0,{phase:s}).when(l/2,{phase:h+s}).when(l,{phase:2*h+s}).during(function(){I&&I.dirty(!0)}).start()}var c=this.group;c.removeAll();var f=t.getData(),d=f.getItemModel(0),p=d.get("center"),v=d.get("radius"),g=r.getWidth(),y=r.getHeight(),m=Math.min(g,y),x=0,_=0,b=t.get("outline.show");b&&(x=t.get("outline.borderDistance"),_=o(t.get("outline.itemStyle.borderWidth"),m));var w,S,T,M=o(p[0],g),P=o(p[1],y),k=!1,O=t.get("shape");("container"===O?(k=!0,S=[(w=[g/2,y/2])[0]-_/2,w[1]-_/2],T=[o(x,g),o(x,y)],v=[Math.max(S[0]-T[0],0),Math.max(S[1]-T[1],0)]):(S=(w=o(v,m)/2)-_/2,T=o(x,m),v=Math.max(S-T,0)),b)&&(l().style.lineWidth=_,c.add(l()));var C=k?0:M-v,A=k?0:P-v,I=null;c.add(function(){var e=i(v);e.setStyle(t.getModel("backgroundStyle").getItemStyle()),e.style.fill=null,e.z2=5;var r=i(v);r.setStyle(t.getModel("backgroundStyle").getItemStyle()),r.style.stroke=null;var a=new n.graphic.Group;return a.add(e),a.add(r),a}());var D=this._data,R=[];f.diff(D).add(function(e){var r=h(e,!1),i=r.shape.waterLevel;r.shape.waterLevel=k?y/2:v,n.graphic.initProps(r,{shape:{waterLevel:i}},t),r.z2=2,u(e,r,null),c.add(r),f.setItemGraphicEl(e,r),R.push(r)}).update(function(e,r){for(var i=D.getItemGraphicEl(r),a=h(e,!1,i),o={},s=["amplitude","cx","cy","phase","radius","radiusY","waterLevel","waveLength"],l=0;l=0)?(r={textFill:null,textStroke:t.textStroke,textStrokeWidth:t.textStrokeWidth},t.textFill="#fff",null==t.textStroke&&(t.textStroke=a,null==t.textStrokeWidth&&(t.textStrokeWidth=2))):null!=a&&(r={textFill:null},t.textFill=a),r&&(t.insideRollback=r)}}function S(t){var e=t.insideRollback;e&&(t.textFill=e.textFill,t.textStroke=e.textStroke,t.textStrokeWidth=e.textStrokeWidth,t.insideRollback=null)}function T(t,e,r,n,i,a){if("function"==typeof i&&(a=i,i=null),n&&n.isAnimationEnabled()){var o=t?"Update":"",s=n.getShallow("animationDuration"+o),l=n.getShallow("animationEasing"+o),h=n.getShallow("animationDelay"+o);"function"==typeof h&&(h=h(i,n.getAnimationDelayParams?n.getAnimationDelayParams(e,i):null)),"function"==typeof s&&(s=s(i)),s>0?e.animateTo(r,s,h||0,l,a,!!a):(e.stopAnimation(),e.attr(r),a&&a())}else e.stopAnimation(),e.attr(r),a&&a()}function M(t,e,r,n,i){T(!0,t,e,r,n,i)}function P(t,e,r){return e&&!k.isArrayLike(e)&&(e=R.getLocalTransform(e)),r&&(e=A.invert([],e)),I.applyTransform([],t,e)}var k=r(0),O=r(41),C=r(19),A=r(10),I=r(2),D=r(1),R=r(18),L=r(60);e.Image=L;var B=r(61);e.Group=B;var E=r(62);e.Text=E;var F=r(63);e.Circle=F;var z=r(64);e.Sector=z;var N=r(66);e.Ring=N;var W=r(67);e.Polygon=W;var q=r(70);e.Polyline=q;var j=r(71);e.Rect=j;var H=r(72);e.Line=H;var Y=r(73);e.BezierCurve=Y;var U=r(74);e.Arc=U;var V=r(75);e.CompoundPath=V;var G=r(76);e.LinearGradient=G;var X=r(77);e.RadialGradient=X;var Z=r(3);e.BoundingRect=Z;var Q=r(78);e.IncrementalDisplayable=Q;var $=Math.round,K=Math.max,J=Math.min,tt={},et=1,rt=O.mergePath,nt=k.createHashMap(),it=0;e.Z2_EMPHASIS_LIFT=et,e.extendShape=function(t){return D.extend(t)},e.extendPath=function(t,e){return O.extendFromString(t,e)},e.makePath=n,e.makeImage=function(t,e,r){var n=new L({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(t){if("center"===r){var a={width:t.width,height:t.height};n.setStyle(i(e,a))}}});return n},e.mergePath=rt,e.resizePath=a,e.subPixelOptimizeLine=function(t){var e=t.shape,r=t.style.lineWidth;return $(2*e.x1)===$(2*e.x2)&&(e.x1=e.x2=o(e.x1,r,!0)),$(2*e.y1)===$(2*e.y2)&&(e.y1=e.y2=o(e.y1,r,!0)),t},e.subPixelOptimizeRect=function(t){var e=t.shape,r=t.style.lineWidth,n=e.x,i=e.y,a=e.width,s=e.height;return e.x=o(e.x,r,!0),e.y=o(e.y,r,!0),e.width=Math.max(o(n+a,r,!1)-e.x,0===a?0:1),e.height=Math.max(o(i+s,r,!1)-e.y,0===s?0:1),t},e.subPixelOptimize=o,e.setElementHoverStyle=f,e.isInEmphasis=function(t){return t&&t.__isEmphasisEntered},e.setHoverStyle=function(t,e,r){t.isGroup?t.traverse(function(t){!t.isGroup&&f(t,t.hoverStyle||e)}):f(t,t.hoverStyle||e),y(t,r)},e.setAsHoverStyleTrigger=y,e.setLabelStyle=function(t,e,r,n,i,a,o){var s,l=(i=i||tt).labelFetcher,h=i.labelDataIndex,u=i.labelDimIndex,c=r.getShallow("show"),f=n.getShallow("show");(c||f)&&(l&&(s=l.getFormattedLabel(h,"normal",null,u)),null==s&&(s=k.isFunction(i.defaultText)?i.defaultText(h,i):i.defaultText));var d=c?s:null,p=f?k.retrieve2(l?l.getFormattedLabel(h,"emphasis",null,u):null,s):null;null==d&&null==p||(m(t,r,a,i),m(e,n,o,i,!0)),t.text=d,e.text=p},e.setTextStyle=m,e.setText=function(t,e,r){var n,i={isRectText:!0};!1===r?n=!0:i.autoColor=r,x(t,e,i,n)},e.getFont=function(t,e){var r=e||e.getModel("textStyle");return k.trim([t.fontStyle||r&&r.getShallow("fontStyle")||"",t.fontWeight||r&&r.getShallow("fontWeight")||"",(t.fontSize||r&&r.getShallow("fontSize")||12)+"px",t.fontFamily||r&&r.getShallow("fontFamily")||"sans-serif"].join(" "))},e.updateProps=M,e.initProps=function(t,e,r,n,i){T(!1,t,e,r,n,i)},e.getTransform=function(t,e){for(var r=A.identity([]);t&&t!==e;)A.mul(r,t.getLocalTransform(),r),t=t.parent;return r},e.applyTransform=P,e.transformDirection=function(t,e,r){var n=0===e[4]||0===e[5]||0===e[0]?1:Math.abs(2*e[4]/e[0]),i=0===e[4]||0===e[5]||0===e[2]?1:Math.abs(2*e[4]/e[2]),a=["left"===t?-n:"right"===t?n:0,"top"===t?-i:"bottom"===t?i:0];return a=P(a,e,r),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"},e.groupTransition=function(t,e,r,n){function i(t){var e={position:I.clone(t.position),rotation:t.rotation};return t.shape&&(e.shape=k.extend({},t.shape)),e}if(t&&e){var a=function(t){var e={};return t.traverse(function(t){!t.isGroup&&t.anid&&(e[t.anid]=t)}),e}(t);e.traverse(function(t){if(!t.isGroup&&t.anid){var e=a[t.anid];if(e){var n=i(t);t.attr(i(e)),M(t,n,r,t.dataIndex)}}})}},e.clipPointsByRect=function(t,e){return k.map(t,function(t){var r=t[0];r=K(r,e.x),r=J(r,e.x+e.width);var n=t[1];return n=K(n,e.y),[r,n=J(n,e.y+e.height)]})},e.clipRectByRect=function(t,e){var r=K(t.x,e.x),n=J(t.x+t.width,e.x+e.width),i=K(t.y,e.y),a=J(t.y+t.height,e.y+e.height);if(n>=r&&a>=i)return{x:r,y:i,width:n-r,height:a-i}},e.createIcon=function(t,e,r){var i=(e=k.extend({rectHover:!0},e)).style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return 0===t.indexOf("image://")?(i.image=t.slice(8),k.defaults(i,r),new L(e)):n(t.replace("path://",""),e,r,"center")}},function(t,e,r){function n(t,e,r,n,i,a,o,s,f,v,g){var y=f*(c/180),m=u(y)*(t-r)/2+h(y)*(e-n)/2,x=-1*h(y)*(t-r)/2+u(y)*(e-n)/2,_=m*m/(o*o)+x*x/(s*s);_>1&&(o*=l(_),s*=l(_));var b=(i===a?-1:1)*l((o*o*(s*s)-o*o*(x*x)-s*s*(m*m))/(o*o*(x*x)+s*s*(m*m)))||0,w=b*o*x/s,S=b*-s*m/o,T=(t+r)/2+u(y)*w-h(y)*S,M=(e+n)/2+h(y)*w+u(y)*S,P=p([1,0],[(m-w)/o,(x-S)/s]),k=[(m-w)/o,(x-S)/s],O=[(-1*m-w)/o,(-1*x-S)/s],C=p(k,O);d(k,O)<=-1&&(C=c),d(k,O)>=1&&(C=0),0===a&&C>0&&(C-=2*c),1===a&&C<0&&(C+=2*c),g.addData(v,T,M,o,s,P,C,y,a)}function i(t,e){var r=function(t){if(!t)return new o;for(var e,r=0,i=0,a=r,s=i,l=new o,h=o.CMD,u=t.match(v),c=0;c0},extendFrom:function(t,e){if(t)for(var r in t)!t.hasOwnProperty(r)||!0!==e&&(!1===e?this.hasOwnProperty(r):null==t[r])||(this[r]=t[r])},set:function(t,e){"string"==typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,r){for(var a=("radial"===e.type?i:n)(t,e,r),o=e.colorStops,s=0;s3&&(i=n.call(i,1));for(var o=e.length,s=0;s4&&(i=n.call(i,1,i.length-1));for(var o=i[i.length-1],s=e.length,l=0;l0&&t.animate(e,!1).when(null==o?500:o,h).delay(s||0)}function a(t,e,r,n){if(e){var i={};i[e]={},i[e][r]=n,t.attr(i)}else t.attr(r,n)}var o=r(46),s=r(49),l=r(0),h=l.isString,u=l.isFunction,c=l.isObject,f=l.isArrayLike,d=l.indexOf,p=function(){this.animators=[]};p.prototype={constructor:p,animate:function(t,e){var r,n=!1,i=this,a=this.__zr;if(t){var l=t.split("."),h=i;n="shape"===l[0];for(var u=0,c=l.length;u.5?e:t}function s(t,e,r,n,i){var o=t.length;if(1===i)for(var s=0;si)t.length=i;else for(var a=n;a=0&&!(k[r]<=e);r--);r=Math.min(r,_-2)}else{for(r=W;r<_&&!(k[r]>e);r++);r=Math.min(r-1,_-2)}W=r,q=e;var n=k[r+1]-k[r];if(0!==n)if(B=(e-k[r])/n,x)if(F=O[r],E=O[0===r?r:r-1],z=O[r>_-2?_-1:r+1],N=O[r>_-3?_-1:r+2],S)u(E,F,z,N,B,B*B,B*B*B,p(t,i),P);else{if(T)l=u(E,F,z,N,B,B*B,B*B*B,j,1),l=d(j);else{if(M)return o(F,z,B);l=c(E,F,z,N,B,B*B,B*B*B)}m(t,i,l)}else if(S)s(O[r],O[r+1],B,p(t,i),P);else{var l;if(T)s(O[r],O[r+1],B,j,1),l=d(j);else{if(M)return o(O[r],O[r+1],B);l=a(O[r],O[r+1],B)}m(t,i,l)}},ondestroy:r});return e&&"spline"!==e&&(H.easing=e),H}}}var v=r(47),g=r(19),y=r(0).isArrayLike,m=Array.prototype.slice,x=function(t,e,r,a){this._tracks={},this._target=t,this._loop=e||!1,this._getter=r||n,this._setter=a||i,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};x.prototype={when:function(t,e){var r=this._tracks;for(var n in e)if(e.hasOwnProperty(n)){if(!r[n]){r[n]=[];var i=this._getter(this._target,n);if(null==i)continue;0!==t&&r[n].push({time:0,value:f(i)})}r[n].push({time:t,value:e[n]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t1&&(i=function(){for(var t in arguments)console.log(arguments[t])});var a=i;t.exports=a},function(t,e,r){var n=r(22),i=r(3),a=r(8).WILL_BE_RESTORED,o=new i,s=function(){};s.prototype={constructor:s,drawRectText:function(t,e){var r=this.style;e=r.textRect||e,this.__dirty&&n.normalizeTextStyle(r,!0);var i=r.text;if(null!=i&&(i+=""),n.needDrawText(i,r)){t.save();var s=this.transform;r.transformText?this.setTransform(t):s&&(o.copy(e),o.applyTransform(s),e=o),n.renderText(this,t,i,r,e,a),t.restore()}}};var l=s;t.exports=l},function(t,e,r){var n=r(2),i=r(4),a=Math.min,o=Math.max,s=Math.sin,l=Math.cos,h=2*Math.PI,u=n.create(),c=n.create(),f=n.create(),d=[],p=[];e.fromPoints=function(t,e,r){if(0!==t.length){var n,i=t[0],s=i[0],l=i[0],h=i[1],u=i[1];for(n=1;n1e-4)return p[0]=t-r,p[1]=e-i,v[0]=t+r,void(v[1]=e+i);if(u[0]=l(a)*r+t,u[1]=s(a)*i+e,c[0]=l(o)*r+t,c[1]=s(o)*i+e,g(p,u,c),y(v,u,c),(a%=h)<0&&(a+=h),(o%=h)<0&&(o+=h),a>o&&!d?o+=h:aa&&(f[0]=l(_)*r+t,f[1]=s(_)*i+e,g(p,f,p),y(v,f,v))}},function(t,e,r){function n(t,e){return Math.abs(t-e)e&&u>n&&u>o&&u>l||u1&&i(),f=v.cubicAt(e,n,o,l,b[0]),g>1&&(d=v.cubicAt(e,n,o,l,b[1]))),p+=2===g?me&&s>n&&s>a||s=0&&h<=1){for(var u=0,c=v.quadraticAt(e,n,a,h),f=0;fr||s<-r)return 0;var l=Math.sqrt(r*r-s*s);_[0]=-l,_[1]=l;var h=Math.abs(n-i);if(h<1e-4)return 0;if(h%m<1e-4){n=0,i=m;var u=a?1:-1;return o>=_[0]+t&&o<=_[1]+t?u:0}if(a){l=n;n=p(i),i=p(l)}else n=p(n),i=p(i);n>i&&(i+=m);for(var c=0,f=0;f<2;f++){var d=_[f];if(d+t>o){var v=Math.atan2(s,d);u=a?1:-1;v<0&&(v=m+v),(v>=n&&v<=i||v+m>=n&&v+m<=i)&&(v>Math.PI/2&&v<1.5*Math.PI&&(u=-u),c+=u)}}return c}function l(t,e,r,i,l){for(var h=0,p=0,v=0,m=0,x=0,_=0;_1&&(r||(h+=g(p,v,m,x,i,l))),1===_&&(m=p=t[_],x=v=t[_+1]),b){case y.M:p=m=t[_++],v=x=t[_++];break;case y.L:if(r){if(u.containStroke(p,v,t[_],t[_+1],e,i,l))return!0}else h+=g(p,v,t[_],t[_+1],i,l)||0;p=t[_++],v=t[_++];break;case y.C:if(r){if(c.containStroke(p,v,t[_++],t[_++],t[_++],t[_++],t[_],t[_+1],e,i,l))return!0}else h+=a(p,v,t[_++],t[_++],t[_++],t[_++],t[_],t[_+1],i,l)||0;p=t[_++],v=t[_++];break;case y.Q:if(r){if(f.containStroke(p,v,t[_++],t[_++],t[_],t[_+1],e,i,l))return!0}else h+=o(p,v,t[_++],t[_++],t[_],t[_+1],i,l)||0;p=t[_++],v=t[_++];break;case y.A:var w=t[_++],S=t[_++],T=t[_++],M=t[_++],P=t[_++],k=t[_++];_+=1;var O=1-t[_++],C=Math.cos(P)*T+w,A=Math.sin(P)*M+S;_>1?h+=g(p,v,C,A,i,l):(m=C,x=A);var I=(i-w)*M/T+w;if(r){if(d.containStroke(w,S,M,P,P+k,O,e,I,l))return!0}else h+=s(w,S,M,P,P+k,O,I,l);p=Math.cos(P+k)*T+w,v=Math.sin(P+k)*M+S;break;case y.R:m=p=t[_++],x=v=t[_++];C=m+t[_++],A=x+t[_++];if(r){if(u.containStroke(m,x,C,x,e,i,l)||u.containStroke(C,x,C,A,e,i,l)||u.containStroke(C,A,m,A,e,i,l)||u.containStroke(m,A,m,x,e,i,l))return!0}else h+=g(C,x,C,A,i,l),h+=g(m,A,m,x,i,l);break;case y.Z:if(r){if(u.containStroke(p,v,m,x,e,i,l))return!0}else h+=g(p,v,m,x,i,l);p=m,v=x}}return r||n(v,x)||(h+=g(p,v,m,x,i,l)||0),0!==h}var h=r(9),u=r(53),c=r(54),f=r(55),d=r(56),p=r(25).normalizeRadian,v=r(4),g=r(57),y=h.CMD,m=2*Math.PI,x=1e-4,_=[-1,-1,-1],b=[-1,-1];e.contain=function(t,e,r){return l(t,0,!1,e,r)},e.containStroke=function(t,e,r,n){return l(t,e,!0,r,n)}},function(t,e){e.containStroke=function(t,e,r,n,i,a,o){if(0===i)return!1;var s,l=i;if(o>e+l&&o>n+l||ot+l&&a>r+l||ae+f&&c>i+f&&c>o+f&&c>l+f||ct+f&&u>r+f&&u>a+f&&u>s+f||ue+u&&h>i+u&&h>o+u||ht+u&&l>r+u&&l>a+u||lr||f+co&&(o+=i);var p=Math.atan2(u,h);return p<0&&(p+=i),p>=a&&p<=o||p+i>=a&&p+i<=o}},function(t,e){t.exports=function(t,e,r,n,i,a){if(a>e&&a>n||ai?o:0}},function(t,e){var r=function(t,e){this.image=t,this.repeat=e,this.type="pattern"};r.prototype.getCanvasPattern=function(t){return t.createPattern(this.image,this.repeat||"repeat")};var n=r;t.exports=n},function(t,e,r){var n=r(9),i=r(2).applyTransform,a=n.CMD,o=[[],[],[]],s=Math.sqrt,l=Math.atan2;t.exports=function(t,e){var r,n,h,u,c,f=t.data,d=a.M,p=a.C,v=a.L,g=a.R,y=a.A,m=a.Q;for(h=0,u=0;h=0&&(r.splice(n,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,r=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof o&&t.addChildrenToStorage(e)),r&&r.refresh()},remove:function(t){var e=this.__zr,r=this.__storage,i=this._children,a=n.indexOf(i,t);return a<0?this:(i.splice(a,1),t.parent=null,r&&(r.delFromStorage(t),t instanceof o&&t.delChildrenFromStorage(r)),e&&e.refresh(),this)},removeAll:function(){var t,e,r=this._children,n=this.__storage;for(e=0;e=11?function(){var e,r=this.__clipPaths,n=this.style;if(r)for(var a=0;ar-2?r-1:d+1],c=t[d>r-3?r-1:d+2]);var g=p*p,y=p*g;a.push([n(h[0],v[0],u[0],c[0],p,g,y),n(h[1],v[1],u[1],c[1],p,g,y)])}return a}},function(t,e,r){var n=r(2),i=n.min,a=n.max,o=n.scale,s=n.distance,l=n.add,h=n.clone,u=n.sub;t.exports=function(t,e,r,n){var c,f,d,p,v=[],g=[],y=[],m=[];if(n){d=[1/0,1/0],p=[-1/0,-1/0];for(var x=0,_=t.length;x<_;x++)i(d,d,t[x]),a(p,p,t[x]);i(d,d,n[0]),a(p,p,n[1])}for(x=0,_=t.length;x<_;x++){var b=t[x];if(r)c=t[x?x-1:_-1],f=t[(x+1)%_];else{if(0===x||x===_-1){v.push(h(t[x]));continue}c=t[x-1],f=t[x+1]}u(g,f,c),o(g,g,e);var w=s(b,c),S=s(b,f),T=w+S;0!==T&&(w/=T,S/=T),o(y,g,-w),o(m,g,S);var M=l([],b,y),P=l([],b,m);n&&(a(M,M,d),i(M,M,p),a(P,P,d),i(P,P,p)),v.push(M),v.push(P)}return r&&v.push(v.shift()),v}},function(t,e,r){var n=r(1),i=r(26),a=n.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(t,e){i.buildPath(t,e,!1)}});t.exports=a},function(t,e,r){var n=r(1),i=r(24),a=r(27).subPixelOptimizeRect,o={},s=n.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(t,e){var r,n,s,l;this.subPixelOptimize?(a(o,e,this.style),r=o.x,n=o.y,s=o.width,l=o.height,o.r=e.r,e=o):(r=e.x,n=e.y,s=e.width,l=e.height),e.r?i.buildPath(t,e):t.rect(r,n,s,l),t.closePath()}});t.exports=s},function(t,e,r){var n=r(1),i=r(27).subPixelOptimizeLine,a={},o=n.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var r,n,o,s;this.subPixelOptimize?(i(a,e,this.style),r=a.x1,n=a.y1,o=a.x2,s=a.y2):(r=e.x1,n=e.y1,o=e.x2,s=e.y2);var l=e.percent;0!==l&&(t.moveTo(r,n),l<1&&(o=r*(1-l)+o*l,s=n*(1-l)+s*l),t.lineTo(o,s))},pointAt:function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]}});t.exports=o},function(t,e,r){function n(t,e,r){var n=t.cpx2,i=t.cpy2;return null===n||null===i?[(r?f:u)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?f:u)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?c:h)(t.x1,t.cpx1,t.x2,e),(r?c:h)(t.y1,t.cpy1,t.y2,e)]}var i=r(1),a=r(2),o=r(4),s=o.quadraticSubdivide,l=o.cubicSubdivide,h=o.quadraticAt,u=o.cubicAt,c=o.quadraticDerivativeAt,f=o.cubicDerivativeAt,d=[],p=i.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var r=e.x1,n=e.y1,i=e.x2,a=e.y2,o=e.cpx1,h=e.cpy1,u=e.cpx2,c=e.cpy2,f=e.percent;0!==f&&(t.moveTo(r,n),null==u||null==c?(f<1&&(s(r,o,i,f,d),o=d[1],i=d[2],s(n,h,a,f,d),h=d[1],a=d[2]),t.quadraticCurveTo(o,h,i,a)):(f<1&&(l(r,o,u,i,f,d),o=d[1],u=d[2],i=d[3],l(n,h,c,a,f,d),h=d[1],c=d[2],a=d[3]),t.bezierCurveTo(o,h,u,c,i,a)))},pointAt:function(t){return n(this.shape,t,!1)},tangentAt:function(t){var e=n(this.shape,t,!0);return a.normalize(e,e)}});t.exports=p},function(t,e,r){var n=r(1).extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var r=e.cx,n=e.cy,i=Math.max(e.r,0),a=e.startAngle,o=e.endAngle,s=e.clockwise,l=Math.cos(a),h=Math.sin(a);t.moveTo(l*i+r,h*i+n),t.arc(r,n,i,a,o,!s)}});t.exports=n},function(t,e,r){var n=r(1),i=n.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var t=this.__dirtyPath,e=this.shape.paths,r=0;r0;)e.phase-=2*Math.PI;var i=e.phase/Math.PI/2*e.waveLength,a=e.cx-e.radius+i-2*e.radius;t.moveTo(a,e.waterLevel);for(var o=0,s=0;s. + pointerEventsSupported: 'onpointerdown' in window + // Firefox supports pointer but not by default, only MS browsers are reliable on pointer + // events currently. So we dont use that on other browsers unless tested sufficiently. + // Although IE 10 supports pointer event, it use old style and is different from the + // standard. So we exclude that. (IE 10 is hardly used on touch device) + && (browser.edge || (browser.ie && browser.version >= 11)), + // passiveSupported: detectPassiveSupport() + domSupported: typeof document !== 'undefined' + }; +} + +// See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection +// function detectPassiveSupport() { +// // Test via a getter in the options object to see if the passive property is accessed +// var supportsPassive = false; +// try { +// var opts = Object.defineProperty({}, 'passive', { +// get: function() { +// supportsPassive = true; +// } +// }); +// window.addEventListener('testPassive', function() {}, opts); +// } catch (e) { +// } +// return supportsPassive; +// } + +/** + * @module zrender/core/util + */ + +// 用于处理merge时无法遍历Date等对象的问题 +var BUILTIN_OBJECT = { + '[object Function]': 1, + '[object RegExp]': 1, + '[object Date]': 1, + '[object Error]': 1, + '[object CanvasGradient]': 1, + '[object CanvasPattern]': 1, + // For node-canvas + '[object Image]': 1, + '[object Canvas]': 1 +}; + +var TYPED_ARRAY = { + '[object Int8Array]': 1, + '[object Uint8Array]': 1, + '[object Uint8ClampedArray]': 1, + '[object Int16Array]': 1, + '[object Uint16Array]': 1, + '[object Int32Array]': 1, + '[object Uint32Array]': 1, + '[object Float32Array]': 1, + '[object Float64Array]': 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; + +// Avoid assign to an exported variable, for transforming to cjs. +var methods = {}; + +function $override(name, fn) { + // Clear ctx instance for different environment + if (name === 'createCanvas') { + _ctx = null; + } + + methods[name] = fn; +} + +/** + * Those data types can be cloned: + * Plain object, Array, TypedArray, number, string, null, undefined. + * Those data types will be assgined using the orginal data: + * BUILTIN_OBJECT + * Instance of user defined class will be cloned to a plain object, without + * properties in prototype. + * Other data types is not supported (not sure what will happen). + * + * Caution: do not support clone Date, for performance consideration. + * (There might be a large number of date in `series.data`). + * So date should not be modified in and out of echarts. + * + * @param {*} source + * @return {*} new + */ +function clone(source) { + if (source == null || typeof source != 'object') { + return source; + } + + var result = source; + var typeStr = objToString.call(source); + + if (typeStr === '[object Array]') { + if (!isPrimitive(source)) { + result = []; + for (var i = 0, len = source.length; i < len; i++) { + result[i] = clone(source[i]); + } + } + } + else if (TYPED_ARRAY[typeStr]) { + if (!isPrimitive(source)) { + var Ctor = source.constructor; + if (source.constructor.from) { + result = Ctor.from(source); + } + else { + result = new Ctor(source.length); + for (var i = 0, len = source.length; i < len; i++) { + result[i] = clone(source[i]); + } + } + } + } + else if (!BUILTIN_OBJECT[typeStr] && !isPrimitive(source) && !isDom(source)) { + result = {}; + for (var key in source) { + if (source.hasOwnProperty(key)) { + result[key] = clone(source[key]); + } + } + } + + return result; +} + +/** + * @memberOf module:zrender/core/util + * @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$1(source) || !isObject$1(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$1(sourceProp) + && isObject$1(targetProp) + && !isArray(sourceProp) + && !isArray(targetProp) + && !isDom(sourceProp) + && !isDom(targetProp) + && !isBuiltInObject(sourceProp) + && !isBuiltInObject(targetProp) + && !isPrimitive(sourceProp) + && !isPrimitive(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 + * @memberOf module:zrender/core/util + */ +function extend(target, source) { + for (var key in source) { + if (source.hasOwnProperty(key)) { + target[key] = source[key]; + } + } + return target; +} + +/** + * @param {*} target + * @param {*} source + * @param {boolean} [overlay=false] + * @memberOf module:zrender/core/util + */ +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; +} + +var createCanvas = function () { + return methods.createCanvas(); +}; + +methods.createCanvas = function () { + 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 = createCanvas().getContext('2d'); + } + return _ctx; +} + +/** + * 查询数组中元素的index + * @memberOf module:zrender/core/util + */ +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; +} + +/** + * 构造类继承关系 + * + * @memberOf module:zrender/core/util + * @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; +} + +/** + * @memberOf module:zrender/core/util + * @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); +} + +/** + * Consider typed array. + * @param {Array|TypedArray} data + */ +function isArrayLike(data) { + if (! data) { + return; + } + if (typeof data == 'string') { + return false; + } + return typeof data.length == 'number'; +} + +/** + * 数组或对象遍历 + * @memberOf module:zrender/core/util + * @param {Object|Array} obj + * @param {Function} cb + * @param {*} [context] + */ +function each$1(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/core/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/core/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/core/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/core/util + * @param {Array} obj + * @param {Function} cb + * @param {*} [context] + * @return {*} + */ +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/core/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/core/util + * @param {Function} func + * @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/core/util + * @param {*} value + * @return {boolean} + */ +function isArray(value) { + return objToString.call(value) === '[object Array]'; +} + +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ +function isFunction$1(value) { + return typeof value === 'function'; +} + +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ +function isString(value) { + return objToString.call(value) === '[object String]'; +} + +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ +function isObject$1(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/core/util + * @param {*} value + * @return {boolean} + */ +function isBuiltInObject(value) { + return !!BUILTIN_OBJECT[objToString.call(value)]; +} + +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ +function isTypedArray(value) { + return !!TYPED_ARRAY[objToString.call(value)]; +} + +/** + * @memberOf module:zrender/core/util + * @param {*} value + * @return {boolean} + */ +function isDom(value) { + return typeof value === 'object' + && typeof value.nodeType === 'number' + && typeof value.ownerDocument === 'object'; +} + +/** + * Whether is exactly NaN. Notice isNaN('a') returns true. + * @param {*} value + * @return {boolean} + */ +function eqNaN(value) { + return value !== value; +} + +/** + * If value1 is not null, then return value1, otherwise judget rest of values. + * Low performance. + * @memberOf module:zrender/core/util + * @return {*} Final value + */ +function retrieve(values) { + for (var i = 0, len = arguments.length; i < len; i++) { + if (arguments[i] != null) { + return arguments[i]; + } + } +} + +function retrieve2(value0, value1) { + return value0 != null + ? value0 + : value1; +} + +function retrieve3(value0, value1, value2) { + return value0 != null + ? value0 + : value1 != null + ? value1 + : value2; +} + +/** + * @memberOf module:zrender/core/util + * @param {Array} arr + * @param {number} startIndex + * @param {number} endIndex + * @return {Array} + */ +function slice() { + return Function.call.apply(nativeSlice, arguments); +} + +/** + * 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.} val + * @return {Array.} + */ +function normalizeCssArray(val) { + if (typeof (val) === 'number') { + return [val, val, val, val]; + } + var len = val.length; + 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; +} + +/** + * @memberOf module:zrender/core/util + * @param {boolean} condition + * @param {string} message + */ +function assert$1(condition, message) { + if (!condition) { + throw new Error(message); + } +} + +/** + * @memberOf module:zrender/core/util + * @param {string} str string to be trimed + * @return {string} trimed string + */ +function trim(str) { + if (str == null) { + return null; + } + else if (typeof str.trim === 'function') { + return str.trim(); + } + else { + return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); + } +} + +var primitiveKey = '__ec_primitive__'; +/** + * Set an object as primitive to be ignored traversing children in clone or merge + */ +function setAsPrimitive(obj) { + obj[primitiveKey] = true; +} + +function isPrimitive(obj) { + return obj[primitiveKey]; +} + +/** + * @constructor + * @param {Object} obj Only apply `ownProperty`. + */ +function HashMap(obj) { + var isArr = isArray(obj); + // Key should not be set on this, otherwise + // methods get/set/... may be overrided. + this.data = {}; + var thisMap = this; + + (obj instanceof HashMap) + ? obj.each(visit) + : (obj && each$1(obj, visit)); + + function visit(value, key) { + isArr ? thisMap.set(value, key) : thisMap.set(key, value); + } +} + +HashMap.prototype = { + constructor: HashMap, + // Do not provide `has` method to avoid defining what is `has`. + // (We usually treat `null` and `undefined` as the same, different + // from ES6 Map). + get: function (key) { + return this.data.hasOwnProperty(key) ? this.data[key] : null; + }, + set: function (key, value) { + // Comparing with invocation chaining, `return value` is more commonly + // used in this case: `var someVal = map.set('a', genVal());` + return (this.data[key] = value); + }, + // Although util.each can be performed on this hashMap directly, user + // should not use the exposed keys, who are prefixed. + each: function (cb, context) { + context !== void 0 && (cb = bind(cb, context)); + for (var key in this.data) { + this.data.hasOwnProperty(key) && cb(this.data[key], key); + } + }, + // Do not use this method if performance sensitive. + removeKey: function (key) { + delete this.data[key]; + } +}; + +function createHashMap(obj) { + return new HashMap(obj); +} + +function concatArray(a, b) { + var newArray = new a.constructor(a.length + b.length); + for (var i = 0; i < a.length; i++) { + newArray[i] = a[i]; + } + var offset = a.length; + for (i = 0; i < b.length; i++) { + newArray[i + offset] = b[i]; + } + return newArray; +} + + +function noop() {} + + +var zrUtil = (Object.freeze || Object)({ + $override: $override, + clone: clone, + merge: merge, + mergeAll: mergeAll, + extend: extend, + defaults: defaults, + createCanvas: createCanvas, + getContext: getContext, + indexOf: indexOf, + inherits: inherits, + mixin: mixin, + isArrayLike: isArrayLike, + each: each$1, + map: map, + reduce: reduce, + filter: filter, + find: find, + bind: bind, + curry: curry, + isArray: isArray, + isFunction: isFunction$1, + isString: isString, + isObject: isObject$1, + isBuiltInObject: isBuiltInObject, + isTypedArray: isTypedArray, + isDom: isDom, + eqNaN: eqNaN, + retrieve: retrieve, + retrieve2: retrieve2, + retrieve3: retrieve3, + slice: slice, + normalizeCssArray: normalizeCssArray, + assert: assert$1, + trim: trim, + setAsPrimitive: setAsPrimitive, + isPrimitive: isPrimitive, + createHashMap: createHashMap, + concatArray: concatArray, + noop: noop +}); + +var ArrayCtor = typeof Float32Array === 'undefined' + ? Array + : Float32Array; + +/** + * 创建一个向量 + * @param {number} [x=0] + * @param {number} [y=0] + * @return {Vector2} + */ +function create(x, y) { + var out = new ArrayCtor(2); + if (x == null) { + x = 0; + } + if (y == null) { + y = 0; + } + out[0] = x; + out[1] = y; + return out; +} + +/** + * 复制向量数据 + * @param {Vector2} out + * @param {Vector2} v + * @return {Vector2} + */ +function copy(out, v) { + out[0] = v[0]; + out[1] = v[1]; + return out; +} + +/** + * 克隆一个向量 + * @param {Vector2} v + * @return {Vector2} + */ +function clone$1(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} 结果 + */ +function set(out, a, b) { + out[0] = a; + out[1] = b; + return out; +} + +/** + * 向量相加 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ +function add(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 + */ +function scaleAndAdd(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 + */ +function sub(out, v1, v2) { + out[0] = v1[0] - v2[0]; + out[1] = v1[1] - v2[1]; + return out; +} + +/** + * 向量长度 + * @param {Vector2} v + * @return {number} + */ +function len(v) { + return Math.sqrt(lenSquare(v)); +} +var length = len; // jshint ignore:line + +/** + * 向量长度平方 + * @param {Vector2} v + * @return {number} + */ +function lenSquare(v) { + return v[0] * v[0] + v[1] * v[1]; +} +var lengthSquare = lenSquare; + +/** + * 向量乘法 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + */ +function mul(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 + */ +function div(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} + */ +function dot(v1, v2) { + return v1[0] * v2[0] + v1[1] * v2[1]; +} + +/** + * 向量缩放 + * @param {Vector2} out + * @param {Vector2} v + * @param {number} s + */ +function scale(out, v, s) { + out[0] = v[0] * s; + out[1] = v[1] * s; + return out; +} + +/** + * 向量归一化 + * @param {Vector2} out + * @param {Vector2} v + */ +function normalize(out, v) { + var d = 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} + */ +function distance(v1, v2) { + return Math.sqrt( + (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]) + ); +} +var dist = distance; + +/** + * 向量距离平方 + * @param {Vector2} v1 + * @param {Vector2} v2 + * @return {number} + */ +function distanceSquare(v1, v2) { + return (v1[0] - v2[0]) * (v1[0] - v2[0]) + + (v1[1] - v2[1]) * (v1[1] - v2[1]); +} +var distSquare = distanceSquare; + +/** + * 求负向量 + * @param {Vector2} out + * @param {Vector2} v + */ +function negate(out, v) { + out[0] = -v[0]; + out[1] = -v[1]; + return out; +} + +/** + * 插值两个点 + * @param {Vector2} out + * @param {Vector2} v1 + * @param {Vector2} v2 + * @param {number} t + */ +function lerp(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 + */ +function applyTransform(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 + */ +function min(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 + */ +function max(out, v1, v2) { + out[0] = Math.max(v1[0], v2[0]); + out[1] = Math.max(v1[1], v2[1]); + return out; +} + + +var vector = (Object.freeze || Object)({ + create: create, + copy: copy, + clone: clone$1, + set: set, + add: add, + scaleAndAdd: scaleAndAdd, + sub: sub, + len: len, + length: length, + lenSquare: lenSquare, + lengthSquare: lengthSquare, + mul: mul, + div: div, + dot: dot, + scale: scale, + normalize: normalize, + distance: distance, + dist: dist, + distanceSquare: distanceSquare, + distSquare: distSquare, + negate: negate, + lerp: lerp, + applyTransform: applyTransform, + min: min, + max: max +}); + +// 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.dispatchToElement(param(draggingTarget, e), '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.dispatchToElement(param(draggingTarget, e), 'drag', e.event); + + var dropTarget = this.findHover(x, y, draggingTarget).target; + var lastDropTarget = this._dropTarget; + this._dropTarget = dropTarget; + + if (draggingTarget !== dropTarget) { + if (lastDropTarget && dropTarget !== lastDropTarget) { + this.dispatchToElement(param(lastDropTarget, e), 'dragleave', e.event); + } + if (dropTarget && dropTarget !== lastDropTarget) { + this.dispatchToElement(param(dropTarget, e), 'dragenter', e.event); + } + } + } + }, + + _dragEnd: function (e) { + var draggingTarget = this._draggingTarget; + + if (draggingTarget) { + draggingTarget.dragging = false; + } + + this.dispatchToElement(param(draggingTarget, e), 'dragend', e.event); + + if (this._dropTarget) { + this.dispatchToElement(param(this._dropTarget, e), 'drop', e.event); + } + + this._draggingTarget = null; + this._dropTarget = null; + } + +}; + +function param(target, e) { + return {target: target, topTarget: e && e.topTarget}; +} + +/** + * Event Mixin + * @module zrender/mixin/Eventful + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + * pissang (https://www.github.com/pissang) + */ + +var arrySlice = Array.prototype.slice; + +/** + * Event dispatcher. + * + * @alias module:zrender/mixin/Eventful + * @constructor + * @param {Object} [eventProcessor] The object eventProcessor is the scope when + * `eventProcessor.xxx` called. + * @param {Function} [eventProcessor.normalizeQuery] + * param: {string|Object} Raw query. + * return: {string|Object} Normalized query. + * @param {Function} [eventProcessor.filter] Event will be dispatched only + * if it returns `true`. + * param: {string} eventType + * param: {string|Object} query + * return: {boolean} + */ +var Eventful = function (eventProcessor) { + this._$handlers = {}; + this._$eventProcessor = eventProcessor; +}; + +Eventful.prototype = { + + constructor: Eventful, + + /** + * The handler can only be triggered once, then removed. + * + * @param {string} event The event name. + * @param {string|Object} [query] Condition used on event filter. + * @param {Function} handler The event handler. + * @param {Object} context + */ + one: function (event, query, handler, context) { + var _h = this._$handlers; + + if (typeof query === 'function') { + context = handler; + handler = query; + query = null; + } + + if (!handler || !event) { + return this; + } + + query = normalizeQuery(this, query); + + if (!_h[event]) { + _h[event] = []; + } + + for (var i = 0; i < _h[event].length; i++) { + if (_h[event][i].h === handler) { + return this; + } + } + + _h[event].push({ + h: handler, + one: true, + query: query, + ctx: context || this + }); + + return this; + }, + + /** + * Bind a handler. + * + * @param {string} event The event name. + * @param {string|Object} [query] Condition used on event filter. + * @param {Function} handler The event handler. + * @param {Object} [context] + */ + on: function (event, query, handler, context) { + var _h = this._$handlers; + + if (typeof query === 'function') { + context = handler; + handler = query; + query = null; + } + + if (!handler || !event) { + return this; + } + + query = normalizeQuery(this, query); + + if (!_h[event]) { + _h[event] = []; + } + + for (var i = 0; i < _h[event].length; i++) { + if (_h[event][i].h === handler) { + return this; + } + } + + _h[event].push({ + h: handler, + one: false, + query: query, + ctx: context || this + }); + + return this; + }, + + /** + * Whether any handler has bound. + * + * @param {string} event + * @return {boolean} + */ + isSilent: function (event) { + var _h = this._$handlers; + return _h[event] && _h[event].length; + }, + + /** + * Unbind a event. + * + * @param {string} event The event name. + * @param {Function} [handler] The event 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; + }, + + /** + * Dispatch a event. + * + * @param {string} type The event name. + */ + trigger: function (type) { + if (this._$handlers[type]) { + var args = arguments; + var argLen = args.length; + var eventProcessor = this._$eventProcessor; + + if (argLen > 3) { + args = arrySlice.call(args, 1); + } + + var _h = this._$handlers[type]; + var len = _h.length; + for (var i = 0; i < len;) { + var hItem = _h[i]; + if (eventProcessor + && eventProcessor.filter + && hItem.query != null + && !eventProcessor.filter(type, hItem.query) + ) { + i++; + continue; + } + + // Optimize advise from backbone + switch (argLen) { + case 1: + hItem.h.call(hItem.ctx); + break; + case 2: + hItem.h.call(hItem.ctx, args[1]); + break; + case 3: + hItem.h.call(hItem.ctx, args[1], args[2]); + break; + default: + // have more than 2 given arguments + hItem.h.apply(hItem.ctx, args); + break; + } + + if (hItem.one) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + }, + + /** + * Dispatch a event with context, which is specified at the last parameter. + * + * @param {string} type The event name. + */ + triggerWithContext: function (type) { + if (this._$handlers[type]) { + var args = arguments; + var argLen = args.length; + var eventProcessor = this._$eventProcessor; + + 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;) { + var hItem = _h[i]; + if (eventProcessor + && eventProcessor.filter + && hItem.query != null + && !eventProcessor.filter(type, hItem.query) + ) { + i++; + continue; + } + + // Optimize advise from backbone + switch (argLen) { + case 1: + hItem.h.call(ctx); + break; + case 2: + hItem.h.call(ctx, args[1]); + break; + case 3: + hItem.h.call(ctx, args[1], args[2]); + break; + default: + // have more than 2 given arguments + hItem.h.apply(ctx, args); + break; + } + + if (hItem.one) { + _h.splice(i, 1); + len--; + } + else { + i++; + } + } + } + + return this; + } +}; + +function normalizeQuery(host, query) { + var eventProcessor = host._$eventProcessor; + if (query != null && eventProcessor && eventProcessor.normalizeQuery) { + query = eventProcessor.normalizeQuery(query); + } + return query; +} + +/** + * 事件辅助类 + * @module zrender/core/event + * @author Kener (@Kener-林峰, kener.linfeng@gmail.com) + */ + +var isDomLevel2 = (typeof window !== 'undefined') && !!window.addEventListener; + +var MOUSE_EVENT_REG = /^(?:mouse|pointer|contextmenu|drag|drop)|click/; + +function getBoundingClientRect(el) { + // BlackBerry 5, iOS 3 (original iPhone) don't have getBoundingRect + return el.getBoundingClientRect ? el.getBoundingClientRect() : {left: 0, top: 0}; +} + +// `calculate` is optional, default false +function clientToLocal(el, e, out, calculate) { + out = out || {}; + + // According to the W3C Working Draft, offsetX and offsetY should be relative + // to the padding edge of the target element. The only browser using this convention + // is IE. Webkit uses the border edge, Opera uses the content edge, and FireFox does + // not support the properties. + // (see http://www.jacklmoore.com/notes/mouse-position/) + // In zr painter.dom, padding edge equals to border edge. + + // FIXME + // When mousemove event triggered on ec tooltip, target is not zr painter.dom, and + // offsetX/Y is relative to e.target, where the calculation of zrX/Y via offsetX/Y + // is too complex. So css-transfrom dont support in this case temporarily. + if (calculate || !env$1.canvasSupported) { + defaultGetZrXY(el, e, out); + } + // Caution: In FireFox, layerX/layerY Mouse position relative to the closest positioned + // ancestor element, so we should make sure el is positioned (e.g., not position:static). + // BTW1, Webkit don't return the same results as FF in non-simple cases (like add + // zoom-factor, overflow / opacity layers, transforms ...) + // BTW2, (ev.offsetY || ev.pageY - $(ev.target).offset().top) is not correct in preserve-3d. + // + // BTW3, In ff, offsetX/offsetY is always 0. + else if (env$1.browser.firefox && e.layerX != null && e.layerX !== e.offsetX) { + out.zrX = e.layerX; + out.zrY = e.layerY; + } + // For IE6+, chrome, safari, opera. (When will ff support offsetX?) + else if (e.offsetX != null) { + out.zrX = e.offsetX; + out.zrY = e.offsetY; + } + // For some other device, e.g., IOS safari. + else { + defaultGetZrXY(el, e, out); + } + + return out; +} + +function defaultGetZrXY(el, e, out) { + // This well-known method below does not support css transform. + var box = getBoundingClientRect(el); + out.zrX = e.clientX - box.left; + out.zrY = e.clientY - box.top; +} + +/** + * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标. + * `calculate` is optional, default false. + */ +function normalizeEvent(el, e, calculate) { + + e = e || window.event; + + if (e.zrX != null) { + return e; + } + + var eventType = e.type; + var isTouch = eventType && eventType.indexOf('touch') >= 0; + + if (!isTouch) { + clientToLocal(el, e, e, calculate); + e.zrDelta = (e.wheelDelta) ? e.wheelDelta / 120 : -(e.detail || 0) / 3; + } + else { + var touch = eventType != 'touchend' + ? e.targetTouches[0] + : e.changedTouches[0]; + touch && clientToLocal(el, touch, e, calculate); + } + + // Add which for click: 1 === left; 2 === middle; 3 === right; otherwise: 0; + // See jQuery: https://github.com/jquery/jquery/blob/master/src/event.js + // If e.which has been defined, if may be readonly, + // see: https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/which + var button = e.button; + if (e.which == null && button !== undefined && MOUSE_EVENT_REG.test(e.type)) { + e.which = (button & 1 ? 1 : (button & 2 ? 3 : (button & 4 ? 2 : 0))); + } + + return e; +} + +/** + * @param {HTMLElement} el + * @param {string} name + * @param {Function} handler + */ +function addEventListener(el, name, handler) { + if (isDomLevel2) { + // Reproduct the console warning: + // [Violation] Added non-passive event listener to a scroll-blocking event. + // Consider marking event handler as 'passive' to make the page more responsive. + // Just set console log level: verbose in chrome dev tool. + // then the warning log will be printed when addEventListener called. + // See https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md + // We have not yet found a neat way to using passive. Because in zrender the dom event + // listener delegate all of the upper events of element. Some of those events need + // to prevent default. For example, the feature `preventDefaultMouseMove` of echarts. + // Before passive can be adopted, these issues should be considered: + // (1) Whether and how a zrender user specifies an event listener passive. And by default, + // passive or not. + // (2) How to tread that some zrender event listener is passive, and some is not. If + // we use other way but not preventDefault of mousewheel and touchmove, browser + // compatibility should be handled. + + // var opts = (env.passiveSupported && name === 'mousewheel') + // ? {passive: true} + // // By default, the third param of el.addEventListener is `capture: false`. + // : void 0; + // el.addEventListener(name, handler /* , opts */); + 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); + } +} + +/** + * preventDefault and stopPropagation. + * Notice: do not do that in zrender. Upper application + * do that if necessary. + * + * @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; + }; + +function notLeftMouse(e) { + // If e.which is undefined, considered as left mouse event. + return e.which > 1; +} + +var SILENT = 'silent'; + +function makeEventPacket(eveType, targetInfo, event) { + return { + type: eveType, + event: event, + // target can only be an element that is not silent. + target: targetInfo.target, + // topTarget can be a silent element. + topTarget: targetInfo.topTarget, + cancelBubble: false, + offsetX: event.zrX, + offsetY: event.zrY, + gestureEvent: event.gestureEvent, + pinchX: event.pinchX, + pinchY: event.pinchY, + pinchScale: event.pinchScale, + wheelDelta: event.zrDelta, + zrByTouch: event.zrByTouch, + which: event.which, + stop: stopEvent + }; +} + +function stopEvent(event) { + stop(this.event); +} + +function EmptyProxy () {} +EmptyProxy.prototype.dispose = function () {}; + +var handlerNames = [ + 'click', 'dblclick', 'mousewheel', 'mouseout', + 'mouseup', 'mousedown', 'mousemove', 'contextmenu' +]; +/** + * @alias module:zrender/Handler + * @constructor + * @extends module:zrender/mixin/Eventful + * @param {module:zrender/Storage} storage Storage instance. + * @param {module:zrender/Painter} painter Painter instance. + * @param {module:zrender/dom/HandlerProxy} proxy HandlerProxy instance. + * @param {HTMLElement} painterRoot painter.root (not painter.getViewportRoot()). + */ +var Handler = function(storage, painter, proxy, painterRoot) { + Eventful.call(this); + + this.storage = storage; + + this.painter = painter; + + this.painterRoot = painterRoot; + + proxy = proxy || new EmptyProxy(); + + /** + * Proxy of event. can be Dom, WebGLSurface, etc. + */ + this.proxy = null; + + /** + * {target, topTarget, x, y} + * @private + * @type {Object} + */ + this._hovered = {}; + + /** + * @private + * @type {Date} + */ + this._lastTouchMoment; + + /** + * @private + * @type {number} + */ + this._lastX; + + /** + * @private + * @type {number} + */ + this._lastY; + + + Draggable.call(this); + + this.setHandlerProxy(proxy); +}; + +Handler.prototype = { + + constructor: Handler, + + setHandlerProxy: function (proxy) { + if (this.proxy) { + this.proxy.dispose(); + } + + if (proxy) { + each$1(handlerNames, function (name) { + proxy.on && proxy.on(name, this[name], this); + }, this); + // Attach handler + proxy.handler = this; + } + this.proxy = proxy; + }, + + mousemove: function (event) { + var x = event.zrX; + var y = event.zrY; + + var lastHovered = this._hovered; + var lastHoveredTarget = lastHovered.target; + + // If lastHoveredTarget is removed from zr (detected by '__zr') by some API call + // (like 'setOption' or 'dispatchAction') in event handlers, we should find + // lastHovered again here. Otherwise 'mouseout' can not be triggered normally. + // See #6198. + if (lastHoveredTarget && !lastHoveredTarget.__zr) { + lastHovered = this.findHover(lastHovered.x, lastHovered.y); + lastHoveredTarget = lastHovered.target; + } + + var hovered = this._hovered = this.findHover(x, y); + var hoveredTarget = hovered.target; + + var proxy = this.proxy; + proxy.setCursor && proxy.setCursor(hoveredTarget ? hoveredTarget.cursor : 'default'); + + // Mouse out on previous hovered element + if (lastHoveredTarget && hoveredTarget !== lastHoveredTarget) { + this.dispatchToElement(lastHovered, 'mouseout', event); + } + + // Mouse moving on one element + this.dispatchToElement(hovered, 'mousemove', event); + + // Mouse over on a new element + if (hoveredTarget && hoveredTarget !== lastHoveredTarget) { + this.dispatchToElement(hovered, 'mouseover', event); + } + }, + + mouseout: function (event) { + this.dispatchToElement(this._hovered, 'mouseout', event); + + // There might be some doms created by upper layer application + // at the same level of painter.getViewportRoot() (e.g., tooltip + // dom created by echarts), where 'globalout' event should not + // be triggered when mouse enters these doms. (But 'mouseout' + // should be triggered at the original hovered element as usual). + var element = event.toElement || event.relatedTarget; + var innerDom; + do { + element = element && element.parentNode; + } + while (element && element.nodeType != 9 && !( + innerDom = element === this.painterRoot + )); + + !innerDom && this.trigger('globalout', {event: event}); + }, + + /** + * Resize + */ + resize: function (event) { + this._hovered = {}; + }, + + /** + * Dispatch event + * @param {string} eventName + * @param {event=} eventArgs + */ + dispatch: function (eventName, eventArgs) { + var handler = this[eventName]; + handler && handler.call(this, eventArgs); + }, + + /** + * Dispose + */ + dispose: function () { + + this.proxy.dispose(); + + this.storage = + this.proxy = + this.painter = null; + }, + + /** + * 设置默认的cursor style + * @param {string} [cursorStyle='default'] 例如 crosshair + */ + setCursorStyle: function (cursorStyle) { + var proxy = this.proxy; + proxy.setCursor && proxy.setCursor(cursorStyle); + }, + + /** + * 事件分发代理 + * + * @private + * @param {Object} targetInfo {target, topTarget} 目标图形元素 + * @param {string} eventName 事件名称 + * @param {Object} event 事件对象 + */ + dispatchToElement: function (targetInfo, eventName, event) { + targetInfo = targetInfo || {}; + var el = targetInfo.target; + if (el && el.silent) { + return; + } + var eventHandler = 'on' + eventName; + var eventPacket = makeEventPacket(eventName, targetInfo, event); + + 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 + * @return {model:zrender/Element} + * @method + */ + findHover: function(x, y, exclude) { + var list = this.storage.getDisplayList(); + var out = {x: x, y: y}; + + for (var i = list.length - 1; i >= 0 ; i--) { + var hoverCheckResult; + if (list[i] !== exclude + // getDisplayList may include ignored item in VML mode + && !list[i].ignore + && (hoverCheckResult = isHover(list[i], x, y)) + ) { + !out.topTarget && (out.topTarget = list[i]); + if (hoverCheckResult !== SILENT) { + out.target = list[i]; + break; + } + } + } + + return out; + } +}; + +// Common handlers +each$1(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) { + Handler.prototype[name] = function (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); + var hoveredTarget = hovered.target; + + if (name === 'mousedown') { + this._downEl = hoveredTarget; + this._downPoint = [event.zrX, event.zrY]; + // In case click triggered before mouseup + this._upEl = hoveredTarget; + } + else if (name === 'mouseup') { + this._upEl = hoveredTarget; + } + else if (name === 'click') { + if (this._downEl !== this._upEl + // Original click event is triggered on the whole canvas element, + // including the case that `mousedown` - `mousemove` - `mouseup`, + // which should be filtered, otherwise it will bring trouble to + // pan and zoom. + || !this._downPoint + // Arbitrary value + || dist(this._downPoint, [event.zrX, event.zrY]) > 4 + ) { + return; + } + this._downPoint = null; + } + + this.dispatchToElement(hovered, name, event); + }; +}); + +function isHover(displayable, x, y) { + if (displayable[displayable.rectHover ? 'rectContain' : 'contain'](x, y)) { + var el = displayable; + var isSilent; + while (el) { + // If clipped by ancestor. + // FIXME: If clipPath has neither stroke nor fill, + // el.clipPath.contain(x, y) will always return false. + if (el.clipPath && !el.clipPath.contain(x, y)) { + return false; + } + if (el.silent) { + isSilent = true; + } + el = el.parent; + } + return isSilent ? SILENT : true; + } + + return false; +} + +mixin(Handler, Eventful); +mixin(Handler, Draggable); + +/** + * 3x2矩阵操作类 + * @exports zrender/tool/matrix + */ + +var ArrayCtor$1 = typeof Float32Array === 'undefined' + ? Array + : Float32Array; + +/** + * Create a identity matrix. + * @return {Float32Array|Array.} + */ +function create$1() { + var out = new ArrayCtor$1(6); + identity(out); + + return out; +} + +/** + * 设置矩阵为单位矩阵 + * @param {Float32Array|Array.} out + */ +function identity(out) { + out[0] = 1; + out[1] = 0; + out[2] = 0; + out[3] = 1; + out[4] = 0; + out[5] = 0; + return out; +} + +/** + * 复制矩阵 + * @param {Float32Array|Array.} out + * @param {Float32Array|Array.} m + */ +function copy$1(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.} out + * @param {Float32Array|Array.} m1 + * @param {Float32Array|Array.} m2 + */ +function mul$1(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.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ +function translate(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.} out + * @param {Float32Array|Array.} a + * @param {number} rad + */ +function rotate(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.} out + * @param {Float32Array|Array.} a + * @param {Float32Array|Array.} v + */ +function scale$1(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.} out + * @param {Float32Array|Array.} a + */ +function invert(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; +} + +/** + * Clone a new matrix. + * @param {Float32Array|Array.} a + */ +function clone$2(a) { + var b = create$1(); + copy$1(b, a); + return b; +} + +var matrix = (Object.freeze || Object)({ + create: create$1, + identity: identity, + copy: copy$1, + mul: mul$1, + translate: translate, + rotate: rotate, + scale: scale$1, + invert: invert, + clone: clone$2 +}); + +/** + * 提供变换扩展 + * @module zrender/mixin/Transformable + * @author pissang (https://www.github.com/pissang) + */ + +var mIdentity = 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.} + * @default [0, 0] + */ + this.position = [0, 0]; + } + if (opts.rotation == null) { + /** + * 旋转 + * @type {Array.} + * @default 0 + */ + this.rotation = 0; + } + if (!opts.scale) { + /** + * 缩放 + * @type {Array.} + * @default [1, 1] + */ + this.scale = [1, 1]; + } + /** + * 旋转和缩放的原点 + * @type {Array.} + * @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); +}; + +var scaleTmp = []; +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 || create$1(); + + if (needLocalTransform) { + this.getLocalTransform(m); + } + else { + mIdentity(m); + } + + // 应用父节点变换 + if (parentHasTransform) { + if (needLocalTransform) { + mul$1(m, parent.transform, m); + } + else { + copy$1(m, parent.transform); + } + } + // 保存这个变换矩阵 + this.transform = m; + + var globalScaleRatio = this.globalScaleRatio; + if (globalScaleRatio != null && globalScaleRatio !== 1) { + this.getGlobalScale(scaleTmp); + var relX = scaleTmp[0] < 0 ? -1 : 1; + var relY = scaleTmp[1] < 0 ? -1 : 1; + var sx = ((scaleTmp[0] - relX) * globalScaleRatio + relX) / scaleTmp[0] || 0; + var sy = ((scaleTmp[1] - relY) * globalScaleRatio + relY) / scaleTmp[1] || 0; + + m[0] *= sx; + m[1] *= sx; + m[2] *= sy; + m[3] *= sy; + } + + this.invTransform = this.invTransform || create$1(); + invert(this.invTransform, m); +}; + +transformableProto.getLocalTransform = function (m) { + return Transformable.getLocalTransform(this, m); +}; + +/** + * 将自己的transform应用到context上 + * @param {CanvasRenderingContext2D} ctx + */ +transformableProto.setTransform = function (ctx) { + var m = this.transform; + var dpr = ctx.dpr || 1; + if (m) { + ctx.setTransform(dpr * m[0], dpr * m[1], dpr * m[2], dpr * m[3], dpr * m[4], dpr * m[5]); + } + else { + ctx.setTransform(dpr, 0, 0, dpr, 0, 0); + } +}; + +transformableProto.restoreTransform = function (ctx) { + var dpr = ctx.dpr || 1; + ctx.setTransform(dpr, 0, 0, dpr, 0, 0); +}; + +var tmpTransform = []; +var originTransform = create$1(); + +transformableProto.setLocalTransform = function (m) { + if (!m) { + // TODO return or set identity? + return; + } + 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$$1 = 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$$1[0] = sx; + scale$$1[1] = sy; + this.rotation = Math.atan2(-m[1] / sy, m[0] / sx); +}; +/** + * 分解`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 + mul$1(tmpTransform, parent.invTransform, m); + m = tmpTransform; + } + var origin = this.origin; + if (origin && (origin[0] || origin[1])) { + originTransform[4] = origin[0]; + originTransform[5] = origin[1]; + mul$1(tmpTransform, m, originTransform); + tmpTransform[4] -= origin[0]; + tmpTransform[5] -= origin[1]; + m = tmpTransform; + } + + this.setLocalTransform(m); +}; + +/** + * Get global scale + * @return {Array.} + */ +transformableProto.getGlobalScale = function (out) { + var m = this.transform; + out = out || []; + if (!m) { + out[0] = 1; + out[1] = 1; + return out; + } + out[0] = Math.sqrt(m[0] * m[0] + m[1] * m[1]); + out[1] = Math.sqrt(m[2] * m[2] + m[3] * m[3]); + if (m[0] < 0) { + out[0] = -out[0]; + } + if (m[3] < 0) { + out[1] = -out[1]; + } + return out; +}; +/** + * 变换坐标位置到 shape 的局部坐标空间 + * @method + * @param {number} x + * @param {number} y + * @return {Array.} + */ +transformableProto.transformCoordToLocal = function (x, y) { + var v2 = [x, y]; + var invTransform = this.invTransform; + if (invTransform) { + applyTransform(v2, v2, invTransform); + } + return v2; +}; + +/** + * 变换局部坐标位置到全局坐标空间 + * @method + * @param {number} x + * @param {number} y + * @return {Array.} + */ +transformableProto.transformCoordToGlobal = function (x, y) { + var v2 = [x, y]; + var transform = this.transform; + if (transform) { + applyTransform(v2, v2, transform); + } + return v2; +}; + +/** + * @static + * @param {Object} target + * @param {Array.} target.origin + * @param {number} target.rotation + * @param {Array.} target.position + * @param {Array.} [m] + */ +Transformable.getLocalTransform = function (target, m) { + m = m || []; + mIdentity(m); + + var origin = target.origin; + var scale$$1 = target.scale || [1, 1]; + var rotation = target.rotation || 0; + var position = target.position || [0, 0]; + + if (origin) { + // Translate to origin + m[4] -= origin[0]; + m[5] -= origin[1]; + } + scale$1(m, m, scale$$1); + if (rotation) { + 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; +}; + +/** + * 缓动代码来自 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; + } +}; + +/** + * 动画主控制器 + * @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 + */ + +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; + + this._pausedTime = 0; + this._paused = false; +} + +Clip.prototype = { + + constructor: Clip, + + step: function (globalTime, deltaTime) { + // Set startTime on first step, or _startTime may has milleseconds different between clips + // PENDING + if (!this._initialized) { + this._startTime = globalTime + this._delay; + this._initialized = true; + } + + if (this._paused) { + this._pausedTime += deltaTime; + return; + } + + var percent = (globalTime - this._startTime - this._pausedTime) / this._life; + + // 还没开始 + if (percent < 0) { + return; + } + + percent = Math.min(percent, 1); + + var easing$$1 = this.easing; + var easingFunc = typeof easing$$1 == 'string' ? easing[easing$$1] : easing$$1; + var schedule = typeof easingFunc === 'function' + ? easingFunc(percent) + : percent; + + this.fire('frame', schedule); + + // 结束 + if (percent == 1) { + if (this.loop) { + this.restart (globalTime); + // 重新开始周期 + // 抛出而不是直接调用事件直到 stage.update 后再统一调用这些事件 + return 'restart'; + } + + // 动画完成将这个控制器标识为待删除 + // 在Animation.update中进行批量删除 + this._needsRemove = true; + return 'destroy'; + } + + return null; + }, + + restart: function (globalTime) { + var remainder = (globalTime - this._startTime - this._pausedTime) % this._life; + this._startTime = globalTime - remainder + this.gap; + this._pausedTime = 0; + + this._needsRemove = false; + }, + + fire: function (eventType, arg) { + eventType = 'on' + eventType; + if (this[eventType]) { + this[eventType](this._target, arg); + } + }, + + pause: function () { + this._paused = true; + }, + + resume: function () { + this._paused = false; + } +}; + +// 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; + entry.next = null; + 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; +}; + +/** + * Clear list + */ +linkedListProto.clear = function () { + this.head = this.tail = null; + this._len = 0; +}; + +/** + * @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; + + this._lastRemovedEntry = null; +}; + +var LRUProto = LRU.prototype; + +/** + * @param {string} key + * @param {} value + * @return {} Removed value + */ +LRUProto.put = function (key, value) { + var list = this._list; + var map = this._map; + var removed = null; + if (map[key] == null) { + var len = list.len(); + // Reuse last removed entry + var entry = this._lastRemovedEntry; + + if (len >= this._maxSize && len > 0) { + // Remove the least recently used + var leastUsedEntry = list.head; + list.remove(leastUsedEntry); + delete map[leastUsedEntry.key]; + + removed = leastUsedEntry.value; + this._lastRemovedEntry = leastUsedEntry; + } + + if (entry) { + entry.value = value; + } + else { + entry = new Entry(value); + } + entry.key = key; + list.insertEntry(entry); + map[key] = entry; + } + + return removed; +}; + +/** + * @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 = {}; +}; + +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 lerpNumber(a, b, p) { + return a + (b - a) * p; +} + +function setRgba(out, r, g, b, a) { + out[0] = r; out[1] = g; out[2] = b; out[3] = a; + return out; +} +function copyRgba(out, a) { + out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; + return out; +} + +var colorCache = new LRU(20); +var lastRemovedArr = null; + +function putToCache(colorStr, rgbaArr) { + // Reuse removed array + if (lastRemovedArr) { + copyRgba(lastRemovedArr, rgbaArr); + } + lastRemovedArr = colorCache.put(colorStr, lastRemovedArr || (rgbaArr.slice())); +} + +/** + * @param {string} colorStr + * @param {Array.} out + * @return {Array.} + * @memberOf module:zrender/util/color + */ +function parse(colorStr, rgbaArr) { + if (!colorStr) { + return; + } + rgbaArr = rgbaArr || []; + + var cached = colorCache.get(colorStr); + if (cached) { + return copyRgba(rgbaArr, cached); + } + + // 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) { + copyRgba(rgbaArr, kCSSColorTable[str]); + putToCache(colorStr, rgbaArr); + return rgbaArr; + } + + // #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)) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; // Covers NaN. + } + setRgba(rgbaArr, + ((iv & 0xf00) >> 4) | ((iv & 0xf00) >> 8), + (iv & 0xf0) | ((iv & 0xf0) >> 4), + (iv & 0xf) | ((iv & 0xf) << 4), + 1 + ); + putToCache(colorStr, rgbaArr); + return rgbaArr; + } + else if (str.length === 7) { + var iv = parseInt(str.substr(1), 16); // TODO(deanm): Stricter parsing. + if (!(iv >= 0 && iv <= 0xffffff)) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; // Covers NaN. + } + setRgba(rgbaArr, + (iv & 0xff0000) >> 16, + (iv & 0xff00) >> 8, + iv & 0xff, + 1 + ); + putToCache(colorStr, rgbaArr); + return rgbaArr; + } + + 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) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + alpha = parseCssFloat(params.pop()); // jshint ignore:line + // Fall through. + case 'rgb': + if (params.length !== 3) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + setRgba(rgbaArr, + parseCssInt(params[0]), + parseCssInt(params[1]), + parseCssInt(params[2]), + alpha + ); + putToCache(colorStr, rgbaArr); + return rgbaArr; + case 'hsla': + if (params.length !== 4) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + params[3] = parseCssFloat(params[3]); + hsla2rgba(params, rgbaArr); + putToCache(colorStr, rgbaArr); + return rgbaArr; + case 'hsl': + if (params.length !== 3) { + setRgba(rgbaArr, 0, 0, 0, 1); + return; + } + hsla2rgba(params, rgbaArr); + putToCache(colorStr, rgbaArr); + return rgbaArr; + default: + return; + } + } + + setRgba(rgbaArr, 0, 0, 0, 1); + return; +} + +/** + * @param {Array.} hsla + * @param {Array.} rgba + * @return {Array.} rgba + */ +function hsla2rgba(hsla, rgba) { + 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; + + rgba = rgba || []; + setRgba(rgba, + clampCssByte(cssHueToRgb(m1, m2, h + 1 / 3) * 255), + clampCssByte(cssHueToRgb(m1, m2, h) * 255), + clampCssByte(cssHueToRgb(m1, m2, h - 1 / 3) * 255), + 1 + ); + + if (hsla.length === 4) { + rgba[3] = hsla[3]; + } + + return rgba; +} + +/** + * @param {Array.} rgba + * @return {Array.} 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; + } + if (colorArr[i] > 255) { + colorArr[i] = 255; + } + else if (color[i] < 0) { + colorArr[i] = 0; + } + } + return stringify(colorArr, colorArr.length === 4 ? 'rgba' : 'rgb'); + } +} + +/** + * @param {string} color + * @return {string} + * @memberOf module:zrender/util/color + */ +function toHex(color) { + 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 lerp methods because color is represented by rgba array. + * @param {number} normalizedValue A float between 0 and 1. + * @param {Array.>} colors List of rgba color array + * @param {Array.} [out] Mapped gba color array + * @return {Array.} will be null/undefined if input illegal. + */ +function fastLerp(normalizedValue, colors, out) { + if (!(colors && colors.length) + || !(normalizedValue >= 0 && normalizedValue <= 1) + ) { + return; + } + + out = out || []; + + 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(lerpNumber(leftColor[0], rightColor[0], dv)); + out[1] = clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)); + out[2] = clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)); + out[3] = clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv)); + + return out; +} + +/** + * @deprecated + */ +var fastMapToColor = fastLerp; + +/** + * @param {number} normalizedValue A float between 0 and 1. + * @param {Array.} 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 lerp$1(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(lerpNumber(leftColor[0], rightColor[0], dv)), + clampCssByte(lerpNumber(leftColor[1], rightColor[1], dv)), + clampCssByte(lerpNumber(leftColor[2], rightColor[2], dv)), + clampCssFloat(lerpNumber(leftColor[3], rightColor[3], dv)) + ], + 'rgba' + ); + + return fullOutput + ? { + color: color, + leftIndex: leftIndex, + rightIndex: rightIndex, + value: value + } + : color; +} + +/** + * @deprecated + */ +var mapToColor = lerp$1; + +/** + * @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.} arrColor like [12,33,44,0.4] + * @param {string} type 'rgba', 'hsva', ... + * @return {string} Result color. (If input illegal, return undefined). + */ +function stringify(arrColor, type) { + if (!arrColor || !arrColor.length) { + return; + } + var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2]; + if (type === 'rgba' || type === 'hsva' || type === 'hsla') { + colorStr += ',' + arrColor[3]; + } + return type + '(' + colorStr + ')'; +} + + +var color = (Object.freeze || Object)({ + parse: parse, + lift: lift, + toHex: toHex, + fastLerp: fastLerp, + fastMapToColor: fastMapToColor, + lerp: lerp$1, + mapToColor: mapToColor, + modifyHSL: modifyHSL, + modifyAlpha: modifyAlpha, + stringify: stringify +}); + +/** + * @module echarts/animation/Animator + */ + +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 = len && 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 + ); + } + } + } +} + +// arr0 is source array, arr1 is target array. +// Do some preprocess to avoid error happened when interpolating from arr0 to arr1 +function fillArr(arr0, arr1, arrDim) { + var arr0Len = arr0.length; + var arr1Len = arr1.length; + if (arr0Len !== arr1Len) { + // 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]) + ); + } + } + } + // Handling NaN value + var len2 = arr0[0] && arr0[0].length; + for (var i = 0; i < arr0.length; i++) { + if (arrDim === 1) { + if (isNaN(arr0[i])) { + arr0[i] = arr1[i]; + } + } + else { + for (var j = 0; j < len2; j++) { + if (isNaN(arr0[i][j])) { + arr0[i][j] = arr1[i][j]; + } + } + } + } +} + +/** + * @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 getArrayDim(keyframes) { + var lastValue = keyframes[keyframes.length - 1].value; + return isArrayLike(lastValue && lastValue[0]) ? 2 : 1; +} + +function createTrackClip(animator, easing, oneTrackDone, keyframes, propName, forceAnimate) { + 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 ? getArrayDim(keyframes) : 0; + + 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 = parse(value); + if (colorArray) { + value = colorArray; + isValueColor = true; + } + else { + isValueString = true; + } + } + kfValues.push(value); + } + if (!forceAnimate && isAllValueEqual) { + return; + } + + var lastValue = kfValues[trackLen - 1]; + // Polyfill array and NaN value + for (var i = 0; i < trackLen - 1; i++) { + if (isValueArray) { + fillArr(kfValues[i], lastValue, arrDim); + } + else { + if (isNaN(kfValues[i]) && !isNaN(lastValue) && !isValueString && !isValueColor) { + kfValues[i] = lastValue; + } + } + } + isValueArray && 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; + // In the easing function like elasticOut, percent may less than 0 + if (percent < 0) { + frame = 0; + } + else if (percent < lastFramePercent) { + // Start from next key + // PENDING start from lastFrame ? + start = Math.min(lastFrame + 1, trackLen - 1); + for (frame = start; frame >= 0; frame--) { + if (kfPercents[frame] <= percent) { + break; + } + } + // PENDING really need to do this ? + 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 (!props.hasOwnProperty(propName)) { + continue; + } + + 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; + }, + + pause: function () { + for (var i = 0; i < this._clipList.length; i++) { + this._clipList[i].pause(); + } + this._paused = true; + }, + + resume: function () { + for (var i = 0; i < this._clipList.length; i++) { + this._clipList[i].resume(); + } + this._paused = false; + }, + + isPaused: function () { + return !!this._paused; + }, + + _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} + * @param {boolean} forceAnimate + * @return {module:zrender/animation/Animator} + */ + start: function (easing, forceAnimate) { + + var self = this; + var clipCount = 0; + + var oneTrackDone = function() { + clipCount--; + if (!clipCount) { + self._doneCallback(); + } + }; + + var lastClip; + for (var propName in this._tracks) { + if (!this._tracks.hasOwnProperty(propName)) { + continue; + } + var clip = createTrackClip( + this, easing, oneTrackDone, + this._tracks[propName], propName, forceAnimate + ); + 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); + } + }; + } + + // This optimization will help the case that in the upper application + // the view may be refreshed frequently, where animation will be + // called repeatly but nothing changed. + 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.} + */ + getClips: function () { + return this._clipList; + } +}; + +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) + */ + +/** + * debug日志选项:catchBrushException为true下有效 + * 0 : 不生成debug数据,发布用 + * 1 : 异常抛出,调试用 + * 2 : 控制台输出,调试用 + */ +var debugMode = 0; + +// retina 屏幕优化 +var devicePixelRatio = dpr; + +var log = function () { +}; + +if (debugMode === 1) { + log = function () { + for (var k in arguments) { + throw new Error(arguments[k]); + } + }; +} +else if (debugMode > 1) { + log = function () { + for (var k in arguments) { + console.log(arguments[k]); + } + }; +} + +var zrLog = log; + +/** + * @alias modue:zrender/mixin/Animatable + * @constructor + */ +var Animatable = function () { + + /** + * @type {Array.} + * @readOnly + */ + this.animators = []; +}; + +Animatable.prototype = { + + constructor: Animatable, + + /** + * 动画 + * + * @param {string} path The path to fetch value from object, like 'a.b.c'. + * @param {boolean} [loop] Whether to loop animation. + * @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) { + zrLog( + '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(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; + }, + + /** + * Caution: this method will stop previous animation. + * So do not use this method to one element twice before + * animation starts, unless you know what you are doing. + * @param {Object} target + * @param {number} [time=500] Time in ms + * @param {string} [easing='linear'] + * @param {number} [delay=0] + * @param {Function} [callback] + * @param {Function} [forceAnimate] Prevent stop animation and callback + * immediently when target values are the same as current values. + * + * @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, forceAnimate) { + animateTo(this, target, time, delay, easing, callback, forceAnimate); + }, + + /** + * Animate from the target state to current state. + * The params and the return value are the same as `this.animateTo`. + */ + animateFrom: function (target, time, delay, easing, callback, forceAnimate) { + animateTo(this, target, time, delay, easing, callback, forceAnimate, true); + } +}; + +function animateTo(animatable, target, time, delay, easing, callback, forceAnimate, reverse) { + // animateTo(target, time, easing, callback); + if (isString(delay)) { + callback = easing; + easing = delay; + delay = 0; + } + // animateTo(target, time, delay, callback); + else if (isFunction$1(easing)) { + callback = easing; + easing = 'linear'; + delay = 0; + } + // animateTo(target, time, callback); + else if (isFunction$1(delay)) { + callback = delay; + delay = 0; + } + // animateTo(target, callback) + else if (isFunction$1(time)) { + callback = time; + time = 500; + } + // animateTo(target) + else if (!time) { + time = 500; + } + // Stop all previous animations + animatable.stopAnimation(); + animateToShallow(animatable, '', animatable, target, time, delay, reverse); + + // Animators may be removed immediately after start + // if there is nothing to animate + var animators = animatable.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, forceAnimate); + } +} + +/** + * @param {string} path='' + * @param {Object} source=animatable + * @param {Object} target + * @param {number} [time=500] + * @param {number} [delay=0] + * @param {boolean} [reverse] If `true`, animate + * from the `target` to current state. + * + * @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) + */ +function animateToShallow(animatable, path, source, target, time, delay, reverse) { + var objShallow = {}; + var propertyCount = 0; + for (var name in target) { + if (!target.hasOwnProperty(name)) { + continue; + } + + if (source[name] != null) { + if (isObject$1(target[name]) && !isArrayLike(target[name])) { + animateToShallow( + animatable, + path ? path + '.' + name : name, + source[name], + target[name], + time, + delay, + reverse + ); + } + else { + if (reverse) { + objShallow[name] = source[name]; + setAttrByPath(animatable, path, name, target[name]); + } + else { + objShallow[name] = target[name]; + } + propertyCount++; + } + } + else if (target[name] != null && !reverse) { + setAttrByPath(animatable, path, name, target[name]); + } + } + + if (propertyCount > 0) { + animatable.animate(path, false) + .when(time == null ? 500 : time, objShallow) + .delay(delay || 0); + } +} + +function setAttrByPath(el, path, name, value) { + // Attr directly if not has property + // FIXME, if some property not needed for element ? + if (!path) { + el.attr(name, value); + } + else { + // Only support set shape or style + var props = {}; + props[path] = {}; + props[path][name] = value; + el.attr(props); + } +} + +/** + * @alias module:zrender/Element + * @constructor + * @extends {module:zrender/mixin/Animatable} + * @extends {module:zrender/mixin/Transformable} + * @extends {module:zrender/mixin/Eventful} + */ +var Element = function (opts) { // jshint ignore:line + + 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, + + /** + * 是否是 Group + * @type {boolean} + */ + isGroup: false, + + /** + * 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(false); + }, + + /** + * 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 (isObject$1(key)) { + for (var name in key) { + if (key.hasOwnProperty(name)) { + this.attrKV(name, key[name]); + } + } + } + + this.dirty(false); + + 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(false); + }, + + /** + */ + 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(false); + } + }, + + /** + * 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); + } + } +}; + +mixin(Element, Animatable); +mixin(Element, Transformable); +mixin(Element, Eventful); + +/** + * @module echarts/core/BoundingRect + */ + +var v2ApplyTransform = applyTransform; +var mathMin = Math.min; +var mathMax = Math.max; + +/** + * @alias module:echarts/core/BoundingRect + */ +function BoundingRect(x, y, width, height) { + + if (width < 0) { + x = x + width; + width = -width; + } + if (height < 0) { + y = y + height; + height = -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.} m + * @methods + */ + applyTransform: (function () { + var lt = []; + var rb = []; + var lb = []; + var rt = []; + return function (m) { + // In case usage like this + // el.getBoundingRect().applyTransform(el.transform) + // And element has no transform + if (!m) { + return; + } + lt[0] = lb[0] = this.x; + lt[1] = rt[1] = this.y; + rb[0] = rt[0] = this.x + this.width; + rb[1] = lb[1] = this.y + this.height; + + v2ApplyTransform(lt, lt, m); + v2ApplyTransform(rb, rb, m); + v2ApplyTransform(lb, lb, m); + v2ApplyTransform(rt, rt, m); + + this.x = mathMin(lt[0], rb[0], lb[0], rt[0]); + this.y = mathMin(lt[1], rb[1], lb[1], rt[1]); + var maxX = mathMax(lt[0], rb[0], lb[0], rt[0]); + var maxY = mathMax(lt[1], rb[1], lb[1], rt[1]); + this.width = maxX - this.x; + this.height = maxY - this.y; + }; + })(), + + /** + * Calculate matrix of transforming from self to target rect + * @param {module:zrender/core/BoundingRect} b + * @return {Array.} + */ + calculateTransform: function (b) { + var a = this; + var sx = b.width / a.width; + var sy = b.height / a.height; + + var m = create$1(); + + // 矩阵右乘 + translate(m, m, [-a.x, -a.y]); + scale$1(m, m, [sx, sy]); + translate(m, m, [b.x, b.y]); + + return m; + }, + + /** + * @param {(module:echarts/core/BoundingRect|Object)} b + * @return {boolean} + */ + intersect: function (b) { + if (!b) { + return false; + } + + if (!(b instanceof BoundingRect)) { + // Normalize negative width/height. + b = BoundingRect.create(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; + }, + + plain: function () { + return { + x: this.x, + y: this.y, + width: this.width, + height: this.height + }; + } +}; + +/** + * @param {Object|module:zrender/core/BoundingRect} rect + * @param {number} rect.x + * @param {number} rect.y + * @param {number} rect.width + * @param {number} rect.height + * @return {module:zrender/core/BoundingRect} + */ +BoundingRect.create = function (rect) { + return new BoundingRect(rect.x, rect.y, rect.width, rect.height); +}; + +/** + * Group是一个容器,可以插入子节点,Group的变换也会被应用到子节点上 + * @module zrender/graphic/Group + * @example + * var Group = require('zrender/container/Group'); + * var Circle = require('zrender/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); + */ + +/** + * @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) { + if (opts.hasOwnProperty(key)) { + this[key] = opts[key]; + } + } + + this._children = []; + + this.__storage = null; + + this.__dirty = true; +}; + +Group.prototype = { + + constructor: Group, + + isGroup: true, + + /** + * @type {string} + */ + type: 'group', + + /** + * 所有子孙元素是否响应鼠标事件 + * @name module:/zrender/container/Group#silent + * @type {boolean} + * @default false + */ + silent: false, + + /** + * @return {Array.} + */ + 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.addToStorage(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 = indexOf(children, child); + if (idx < 0) { + return this; + } + children.splice(idx, 1); + + child.parent = null; + + if (storage) { + + storage.delFromStorage(child); + + 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.delFromStorage(child); + 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.addToStorage(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.delFromStorage(child); + 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 + 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); + // TODO + // The boundingRect cacluated by transforming original + // rect may be bigger than the actual bundingRect when rotation + // is used. (Consider a circle rotated aginst its center, where + // the actual boundingRect should be the same as that not be + // rotated.) But we can not find better approach to calculate + // actual boundingRect yet, considering performance. + 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; + } +}; + +inherits(Group, Element); + +// https://github.com/mziccard/node-timsort +var DEFAULT_MIN_MERGE = 32; + +var DEFAULT_MIN_GALLOPING = 7; + +function minRunLength(n) { + var r = 0; + + while (n >= DEFAULT_MIN_MERGE) { + r |= n & 1; + n >>= 1; + } + + return n + r; +} + +function makeAscendingRun(array, lo, hi, compare) { + var runHi = lo + 1; + + if (runHi === hi) { + return 1; + } + + if (compare(array[runHi++], array[lo]) < 0) { + while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) { + runHi++; + } + + reverseRun(array, lo, runHi); + } + else { + while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) { + runHi++; + } + } + + return runHi - lo; +} + +function reverseRun(array, lo, hi) { + hi--; + + while (lo < hi) { + var t = array[lo]; + array[lo++] = array[hi]; + array[hi--] = t; + } +} + +function binaryInsertionSort(array, lo, hi, start, compare) { + if (start === lo) { + start++; + } + + for (; start < hi; start++) { + var pivot = array[start]; + + var left = lo; + var right = start; + var mid; + + while (left < right) { + mid = left + right >>> 1; + + if (compare(pivot, array[mid]) < 0) { + right = mid; + } + else { + left = mid + 1; + } + } + + var n = start - left; + + switch (n) { + case 3: + array[left + 3] = array[left + 2]; + + case 2: + array[left + 2] = array[left + 1]; + + case 1: + array[left + 1] = array[left]; + break; + default: + while (n > 0) { + array[left + n] = array[left + n - 1]; + n--; + } + } + + array[left] = pivot; + } +} + +function gallopLeft(value, array, start, length, hint, compare) { + var lastOffset = 0; + var maxOffset = 0; + var offset = 1; + + if (compare(value, array[start + hint]) > 0) { + maxOffset = length - hint; + + while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + + if (offset <= 0) { + offset = maxOffset; + } + } + + if (offset > maxOffset) { + offset = maxOffset; + } + + lastOffset += hint; + offset += hint; + } + else { + maxOffset = hint + 1; + while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + + if (offset <= 0) { + offset = maxOffset; + } + } + if (offset > maxOffset) { + offset = maxOffset; + } + + var tmp = lastOffset; + lastOffset = hint - offset; + offset = hint - tmp; + } + + lastOffset++; + while (lastOffset < offset) { + var m = lastOffset + (offset - lastOffset >>> 1); + + if (compare(value, array[start + m]) > 0) { + lastOffset = m + 1; + } + else { + offset = m; + } + } + return offset; +} + +function gallopRight(value, array, start, length, hint, compare) { + var lastOffset = 0; + var maxOffset = 0; + var offset = 1; + + if (compare(value, array[start + hint]) < 0) { + maxOffset = hint + 1; + + while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + + if (offset <= 0) { + offset = maxOffset; + } + } + + if (offset > maxOffset) { + offset = maxOffset; + } + + var tmp = lastOffset; + lastOffset = hint - offset; + offset = hint - tmp; + } + else { + maxOffset = length - hint; + + while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) { + lastOffset = offset; + offset = (offset << 1) + 1; + + if (offset <= 0) { + offset = maxOffset; + } + } + + if (offset > maxOffset) { + offset = maxOffset; + } + + lastOffset += hint; + offset += hint; + } + + lastOffset++; + + while (lastOffset < offset) { + var m = lastOffset + (offset - lastOffset >>> 1); + + if (compare(value, array[start + m]) < 0) { + offset = m; + } + else { + lastOffset = m + 1; + } + } + + return offset; +} + +function TimSort(array, compare) { + var minGallop = DEFAULT_MIN_GALLOPING; + var runStart; + var runLength; + var stackSize = 0; + + var tmp = []; + + runStart = []; + runLength = []; + + function pushRun(_runStart, _runLength) { + runStart[stackSize] = _runStart; + runLength[stackSize] = _runLength; + stackSize += 1; + } + + function mergeRuns() { + while (stackSize > 1) { + var n = stackSize - 2; + + if (n >= 1 && runLength[n - 1] <= runLength[n] + runLength[n + 1] || n >= 2 && runLength[n - 2] <= runLength[n] + runLength[n - 1]) { + if (runLength[n - 1] < runLength[n + 1]) { + n--; + } + } + else if (runLength[n] > runLength[n + 1]) { + break; + } + mergeAt(n); + } + } + + function forceMergeRuns() { + while (stackSize > 1) { + var n = stackSize - 2; + + if (n > 0 && runLength[n - 1] < runLength[n + 1]) { + n--; + } + + mergeAt(n); + } + } + + function mergeAt(i) { + var start1 = runStart[i]; + var length1 = runLength[i]; + var start2 = runStart[i + 1]; + var length2 = runLength[i + 1]; + + runLength[i] = length1 + length2; + + if (i === stackSize - 3) { + runStart[i + 1] = runStart[i + 2]; + runLength[i + 1] = runLength[i + 2]; + } + + stackSize--; + + var k = gallopRight(array[start2], array, start1, length1, 0, compare); + start1 += k; + length1 -= k; + + if (length1 === 0) { + return; + } + + length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare); + + if (length2 === 0) { + return; + } + + if (length1 <= length2) { + mergeLow(start1, length1, start2, length2); + } + else { + mergeHigh(start1, length1, start2, length2); + } + } + + function mergeLow(start1, length1, start2, length2) { + var i = 0; + + for (i = 0; i < length1; i++) { + tmp[i] = array[start1 + i]; + } + + var cursor1 = 0; + var cursor2 = start2; + var dest = start1; + + array[dest++] = array[cursor2++]; + + if (--length2 === 0) { + for (i = 0; i < length1; i++) { + array[dest + i] = tmp[cursor1 + i]; + } + return; + } + + if (length1 === 1) { + for (i = 0; i < length2; i++) { + array[dest + i] = array[cursor2 + i]; + } + array[dest + length2] = tmp[cursor1]; + return; + } + + var _minGallop = minGallop; + var count1, count2, exit; + + while (1) { + count1 = 0; + count2 = 0; + exit = false; + + do { + if (compare(array[cursor2], tmp[cursor1]) < 0) { + array[dest++] = array[cursor2++]; + count2++; + count1 = 0; + + if (--length2 === 0) { + exit = true; + break; + } + } + else { + array[dest++] = tmp[cursor1++]; + count1++; + count2 = 0; + if (--length1 === 1) { + exit = true; + break; + } + } + } while ((count1 | count2) < _minGallop); + + if (exit) { + break; + } + + do { + count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare); + + if (count1 !== 0) { + for (i = 0; i < count1; i++) { + array[dest + i] = tmp[cursor1 + i]; + } + + dest += count1; + cursor1 += count1; + length1 -= count1; + if (length1 <= 1) { + exit = true; + break; + } + } + + array[dest++] = array[cursor2++]; + + if (--length2 === 0) { + exit = true; + break; + } + + count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare); + + if (count2 !== 0) { + for (i = 0; i < count2; i++) { + array[dest + i] = array[cursor2 + i]; + } + + dest += count2; + cursor2 += count2; + length2 -= count2; + + if (length2 === 0) { + exit = true; + break; + } + } + array[dest++] = tmp[cursor1++]; + + if (--length1 === 1) { + exit = true; + break; + } + + _minGallop--; + } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); + + if (exit) { + break; + } + + if (_minGallop < 0) { + _minGallop = 0; + } + + _minGallop += 2; + } + + minGallop = _minGallop; + + minGallop < 1 && (minGallop = 1); + + if (length1 === 1) { + for (i = 0; i < length2; i++) { + array[dest + i] = array[cursor2 + i]; + } + array[dest + length2] = tmp[cursor1]; + } + else if (length1 === 0) { + throw new Error(); + // throw new Error('mergeLow preconditions were not respected'); + } + else { + for (i = 0; i < length1; i++) { + array[dest + i] = tmp[cursor1 + i]; + } + } + } + + function mergeHigh (start1, length1, start2, length2) { + var i = 0; + + for (i = 0; i < length2; i++) { + tmp[i] = array[start2 + i]; + } + + var cursor1 = start1 + length1 - 1; + var cursor2 = length2 - 1; + var dest = start2 + length2 - 1; + var customCursor = 0; + var customDest = 0; + + array[dest--] = array[cursor1--]; + + if (--length1 === 0) { + customCursor = dest - (length2 - 1); + + for (i = 0; i < length2; i++) { + array[customCursor + i] = tmp[i]; + } + + return; + } + + if (length2 === 1) { + dest -= length1; + cursor1 -= length1; + customDest = dest + 1; + customCursor = cursor1 + 1; + + for (i = length1 - 1; i >= 0; i--) { + array[customDest + i] = array[customCursor + i]; + } + + array[dest] = tmp[cursor2]; + return; + } + + var _minGallop = minGallop; + + while (true) { + var count1 = 0; + var count2 = 0; + var exit = false; + + do { + if (compare(tmp[cursor2], array[cursor1]) < 0) { + array[dest--] = array[cursor1--]; + count1++; + count2 = 0; + if (--length1 === 0) { + exit = true; + break; + } + } + else { + array[dest--] = tmp[cursor2--]; + count2++; + count1 = 0; + if (--length2 === 1) { + exit = true; + break; + } + } + } while ((count1 | count2) < _minGallop); + + if (exit) { + break; + } + + do { + count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare); + + if (count1 !== 0) { + dest -= count1; + cursor1 -= count1; + length1 -= count1; + customDest = dest + 1; + customCursor = cursor1 + 1; + + for (i = count1 - 1; i >= 0; i--) { + array[customDest + i] = array[customCursor + i]; + } + + if (length1 === 0) { + exit = true; + break; + } + } + + array[dest--] = tmp[cursor2--]; + + if (--length2 === 1) { + exit = true; + break; + } + + count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare); + + if (count2 !== 0) { + dest -= count2; + cursor2 -= count2; + length2 -= count2; + customDest = dest + 1; + customCursor = cursor2 + 1; + + for (i = 0; i < count2; i++) { + array[customDest + i] = tmp[customCursor + i]; + } + + if (length2 <= 1) { + exit = true; + break; + } + } + + array[dest--] = array[cursor1--]; + + if (--length1 === 0) { + exit = true; + break; + } + + _minGallop--; + } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING); + + if (exit) { + break; + } + + if (_minGallop < 0) { + _minGallop = 0; + } + + _minGallop += 2; + } + + minGallop = _minGallop; + + if (minGallop < 1) { + minGallop = 1; + } + + if (length2 === 1) { + dest -= length1; + cursor1 -= length1; + customDest = dest + 1; + customCursor = cursor1 + 1; + + for (i = length1 - 1; i >= 0; i--) { + array[customDest + i] = array[customCursor + i]; + } + + array[dest] = tmp[cursor2]; + } + else if (length2 === 0) { + throw new Error(); + // throw new Error('mergeHigh preconditions were not respected'); + } + else { + customCursor = dest - (length2 - 1); + for (i = 0; i < length2; i++) { + array[customCursor + i] = tmp[i]; + } + } + } + + this.mergeRuns = mergeRuns; + this.forceMergeRuns = forceMergeRuns; + this.pushRun = pushRun; +} + +function sort(array, compare, lo, hi) { + if (!lo) { + lo = 0; + } + if (!hi) { + hi = array.length; + } + + var remaining = hi - lo; + + if (remaining < 2) { + return; + } + + var runLength = 0; + + if (remaining < DEFAULT_MIN_MERGE) { + runLength = makeAscendingRun(array, lo, hi, compare); + binaryInsertionSort(array, lo, hi, lo + runLength, compare); + return; + } + + var ts = new TimSort(array, compare); + + var minRun = minRunLength(remaining); + + do { + runLength = makeAscendingRun(array, lo, hi, compare); + if (runLength < minRun) { + var force = remaining; + if (force > minRun) { + force = minRun; + } + + binaryInsertionSort(array, lo, lo + force, lo + runLength, compare); + runLength = force; + } + + ts.pushRun(lo, runLength); + ts.mergeRuns(); + + remaining -= runLength; + lo += runLength; + } while (remaining !== 0); + + ts.forceMergeRuns(); +} + +// Use timsort because in most case elements are partially sorted +// https://jsfiddle.net/pissang/jr4x7mdm/8/ +function shapeCompareFunc(a, b) { + if (a.zlevel === b.zlevel) { + if (a.z === b.z) { + // if (a.z2 === b.z2) { + // // FIXME Slow has renderidx compare + // // http://stackoverflow.com/questions/20883421/sorting-in-javascript-should-every-compare-function-have-a-return-0-statement + // // https://github.com/v8/v8/blob/47cce544a31ed5577ffe2963f67acb4144ee0232/src/js/array.js#L1012 + // 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 () { // jshint ignore:line + this._roots = []; + + this._displayList = []; + + this._displayListLen = 0; +}; + +Storage.prototype = { + + constructor: Storage, + + /** + * @param {Function} cb + * + */ + traverse: function (cb, context) { + for (var i = 0; i < this._roots.length; i++) { + this._roots[i].traverse(cb, context); + } + }, + + /** + * 返回所有图形的绘制队列 + * @param {boolean} [update=false] 是否在返回前更新该数组 + * @param {boolean} [includeIgnore=false] 是否包含 ignore 的数组, 在 update 为 true 的时候有效 + * + * 详见{@link module:zrender/graphic/Displayable.prototype.updateDisplayList} + * @return {Array.} + */ + 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; + + env$1.canvasSupported && sort(displayList, shapeCompareFunc); + }, + + _updateAndAddDisplayable: function (el, clipPaths, includeIgnore) { + + if (el.ignore && !includeIgnore) { + return; + } + + el.beforeUpdate(); + + if (el.__dirty) { + + el.update(); + + } + + el.afterUpdate(); + + var userSetClipPath = el.clipPath; + if (userSetClipPath) { + + // FIXME 效率影响 + if (clipPaths) { + clipPaths = clipPaths.slice(); + } + else { + clipPaths = []; + } + + var currentClipPath = userSetClipPath; + var parentClipPath = el; + // Recursively add clip path + while (currentClipPath) { + // clipPath 的变换是基于使用这个 clipPath 的元素 + currentClipPath.parent = parentClipPath; + currentClipPath.updateTransform(); + + clipPaths.push(currentClipPath); + + parentClipPath = currentClipPath; + currentClipPath = currentClipPath.clipPath; + } + } + + if (el.isGroup) { + 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 ? + if (el.__dirty) { + child.__dirty = true; + } + + 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) { + if (el.__storage === this) { + return; + } + + if (el instanceof Group) { + el.addChildrenToStorage(this); + } + + this.addToStorage(el); + this._roots.push(el); + }, + + /** + * 删除指定的图形(Shape)或者组(Group) + * @param {string|Array.} [el] 如果为空清空整个Storage + */ + delRoot: function (el) { + if (el == null) { + // 不指定el清空 + for (var i = 0; i < this._roots.length; i++) { + var root = this._roots[i]; + if (root instanceof Group) { + root.delChildrenFromStorage(this); + } + } + + this._roots = []; + this._displayList = []; + this._displayListLen = 0; + + return; + } + + if (el instanceof Array) { + for (var i = 0, l = el.length; i < l; i++) { + this.delRoot(el[i]); + } + return; + } + + + var idx = indexOf(this._roots, el); + if (idx >= 0) { + this.delFromStorage(el); + this._roots.splice(idx, 1); + if (el instanceof Group) { + el.delChildrenFromStorage(this); + } + } + }, + + addToStorage: function (el) { + if (el) { + el.__storage = this; + el.dirty(false); + } + return this; + }, + + delFromStorage: function (el) { + if (el) { + el.__storage = null; + } + + return this; + }, + + /** + * 清空并且释放Storage + */ + dispose: function () { + this._renderList = + this._roots = null; + }, + + displayableSortFunc: shapeCompareFunc +}; + +var SHADOW_PROPS = { + 'shadowBlur': 1, + 'shadowOffsetX': 1, + 'shadowOffsetY': 1, + 'textShadowBlur': 1, + 'textShadowOffsetX': 1, + 'textShadowOffsetY': 1, + 'textBoxShadowBlur': 1, + 'textBoxShadowOffsetX': 1, + 'textBoxShadowOffsetY': 1 +}; + +var fixShadow = function (ctx, propName, value) { + if (SHADOW_PROPS.hasOwnProperty(propName)) { + return value *= ctx.dpr; + } + return value; +}; + +var STYLE_COMMON_PROPS = [ + ['shadowBlur', 0], ['shadowOffsetX', 0], ['shadowOffsetY', 0], ['shadowColor', '#000'], + ['lineCap', 'butt'], ['lineJoin', 'miter'], ['miterLimit', 10] +]; + +// var SHADOW_PROPS = STYLE_COMMON_PROPS.slice(0, 4); +// var LINE_PROPS = STYLE_COMMON_PROPS.slice(4); + +var Style = function (opts) { + this.extendFrom(opts, false); +}; + +function createLinearGradient(ctx, obj, rect) { + var x = obj.x == null ? 0 : obj.x; + var x2 = obj.x2 == null ? 1 : obj.x2; + var y = obj.y == null ? 0 : obj.y; + var y2 = obj.y2 == null ? 0 : obj.y2; + + if (!obj.global) { + x = x * rect.width + rect.x; + x2 = x2 * rect.width + rect.x; + y = y * rect.height + rect.y; + y2 = y2 * rect.height + rect.y; + } + + // Fix NaN when rect is Infinity + x = isNaN(x) ? 0 : x; + x2 = isNaN(x2) ? 1 : x2; + y = isNaN(y) ? 0 : y; + y2 = isNaN(y2) ? 0 : y2; + + var canvasGradient = ctx.createLinearGradient(x, y, x2, y2); + + return canvasGradient; +} + +function createRadialGradient(ctx, obj, rect) { + var width = rect.width; + var height = rect.height; + var min = Math.min(width, height); + + var x = obj.x == null ? 0.5 : obj.x; + var y = obj.y == null ? 0.5 : obj.y; + var r = obj.r == null ? 0.5 : obj.r; + if (!obj.global) { + x = x * width + rect.x; + y = y * height + rect.y; + r = r * min; + } + + var canvasGradient = ctx.createRadialGradient(x, y, 0, x, y, r); + + return canvasGradient; +} + + +Style.prototype = { + + constructor: Style, + + /** + * @type {string} + */ + fill: '#000', + + /** + * @type {string} + */ + stroke: null, + + /** + * @type {number} + */ + opacity: 1, + + /** + * @type {number} + */ + fillOpacity: null, + + /** + * @type {number} + */ + strokeOpacity: null, + + /** + * @type {Array.} + */ + 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, + + /** + * If `fontSize` or `fontFamily` exists, `font` will be reset by + * `fontSize`, `fontStyle`, `fontWeight`, `fontFamily`. + * So do not visit it directly in upper application (like echarts), + * but use `contain/text#makeFont` instead. + * @type {string} + */ + font: null, + + /** + * The same as font. Use font please. + * @deprecated + * @type {string} + */ + textFont: null, + + /** + * It helps merging respectively, rather than parsing an entire font string. + * @type {string} + */ + fontStyle: null, + + /** + * It helps merging respectively, rather than parsing an entire font string. + * @type {string} + */ + fontWeight: null, + + /** + * It helps merging respectively, rather than parsing an entire font string. + * Should be 12 but not '12px'. + * @type {number} + */ + fontSize: null, + + /** + * It helps merging respectively, rather than parsing an entire font string. + * @type {string} + */ + fontFamily: null, + + /** + * Reserved for special functinality, like 'hr'. + * @type {string} + */ + textTag: null, + + /** + * @type {string} + */ + textFill: '#000', + + /** + * @type {string} + */ + textStroke: null, + + /** + * @type {number} + */ + textWidth: null, + + /** + * Only for textBackground. + * @type {number} + */ + textHeight: null, + + /** + * textStroke may be set as some color as a default + * value in upper applicaion, where the default value + * of textStrokeWidth should be 0 to make sure that + * user can choose to do not use text stroke. + * @type {number} + */ + textStrokeWidth: 0, + + /** + * @type {number} + */ + textLineHeight: null, + + /** + * 'inside', 'left', 'right', 'top', 'bottom' + * [x, y] + * Based on x, y of rect. + * @type {string|Array.} + * @default 'inside' + */ + textPosition: 'inside', + + /** + * If not specified, use the boundingRect of a `displayable`. + * @type {Object} + */ + textRect: null, + + /** + * [x, y] + * @type {Array.} + */ + textOffset: null, + + /** + * @type {string} + */ + textAlign: null, + + /** + * @type {string} + */ + textVerticalAlign: null, + + /** + * @type {number} + */ + textDistance: 5, + + /** + * @type {string} + */ + textShadowColor: 'transparent', + + /** + * @type {number} + */ + textShadowBlur: 0, + + /** + * @type {number} + */ + textShadowOffsetX: 0, + + /** + * @type {number} + */ + textShadowOffsetY: 0, + + /** + * @type {string} + */ + textBoxShadowColor: 'transparent', + + /** + * @type {number} + */ + textBoxShadowBlur: 0, + + /** + * @type {number} + */ + textBoxShadowOffsetX: 0, + + /** + * @type {number} + */ + textBoxShadowOffsetY: 0, + + /** + * Whether transform text. + * Only useful in Path and Image element + * @type {boolean} + */ + transformText: false, + + /** + * Text rotate around position of Path or Image + * Only useful in Path and Image element and transformText is false. + */ + textRotation: 0, + + /** + * Text origin of text rotation, like [10, 40]. + * Based on x, y of rect. + * Useful in label rotation of circular symbol. + * By default, this origin is textPosition. + * Can be 'center'. + * @type {string|Array.} + */ + textOrigin: null, + + /** + * @type {string} + */ + textBackgroundColor: null, + + /** + * @type {string} + */ + textBorderColor: null, + + /** + * @type {number} + */ + textBorderWidth: 0, + + /** + * @type {number} + */ + textBorderRadius: 0, + + /** + * Can be `2` or `[2, 4]` or `[2, 3, 4, 5]` + * @type {number|Array.} + */ + textPadding: null, + + /** + * Text styles for rich text. + * @type {Object} + */ + rich: null, + + /** + * {outerWidth, outerHeight, ellipsis, placeholder} + * @type {Object} + */ + truncate: null, + + /** + * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation + * @type {string} + */ + blend: null, + + /** + * @param {CanvasRenderingContext2D} ctx + */ + bind: function (ctx, el, prevEl) { + var style = this; + var prevStyle = prevEl && prevEl.style; + var firstDraw = !prevStyle; + + for (var i = 0; i < STYLE_COMMON_PROPS.length; i++) { + var prop = STYLE_COMMON_PROPS[i]; + var styleName = prop[0]; + + if (firstDraw || style[styleName] !== prevStyle[styleName]) { + // FIXME Invalid property value will cause style leak from previous element. + ctx[styleName] = + fixShadow(ctx, styleName, style[styleName] || prop[1]); + } + } + + if ((firstDraw || style.fill !== prevStyle.fill)) { + ctx.fillStyle = style.fill; + } + if ((firstDraw || style.stroke !== prevStyle.stroke)) { + ctx.strokeStyle = style.stroke; + } + if ((firstDraw || style.opacity !== prevStyle.opacity)) { + ctx.globalAlpha = style.opacity == null ? 1 : style.opacity; + } + + if ((firstDraw || style.blend !== prevStyle.blend)) { + ctx.globalCompositeOperation = style.blend || 'source-over'; + } + if (this.hasStroke()) { + var lineWidth = style.lineWidth; + ctx.lineWidth = lineWidth / ( + (this.strokeNoScale && el && el.getLineScale) ? el.getLineScale() : 1 + ); + } + }, + + hasFill: function () { + var fill = this.fill; + return fill != null && fill !== 'none'; + }, + + hasStroke: function () { + var stroke = this.stroke; + return stroke != null && stroke !== 'none' && this.lineWidth > 0; + }, + + /** + * Extend from other style + * @param {zrender/graphic/Style} otherStyle + * @param {boolean} overwrite true: overwrirte any way. + * false: overwrite only when !target.hasOwnProperty + * others: overwrite when property is not null/undefined. + */ + extendFrom: function (otherStyle, overwrite) { + if (otherStyle) { + for (var name in otherStyle) { + if (otherStyle.hasOwnProperty(name) + && (overwrite === true + || ( + overwrite === false + ? !this.hasOwnProperty(name) + : otherStyle[name] != null + ) + ) + ) { + this[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; + }, + + getGradient: function (ctx, obj, rect) { + var method = obj.type === 'radial' ? createRadialGradient : createLinearGradient; + var canvasGradient = method(ctx, obj, rect); + var colorStops = obj.colorStops; + for (var i = 0; i < colorStops.length; i++) { + canvasGradient.addColorStop( + colorStops[i].offset, colorStops[i].color + ); + } + return canvasGradient; + } + +}; + +var styleProto = Style.prototype; +for (var i = 0; i < STYLE_COMMON_PROPS.length; i++) { + var prop = STYLE_COMMON_PROPS[i]; + if (!(prop[0] in styleProto)) { + styleProto[prop[0]] = prop[1]; + } +} + +// Provide for others +Style.getGradient = styleProto.getGradient; + +var Pattern = function (image, repeat) { + // Should do nothing more in this constructor. Because gradient can be + // declard by `color: {image: ...}`, where this constructor will not be called. + + this.image = image; + this.repeat = repeat; + + // Can be cloned + this.type = 'pattern'; +}; + +Pattern.prototype.getCanvasPattern = function (ctx) { + return ctx.createPattern(this.image, this.repeat || 'repeat'); +}; + +/** + * @module zrender/Layer + * @author pissang(https://www.github.com/pissang) + */ + +function returnFalse() { + return false; +} + +/** + * 创建dom + * + * @inner + * @param {string} id dom id 待用 + * @param {Painter} painter painter instance + * @param {number} number + */ +function createDom(id, painter, dpr) { + var newDom = createCanvas(); + var width = painter.getWidth(); + var height = painter.getHeight(); + + var newDomStyle = newDom.style; + if (newDomStyle) { // In node or some other non-browser environment + newDomStyle.position = 'absolute'; + newDomStyle.left = 0; + newDomStyle.top = 0; + newDomStyle.width = width + 'px'; + newDomStyle.height = height + 'px'; + + newDom.setAttribute('data-zr-dom-id', id); + } + + newDom.width = width * dpr; + newDom.height = height * dpr; + + 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 || devicePixelRatio; + if (typeof id === 'string') { + dom = createDom(id, painter, dpr); + } + // Not using isDom because in node it will return false + else if (isObject$1(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)'; + domStyle['padding'] = 0; + domStyle['margin'] = 0; + domStyle['border-width'] = 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, + + __dirty: true, + + __used: false, + + __drawIndex: 0, + __startIndex: 0, + __endIndex: 0, + + incremental: false, + + getElementCount: function () { + return this.__endIndex - this.__startIndex; + }, + + initContext: function () { + this.ctx = this.dom.getContext('2d'); + this.ctx.dpr = this.dpr; + }, + + createBackBuffer: function () { + var dpr = this.dpr; + + this.domBack = createDom('back-' + this.id, 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; + + if (domStyle) { + domStyle.width = width + 'px'; + domStyle.height = height + 'px'; + } + + dom.width = width * dpr; + dom.height = height * dpr; + + if (domBack) { + domBack.width = width * dpr; + domBack.height = height * dpr; + + if (dpr != 1) { + this.ctxBack.scale(dpr, dpr); + } + } + }, + + /** + * 清空该层画布 + * @param {boolean} [clearAll]=false Clear all with out motion blur + * @param {Color} [clearColor] + */ + clear: function (clearAll, clearColor) { + var dom = this.dom; + var ctx = this.ctx; + var width = dom.width; + var height = dom.height; + + var clearColor = clearColor || 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, height); + if (clearColor && clearColor !== 'transparent') { + var clearColorGradientOrPattern; + // Gradient + if (clearColor.colorStops) { + // Cache canvas gradient + clearColorGradientOrPattern = clearColor.__canvasGradient || Style.getGradient(ctx, clearColor, { + x: 0, + y: 0, + width: width, + height: height + }); + + clearColor.__canvasGradient = clearColorGradientOrPattern; + } + // Pattern + else if (clearColor.image) { + clearColorGradientOrPattern = Pattern.prototype.getCanvasPattern.call(clearColor, ctx); + } + ctx.save(); + ctx.fillStyle = clearColorGradientOrPattern || clearColor; + ctx.fillRect(0, 0, width, height); + ctx.restore(); + } + + if (haveMotionBLur) { + var domBack = this.domBack; + ctx.save(); + ctx.globalAlpha = lastFrameAlpha; + ctx.drawImage(domBack, 0, 0, width, height); + ctx.restore(); + } + } +}; + +var requestAnimationFrame = ( + typeof window !== 'undefined' + && ( + (window.requestAnimationFrame && window.requestAnimationFrame.bind(window)) + // https://github.com/ecomfe/zrender/issues/189#issuecomment-224919809 + || (window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window)) + || window.mozRequestAnimationFrame + || window.webkitRequestAnimationFrame + ) +) || function (func) { + setTimeout(func, 16); +}; + +var globalImageCache = new LRU(50); + +/** + * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc + * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image + */ +function findExistImage(newImageOrSrc) { + if (typeof newImageOrSrc === 'string') { + var cachedImgObj = globalImageCache.get(newImageOrSrc); + return cachedImgObj && cachedImgObj.image; + } + else { + return newImageOrSrc; + } +} + +/** + * Caution: User should cache loaded images, but not just count on LRU. + * Consider if required images more than LRU size, will dead loop occur? + * + * @param {string|HTMLImageElement|HTMLCanvasElement|Canvas} newImageOrSrc + * @param {HTMLImageElement|HTMLCanvasElement|Canvas} image Existent image. + * @param {module:zrender/Element} [hostEl] For calling `dirty`. + * @param {Function} [cb] params: (image, cbPayload) + * @param {Object} [cbPayload] Payload on cb calling. + * @return {HTMLImageElement|HTMLCanvasElement|Canvas} image + */ +function createOrUpdateImage(newImageOrSrc, image, hostEl, cb, cbPayload) { + if (!newImageOrSrc) { + return image; + } + else if (typeof newImageOrSrc === 'string') { + + // Image should not be loaded repeatly. + if ((image && image.__zrImageSrc === newImageOrSrc) || !hostEl) { + return image; + } + + // Only when there is no existent image or existent image src + // is different, this method is responsible for load. + var cachedImgObj = globalImageCache.get(newImageOrSrc); + + var pendingWrap = {hostEl: hostEl, cb: cb, cbPayload: cbPayload}; + + if (cachedImgObj) { + image = cachedImgObj.image; + !isImageReady(image) && cachedImgObj.pending.push(pendingWrap); + } + else { + !image && (image = new Image()); + image.onload = image.onerror = imageOnLoad; + + globalImageCache.put( + newImageOrSrc, + image.__cachedImgObj = { + image: image, + pending: [pendingWrap] + } + ); + + image.src = image.__zrImageSrc = newImageOrSrc; + } + + return image; + } + // newImageOrSrc is an HTMLImageElement or HTMLCanvasElement or Canvas + else { + return newImageOrSrc; + } +} + +function imageOnLoad() { + var cachedImgObj = this.__cachedImgObj; + this.onload = this.onerror = this.__cachedImgObj = null; + + for (var i = 0; i < cachedImgObj.pending.length; i++) { + var pendingWrap = cachedImgObj.pending[i]; + var cb = pendingWrap.cb; + cb && cb(this, pendingWrap.cbPayload); + pendingWrap.hostEl.dirty(); + } + cachedImgObj.pending.length = 0; +} + +function isImageReady(image) { + return image && image.width && image.height; +} + +var textWidthCache = {}; +var textWidthCacheCounter = 0; + +var TEXT_CACHE_MAX = 5000; +var STYLE_REG = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g; + +var DEFAULT_FONT = '12px sans-serif'; + +// Avoid assign to an exported variable, for transforming to cjs. +var methods$1 = {}; + +function $override$1(name, fn) { + methods$1[name] = fn; +} + +/** + * @public + * @param {string} text + * @param {string} font + * @return {number} width + */ +function getWidth(text, font) { + font = font || DEFAULT_FONT; + var key = text + ':' + font; + if (textWidthCache[key]) { + return textWidthCache[key]; + } + + var textLines = (text + '').split('\n'); + var width = 0; + + for (var i = 0, l = textLines.length; i < l; i++) { + // textContain.measureText may be overrided in SVG or VML + width = Math.max(measureText(textLines[i], font).width, width); + } + + if (textWidthCacheCounter > TEXT_CACHE_MAX) { + textWidthCacheCounter = 0; + textWidthCache = {}; + } + textWidthCacheCounter++; + textWidthCache[key] = width; + + return width; +} + +/** + * @public + * @param {string} text + * @param {string} font + * @param {string} [textAlign='left'] + * @param {string} [textVerticalAlign='top'] + * @param {Array.} [textPadding] + * @param {Object} [rich] + * @param {Object} [truncate] + * @return {Object} {x, y, width, height, lineHeight} + */ +function getBoundingRect(text, font, textAlign, textVerticalAlign, textPadding, rich, truncate) { + return rich + ? getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, rich, truncate) + : getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, truncate); +} + +function getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, truncate) { + var contentBlock = parsePlainText(text, font, textPadding, truncate); + var outerWidth = getWidth(text, font); + if (textPadding) { + outerWidth += textPadding[1] + textPadding[3]; + } + var outerHeight = contentBlock.outerHeight; + + var x = adjustTextX(0, outerWidth, textAlign); + var y = adjustTextY(0, outerHeight, textVerticalAlign); + + var rect = new BoundingRect(x, y, outerWidth, outerHeight); + rect.lineHeight = contentBlock.lineHeight; + + return rect; +} + +function getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, rich, truncate) { + var contentBlock = parseRichText(text, { + rich: rich, + truncate: truncate, + font: font, + textAlign: textAlign, + textPadding: textPadding + }); + var outerWidth = contentBlock.outerWidth; + var outerHeight = contentBlock.outerHeight; + + var x = adjustTextX(0, outerWidth, textAlign); + var y = adjustTextY(0, outerHeight, textVerticalAlign); + + return new BoundingRect(x, y, outerWidth, outerHeight); +} + +/** + * @public + * @param {number} x + * @param {number} width + * @param {string} [textAlign='left'] + * @return {number} Adjusted x. + */ +function adjustTextX(x, width, textAlign) { + // FIXME Right to left language + if (textAlign === 'right') { + x -= width; + } + else if (textAlign === 'center') { + x -= width / 2; + } + return x; +} + +/** + * @public + * @param {number} y + * @param {number} height + * @param {string} [textVerticalAlign='top'] + * @return {number} Adjusted y. + */ +function adjustTextY(y, height, textVerticalAlign) { + if (textVerticalAlign === 'middle') { + y -= height / 2; + } + else if (textVerticalAlign === 'bottom') { + y -= height; + } + return y; +} + +/** + * @public + * @param {stirng} textPosition + * @param {Object} rect {x, y, width, height} + * @param {number} distance + * @return {Object} {x, y, textAlign, textVerticalAlign} + */ +function adjustTextPositionOnRect(textPosition, rect, distance) { + + var x = rect.x; + var y = rect.y; + + var height = rect.height; + var width = rect.width; + var halfHeight = height / 2; + + var textAlign = 'left'; + var textVerticalAlign = 'top'; + + switch (textPosition) { + case 'left': + x -= distance; + y += halfHeight; + textAlign = 'right'; + textVerticalAlign = 'middle'; + break; + case 'right': + x += distance + width; + y += halfHeight; + textVerticalAlign = 'middle'; + break; + case 'top': + x += width / 2; + y -= distance; + textAlign = 'center'; + textVerticalAlign = 'bottom'; + break; + case 'bottom': + x += width / 2; + y += height + distance; + textAlign = 'center'; + break; + case 'inside': + x += width / 2; + y += halfHeight; + textAlign = 'center'; + textVerticalAlign = 'middle'; + break; + case 'insideLeft': + x += distance; + y += halfHeight; + textVerticalAlign = 'middle'; + break; + case 'insideRight': + x += width - distance; + y += halfHeight; + textAlign = 'right'; + textVerticalAlign = 'middle'; + break; + case 'insideTop': + x += width / 2; + y += distance; + textAlign = 'center'; + break; + case 'insideBottom': + x += width / 2; + y += height - distance; + textAlign = 'center'; + textVerticalAlign = 'bottom'; + break; + case 'insideTopLeft': + x += distance; + y += distance; + break; + case 'insideTopRight': + x += width - distance; + y += distance; + textAlign = 'right'; + break; + case 'insideBottomLeft': + x += distance; + y += height - distance; + textVerticalAlign = 'bottom'; + break; + case 'insideBottomRight': + x += width - distance; + y += height - distance; + textAlign = 'right'; + textVerticalAlign = 'bottom'; + break; + } + + return { + x: x, + y: y, + textAlign: textAlign, + textVerticalAlign: textVerticalAlign + }; +} + +/** + * Show ellipsis if overflow. + * + * @public + * @param {string} text + * @param {string} containerWidth + * @param {string} font + * @param {number} [ellipsis='...'] + * @param {Object} [options] + * @param {number} [options.maxIterations=3] + * @param {number} [options.minChar=0] If truncate result are less + * then minChar, ellipsis will not show, which is + * better for user hint in some cases. + * @param {number} [options.placeholder=''] When all truncated, use the placeholder. + * @return {string} + */ +function truncateText(text, containerWidth, font, ellipsis, options) { + if (!containerWidth) { + return ''; + } + + var textLines = (text + '').split('\n'); + options = prepareTruncateOptions(containerWidth, font, ellipsis, options); + + // FIXME + // It is not appropriate that every line has '...' when truncate multiple lines. + for (var i = 0, len = textLines.length; i < len; i++) { + textLines[i] = truncateSingleLine(textLines[i], options); + } + + return textLines.join('\n'); +} + +function prepareTruncateOptions(containerWidth, font, ellipsis, options) { + options = extend({}, options); + + options.font = font; + var ellipsis = retrieve2(ellipsis, '...'); + options.maxIterations = retrieve2(options.maxIterations, 2); + var minChar = options.minChar = retrieve2(options.minChar, 0); + // FIXME + // Other languages? + options.cnCharWidth = getWidth('国', font); + // FIXME + // Consider proportional font? + var ascCharWidth = options.ascCharWidth = getWidth('a', font); + options.placeholder = retrieve2(options.placeholder, ''); + + // Example 1: minChar: 3, text: 'asdfzxcv', truncate result: 'asdf', but not: 'a...'. + // Example 2: minChar: 3, text: '维度', truncate result: '维', but not: '...'. + var contentWidth = containerWidth = Math.max(0, containerWidth - 1); // Reserve some gap. + for (var i = 0; i < minChar && contentWidth >= ascCharWidth; i++) { + contentWidth -= ascCharWidth; + } + + var ellipsisWidth = getWidth(ellipsis); + if (ellipsisWidth > contentWidth) { + ellipsis = ''; + ellipsisWidth = 0; + } + + contentWidth = containerWidth - ellipsisWidth; + + options.ellipsis = ellipsis; + options.ellipsisWidth = ellipsisWidth; + options.contentWidth = contentWidth; + options.containerWidth = containerWidth; + + return options; +} + +function truncateSingleLine(textLine, options) { + var containerWidth = options.containerWidth; + var font = options.font; + var contentWidth = options.contentWidth; + + if (!containerWidth) { + return ''; + } + + var lineWidth = getWidth(textLine, font); + + if (lineWidth <= containerWidth) { + return textLine; + } + + for (var j = 0;; j++) { + if (lineWidth <= contentWidth || j >= options.maxIterations) { + textLine += options.ellipsis; + break; + } + + var subLength = j === 0 + ? estimateLength(textLine, contentWidth, options.ascCharWidth, options.cnCharWidth) + : lineWidth > 0 + ? Math.floor(textLine.length * contentWidth / lineWidth) + : 0; + + textLine = textLine.substr(0, subLength); + lineWidth = getWidth(textLine, font); + } + + if (textLine === '') { + textLine = options.placeholder; + } + + return textLine; +} + +function estimateLength(text, contentWidth, ascCharWidth, cnCharWidth) { + var width = 0; + var i = 0; + for (var len = text.length; i < len && width < contentWidth; i++) { + var charCode = text.charCodeAt(i); + width += (0 <= charCode && charCode <= 127) ? ascCharWidth : cnCharWidth; + } + return i; +} + +/** + * @public + * @param {string} font + * @return {number} line height + */ +function getLineHeight(font) { + // FIXME A rough approach. + return getWidth('国', font); +} + +/** + * @public + * @param {string} text + * @param {string} font + * @return {Object} width + */ +function measureText(text, font) { + return methods$1.measureText(text, font); +} + +// Avoid assign to an exported variable, for transforming to cjs. +methods$1.measureText = function (text, font) { + var ctx = getContext(); + ctx.font = font || DEFAULT_FONT; + return ctx.measureText(text); +}; + +/** + * @public + * @param {string} text + * @param {string} font + * @param {Object} [truncate] + * @return {Object} block: {lineHeight, lines, height, outerHeight} + * Notice: for performance, do not calculate outerWidth util needed. + */ +function parsePlainText(text, font, padding, truncate) { + text != null && (text += ''); + + var lineHeight = getLineHeight(font); + var lines = text ? text.split('\n') : []; + var height = lines.length * lineHeight; + var outerHeight = height; + + if (padding) { + outerHeight += padding[0] + padding[2]; + } + + if (text && truncate) { + var truncOuterHeight = truncate.outerHeight; + var truncOuterWidth = truncate.outerWidth; + if (truncOuterHeight != null && outerHeight > truncOuterHeight) { + text = ''; + lines = []; + } + else if (truncOuterWidth != null) { + var options = prepareTruncateOptions( + truncOuterWidth - (padding ? padding[1] + padding[3] : 0), + font, + truncate.ellipsis, + {minChar: truncate.minChar, placeholder: truncate.placeholder} + ); + + // FIXME + // It is not appropriate that every line has '...' when truncate multiple lines. + for (var i = 0, len = lines.length; i < len; i++) { + lines[i] = truncateSingleLine(lines[i], options); + } + } + } + + return { + lines: lines, + height: height, + outerHeight: outerHeight, + lineHeight: lineHeight + }; +} + +/** + * For example: 'some text {a|some text}other text{b|some text}xxx{c|}xxx' + * Also consider 'bbbb{a|xxx\nzzz}xxxx\naaaa'. + * + * @public + * @param {string} text + * @param {Object} style + * @return {Object} block + * { + * width, + * height, + * lines: [{ + * lineHeight, + * width, + * tokens: [[{ + * styleName, + * text, + * width, // include textPadding + * height, // include textPadding + * textWidth, // pure text width + * textHeight, // pure text height + * lineHeihgt, + * font, + * textAlign, + * textVerticalAlign + * }], [...], ...] + * }, ...] + * } + * If styleName is undefined, it is plain text. + */ +function parseRichText(text, style) { + var contentBlock = {lines: [], width: 0, height: 0}; + + text != null && (text += ''); + if (!text) { + return contentBlock; + } + + var lastIndex = STYLE_REG.lastIndex = 0; + var result; + while ((result = STYLE_REG.exec(text)) != null) { + var matchedIndex = result.index; + if (matchedIndex > lastIndex) { + pushTokens(contentBlock, text.substring(lastIndex, matchedIndex)); + } + pushTokens(contentBlock, result[2], result[1]); + lastIndex = STYLE_REG.lastIndex; + } + + if (lastIndex < text.length) { + pushTokens(contentBlock, text.substring(lastIndex, text.length)); + } + + var lines = contentBlock.lines; + var contentHeight = 0; + var contentWidth = 0; + // For `textWidth: 100%` + var pendingList = []; + + var stlPadding = style.textPadding; + + var truncate = style.truncate; + var truncateWidth = truncate && truncate.outerWidth; + var truncateHeight = truncate && truncate.outerHeight; + if (stlPadding) { + truncateWidth != null && (truncateWidth -= stlPadding[1] + stlPadding[3]); + truncateHeight != null && (truncateHeight -= stlPadding[0] + stlPadding[2]); + } + + // Calculate layout info of tokens. + for (var i = 0; i < lines.length; i++) { + var line = lines[i]; + var lineHeight = 0; + var lineWidth = 0; + + for (var j = 0; j < line.tokens.length; j++) { + var token = line.tokens[j]; + var tokenStyle = token.styleName && style.rich[token.styleName] || {}; + // textPadding should not inherit from style. + var textPadding = token.textPadding = tokenStyle.textPadding; + + // textFont has been asigned to font by `normalizeStyle`. + var font = token.font = tokenStyle.font || style.font; + + // textHeight can be used when textVerticalAlign is specified in token. + var tokenHeight = token.textHeight = retrieve2( + // textHeight should not be inherited, consider it can be specified + // as box height of the block. + tokenStyle.textHeight, getLineHeight(font) + ); + textPadding && (tokenHeight += textPadding[0] + textPadding[2]); + token.height = tokenHeight; + token.lineHeight = retrieve3( + tokenStyle.textLineHeight, style.textLineHeight, tokenHeight + ); + + token.textAlign = tokenStyle && tokenStyle.textAlign || style.textAlign; + token.textVerticalAlign = tokenStyle && tokenStyle.textVerticalAlign || 'middle'; + + if (truncateHeight != null && contentHeight + token.lineHeight > truncateHeight) { + return {lines: [], width: 0, height: 0}; + } + + token.textWidth = getWidth(token.text, font); + var tokenWidth = tokenStyle.textWidth; + var tokenWidthNotSpecified = tokenWidth == null || tokenWidth === 'auto'; + + // Percent width, can be `100%`, can be used in drawing separate + // line when box width is needed to be auto. + if (typeof tokenWidth === 'string' && tokenWidth.charAt(tokenWidth.length - 1) === '%') { + token.percentWidth = tokenWidth; + pendingList.push(token); + tokenWidth = 0; + // Do not truncate in this case, because there is no user case + // and it is too complicated. + } + else { + if (tokenWidthNotSpecified) { + tokenWidth = token.textWidth; + + // FIXME: If image is not loaded and textWidth is not specified, calling + // `getBoundingRect()` will not get correct result. + var textBackgroundColor = tokenStyle.textBackgroundColor; + var bgImg = textBackgroundColor && textBackgroundColor.image; + + // Use cases: + // (1) If image is not loaded, it will be loaded at render phase and call + // `dirty()` and `textBackgroundColor.image` will be replaced with the loaded + // image, and then the right size will be calculated here at the next tick. + // See `graphic/helper/text.js`. + // (2) If image loaded, and `textBackgroundColor.image` is image src string, + // use `imageHelper.findExistImage` to find cached image. + // `imageHelper.findExistImage` will always be called here before + // `imageHelper.createOrUpdateImage` in `graphic/helper/text.js#renderRichText` + // which ensures that image will not be rendered before correct size calcualted. + if (bgImg) { + bgImg = findExistImage(bgImg); + if (isImageReady(bgImg)) { + tokenWidth = Math.max(tokenWidth, bgImg.width * tokenHeight / bgImg.height); + } + } + } + + var paddingW = textPadding ? textPadding[1] + textPadding[3] : 0; + tokenWidth += paddingW; + + var remianTruncWidth = truncateWidth != null ? truncateWidth - lineWidth : null; + + if (remianTruncWidth != null && remianTruncWidth < tokenWidth) { + if (!tokenWidthNotSpecified || remianTruncWidth < paddingW) { + token.text = ''; + token.textWidth = tokenWidth = 0; + } + else { + token.text = truncateText( + token.text, remianTruncWidth - paddingW, font, truncate.ellipsis, + {minChar: truncate.minChar} + ); + token.textWidth = getWidth(token.text, font); + tokenWidth = token.textWidth + paddingW; + } + } + } + + lineWidth += (token.width = tokenWidth); + tokenStyle && (lineHeight = Math.max(lineHeight, token.lineHeight)); + } + + line.width = lineWidth; + line.lineHeight = lineHeight; + contentHeight += lineHeight; + contentWidth = Math.max(contentWidth, lineWidth); + } + + contentBlock.outerWidth = contentBlock.width = retrieve2(style.textWidth, contentWidth); + contentBlock.outerHeight = contentBlock.height = retrieve2(style.textHeight, contentHeight); + + if (stlPadding) { + contentBlock.outerWidth += stlPadding[1] + stlPadding[3]; + contentBlock.outerHeight += stlPadding[0] + stlPadding[2]; + } + + for (var i = 0; i < pendingList.length; i++) { + var token = pendingList[i]; + var percentWidth = token.percentWidth; + // Should not base on outerWidth, because token can not be placed out of padding. + token.width = parseInt(percentWidth, 10) / 100 * contentWidth; + } + + return contentBlock; +} + +function pushTokens(block, str, styleName) { + var isEmptyStr = str === ''; + var strs = str.split('\n'); + var lines = block.lines; + + for (var i = 0; i < strs.length; i++) { + var text = strs[i]; + var token = { + styleName: styleName, + text: text, + isLineHolder: !text && !isEmptyStr + }; + + // The first token should be appended to the last line. + if (!i) { + var tokens = (lines[lines.length - 1] || (lines[0] = {tokens: []})).tokens; + + // Consider cases: + // (1) ''.split('\n') => ['', '\n', ''], the '' at the first item + // (which is a placeholder) should be replaced by new token. + // (2) A image backage, where token likes {a|}. + // (3) A redundant '' will affect textAlign in line. + // (4) tokens with the same tplName should not be merged, because + // they should be displayed in different box (with border and padding). + var tokensLen = tokens.length; + (tokensLen === 1 && tokens[0].isLineHolder) + ? (tokens[0] = token) + // Consider text is '', only insert when it is the "lineHolder" or + // "emptyStr". Otherwise a redundant '' will affect textAlign in line. + : ((text || !tokensLen || isEmptyStr) && tokens.push(token)); + } + // Other tokens always start a new line. + else { + // If there is '', insert it as a placeholder. + lines.push({tokens: [token]}); + } + } +} + +function makeFont(style) { + // FIXME in node-canvas fontWeight is before fontStyle + // Use `fontSize` `fontFamily` to check whether font properties are defined. + var font = (style.fontSize || style.fontFamily) && [ + style.fontStyle, + style.fontWeight, + (style.fontSize || 12) + 'px', + // If font properties are defined, `fontFamily` should not be ignored. + style.fontFamily || 'sans-serif' + ].join(' '); + return font && trim(font) || style.textFont || style.font; +} + +function buildPath(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.arc(x + width - r2, y + r2, r2, -Math.PI / 2, 0); + ctx.lineTo(x + width, y + height - r3); + r3 !== 0 && ctx.arc(x + width - r3, y + height - r3, r3, 0, Math.PI / 2); + ctx.lineTo(x + r4, y + height); + r4 !== 0 && ctx.arc(x + r4, y + height - r4, r4, Math.PI / 2, Math.PI); + ctx.lineTo(x, y + r1); + r1 !== 0 && ctx.arc(x + r1, y + r1, r1, Math.PI, Math.PI * 1.5); +} + +// TODO: Have not support 'start', 'end' yet. +var VALID_TEXT_ALIGN = {left: 1, right: 1, center: 1}; +var VALID_TEXT_VERTICAL_ALIGN = {top: 1, bottom: 1, middle: 1}; +// Different from `STYLE_COMMON_PROPS` of `graphic/Style`, +// the default value of shadowColor is `'transparent'`. +var SHADOW_STYLE_COMMON_PROPS = [ + ['textShadowBlur', 'shadowBlur', 0], + ['textShadowOffsetX', 'shadowOffsetX', 0], + ['textShadowOffsetY', 'shadowOffsetY', 0], + ['textShadowColor', 'shadowColor', 'transparent'] +]; + +/** + * @param {module:zrender/graphic/Style} style + * @return {module:zrender/graphic/Style} The input style. + */ +function normalizeTextStyle(style) { + normalizeStyle(style); + each$1(style.rich, normalizeStyle); + return style; +} + +function normalizeStyle(style) { + if (style) { + + style.font = makeFont(style); + + var textAlign = style.textAlign; + textAlign === 'middle' && (textAlign = 'center'); + style.textAlign = ( + textAlign == null || VALID_TEXT_ALIGN[textAlign] + ) ? textAlign : 'left'; + + // Compatible with textBaseline. + var textVerticalAlign = style.textVerticalAlign || style.textBaseline; + textVerticalAlign === 'center' && (textVerticalAlign = 'middle'); + style.textVerticalAlign = ( + textVerticalAlign == null || VALID_TEXT_VERTICAL_ALIGN[textVerticalAlign] + ) ? textVerticalAlign : 'top'; + + var textPadding = style.textPadding; + if (textPadding) { + style.textPadding = normalizeCssArray(style.textPadding); + } + } +} + +/** + * @param {CanvasRenderingContext2D} ctx + * @param {string} text + * @param {module:zrender/graphic/Style} style + * @param {Object|boolean} [rect] {x, y, width, height} + * If set false, rect text is not used. + * @param {Element} [prevEl] For ctx prop cache. + */ +function renderText(hostEl, ctx, text, style, rect, prevEl) { + style.rich + ? renderRichText(hostEl, ctx, text, style, rect) + : renderPlainText(hostEl, ctx, text, style, rect, prevEl); +} + +// Avoid setting to ctx according to prevEl if possible for +// performance in scenarios of large amount text. +function renderPlainText(hostEl, ctx, text, style, rect, prevEl) { + 'use strict'; + + var prevStyle = prevEl && prevEl.style; + // Some cache only available on textEl. + var isPrevTextEl = prevStyle && prevEl.type === 'text'; + + var styleFont = style.font || DEFAULT_FONT; + if (!isPrevTextEl || styleFont !== (prevStyle.font || DEFAULT_FONT)) { + ctx.font = styleFont; + } + // Use the final font from context-2d, because the final + // font might not be the style.font when it is illegal. + // But get `ctx.font` might be time consuming. + var computedFont = hostEl.__computedFont; + if (hostEl.__styleFont !== styleFont) { + hostEl.__styleFont = styleFont; + computedFont = hostEl.__computedFont = ctx.font; + } + + var textPadding = style.textPadding; + + var contentBlock = hostEl.__textCotentBlock; + if (!contentBlock || hostEl.__dirtyText) { + contentBlock = hostEl.__textCotentBlock = parsePlainText( + text, computedFont, textPadding, style.truncate + ); + } + + var outerHeight = contentBlock.outerHeight; + + var textLines = contentBlock.lines; + var lineHeight = contentBlock.lineHeight; + + var boxPos = getBoxPosition(outerHeight, style, rect); + var baseX = boxPos.baseX; + var baseY = boxPos.baseY; + var textAlign = boxPos.textAlign || 'left'; + var textVerticalAlign = boxPos.textVerticalAlign; + + // Origin of textRotation should be the base point of text drawing. + applyTextRotation(ctx, style, rect, baseX, baseY); + + var boxY = adjustTextY(baseY, outerHeight, textVerticalAlign); + var textX = baseX; + var textY = boxY; + + var needDrawBg = needDrawBackground(style); + if (needDrawBg || textPadding) { + // Consider performance, do not call getTextWidth util necessary. + var textWidth = getWidth(text, computedFont); + var outerWidth = textWidth; + textPadding && (outerWidth += textPadding[1] + textPadding[3]); + var boxX = adjustTextX(baseX, outerWidth, textAlign); + + needDrawBg && drawBackground(hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight); + + if (textPadding) { + textX = getTextXForPadding(baseX, textAlign, textPadding); + textY += textPadding[0]; + } + } + + // Always set textAlign and textBase line, because it is difficute to calculate + // textAlign from prevEl, and we dont sure whether textAlign will be reset if + // font set happened. + ctx.textAlign = textAlign; + // Force baseline to be "middle". Otherwise, if using "top", the + // text will offset downward a little bit in font "Microsoft YaHei". + ctx.textBaseline = 'middle'; + + // Always set shadowBlur and shadowOffset to avoid leak from displayable. + for (var i = 0; i < SHADOW_STYLE_COMMON_PROPS.length; i++) { + var propItem = SHADOW_STYLE_COMMON_PROPS[i]; + var styleProp = propItem[0]; + var ctxProp = propItem[1]; + var val = style[styleProp]; + if (!isPrevTextEl || val !== prevStyle[styleProp]) { + ctx[ctxProp] = fixShadow(ctx, ctxProp, val || propItem[2]); + } + } + + // `textBaseline` is set as 'middle'. + textY += lineHeight / 2; + + var textStrokeWidth = style.textStrokeWidth; + var textStrokeWidthPrev = isPrevTextEl ? prevStyle.textStrokeWidth : null; + var strokeWidthChanged = !isPrevTextEl || textStrokeWidth !== textStrokeWidthPrev; + var strokeChanged = !isPrevTextEl || strokeWidthChanged || style.textStroke !== prevStyle.textStroke; + var textStroke = getStroke(style.textStroke, textStrokeWidth); + var textFill = getFill(style.textFill); + + if (textStroke) { + if (strokeWidthChanged) { + ctx.lineWidth = textStrokeWidth; + } + if (strokeChanged) { + ctx.strokeStyle = textStroke; + } + } + if (textFill) { + if (!isPrevTextEl || style.textFill !== prevStyle.textFill) { + ctx.fillStyle = textFill; + } + } + + // Optimize simply, in most cases only one line exists. + if (textLines.length === 1) { + // Fill after stroke so the outline will not cover the main part. + textStroke && ctx.strokeText(textLines[0], textX, textY); + textFill && ctx.fillText(textLines[0], textX, textY); + } + else { + for (var i = 0; i < textLines.length; i++) { + // Fill after stroke so the outline will not cover the main part. + textStroke && ctx.strokeText(textLines[i], textX, textY); + textFill && ctx.fillText(textLines[i], textX, textY); + textY += lineHeight; + } + } +} + +function renderRichText(hostEl, ctx, text, style, rect) { + var contentBlock = hostEl.__textCotentBlock; + + if (!contentBlock || hostEl.__dirtyText) { + contentBlock = hostEl.__textCotentBlock = parseRichText(text, style); + } + + drawRichText(hostEl, ctx, contentBlock, style, rect); +} + +function drawRichText(hostEl, ctx, contentBlock, style, rect) { + var contentWidth = contentBlock.width; + var outerWidth = contentBlock.outerWidth; + var outerHeight = contentBlock.outerHeight; + var textPadding = style.textPadding; + + var boxPos = getBoxPosition(outerHeight, style, rect); + var baseX = boxPos.baseX; + var baseY = boxPos.baseY; + var textAlign = boxPos.textAlign; + var textVerticalAlign = boxPos.textVerticalAlign; + + // Origin of textRotation should be the base point of text drawing. + applyTextRotation(ctx, style, rect, baseX, baseY); + + var boxX = adjustTextX(baseX, outerWidth, textAlign); + var boxY = adjustTextY(baseY, outerHeight, textVerticalAlign); + var xLeft = boxX; + var lineTop = boxY; + if (textPadding) { + xLeft += textPadding[3]; + lineTop += textPadding[0]; + } + var xRight = xLeft + contentWidth; + + needDrawBackground(style) && drawBackground( + hostEl, ctx, style, boxX, boxY, outerWidth, outerHeight + ); + + for (var i = 0; i < contentBlock.lines.length; i++) { + var line = contentBlock.lines[i]; + var tokens = line.tokens; + var tokenCount = tokens.length; + var lineHeight = line.lineHeight; + var usedWidth = line.width; + + var leftIndex = 0; + var lineXLeft = xLeft; + var lineXRight = xRight; + var rightIndex = tokenCount - 1; + var token; + + while ( + leftIndex < tokenCount + && (token = tokens[leftIndex], !token.textAlign || token.textAlign === 'left') + ) { + placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft, 'left'); + usedWidth -= token.width; + lineXLeft += token.width; + leftIndex++; + } + + while ( + rightIndex >= 0 + && (token = tokens[rightIndex], token.textAlign === 'right') + ) { + placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXRight, 'right'); + usedWidth -= token.width; + lineXRight -= token.width; + rightIndex--; + } + + // The other tokens are placed as textAlign 'center' if there is enough space. + lineXLeft += (contentWidth - (lineXLeft - xLeft) - (xRight - lineXRight) - usedWidth) / 2; + while (leftIndex <= rightIndex) { + token = tokens[leftIndex]; + // Consider width specified by user, use 'center' rather than 'left'. + placeToken(hostEl, ctx, token, style, lineHeight, lineTop, lineXLeft + token.width / 2, 'center'); + lineXLeft += token.width; + leftIndex++; + } + + lineTop += lineHeight; + } +} + +function applyTextRotation(ctx, style, rect, x, y) { + // textRotation only apply in RectText. + if (rect && style.textRotation) { + var origin = style.textOrigin; + if (origin === 'center') { + x = rect.width / 2 + rect.x; + y = rect.height / 2 + rect.y; + } + else if (origin) { + x = origin[0] + rect.x; + y = origin[1] + rect.y; + } + + ctx.translate(x, y); + // Positive: anticlockwise + ctx.rotate(-style.textRotation); + ctx.translate(-x, -y); + } +} + +function placeToken(hostEl, ctx, token, style, lineHeight, lineTop, x, textAlign) { + var tokenStyle = style.rich[token.styleName] || {}; + tokenStyle.text = token.text; + + // 'ctx.textBaseline' is always set as 'middle', for sake of + // the bias of "Microsoft YaHei". + var textVerticalAlign = token.textVerticalAlign; + var y = lineTop + lineHeight / 2; + if (textVerticalAlign === 'top') { + y = lineTop + token.height / 2; + } + else if (textVerticalAlign === 'bottom') { + y = lineTop + lineHeight - token.height / 2; + } + + !token.isLineHolder && needDrawBackground(tokenStyle) && drawBackground( + hostEl, + ctx, + tokenStyle, + textAlign === 'right' + ? x - token.width + : textAlign === 'center' + ? x - token.width / 2 + : x, + y - token.height / 2, + token.width, + token.height + ); + + var textPadding = token.textPadding; + if (textPadding) { + x = getTextXForPadding(x, textAlign, textPadding); + y -= token.height / 2 - textPadding[2] - token.textHeight / 2; + } + + setCtx(ctx, 'shadowBlur', retrieve3(tokenStyle.textShadowBlur, style.textShadowBlur, 0)); + setCtx(ctx, 'shadowColor', tokenStyle.textShadowColor || style.textShadowColor || 'transparent'); + setCtx(ctx, 'shadowOffsetX', retrieve3(tokenStyle.textShadowOffsetX, style.textShadowOffsetX, 0)); + setCtx(ctx, 'shadowOffsetY', retrieve3(tokenStyle.textShadowOffsetY, style.textShadowOffsetY, 0)); + + setCtx(ctx, 'textAlign', textAlign); + // Force baseline to be "middle". Otherwise, if using "top", the + // text will offset downward a little bit in font "Microsoft YaHei". + setCtx(ctx, 'textBaseline', 'middle'); + + setCtx(ctx, 'font', token.font || DEFAULT_FONT); + + var textStroke = getStroke(tokenStyle.textStroke || style.textStroke, textStrokeWidth); + var textFill = getFill(tokenStyle.textFill || style.textFill); + var textStrokeWidth = retrieve2(tokenStyle.textStrokeWidth, style.textStrokeWidth); + + // Fill after stroke so the outline will not cover the main part. + if (textStroke) { + setCtx(ctx, 'lineWidth', textStrokeWidth); + setCtx(ctx, 'strokeStyle', textStroke); + ctx.strokeText(token.text, x, y); + } + if (textFill) { + setCtx(ctx, 'fillStyle', textFill); + ctx.fillText(token.text, x, y); + } +} + +function needDrawBackground(style) { + return style.textBackgroundColor + || (style.textBorderWidth && style.textBorderColor); +} + +// style: {textBackgroundColor, textBorderWidth, textBorderColor, textBorderRadius, text} +// shape: {x, y, width, height} +function drawBackground(hostEl, ctx, style, x, y, width, height) { + var textBackgroundColor = style.textBackgroundColor; + var textBorderWidth = style.textBorderWidth; + var textBorderColor = style.textBorderColor; + var isPlainBg = isString(textBackgroundColor); + + setCtx(ctx, 'shadowBlur', style.textBoxShadowBlur || 0); + setCtx(ctx, 'shadowColor', style.textBoxShadowColor || 'transparent'); + setCtx(ctx, 'shadowOffsetX', style.textBoxShadowOffsetX || 0); + setCtx(ctx, 'shadowOffsetY', style.textBoxShadowOffsetY || 0); + + if (isPlainBg || (textBorderWidth && textBorderColor)) { + ctx.beginPath(); + var textBorderRadius = style.textBorderRadius; + if (!textBorderRadius) { + ctx.rect(x, y, width, height); + } + else { + buildPath(ctx, { + x: x, y: y, width: width, height: height, r: textBorderRadius + }); + } + ctx.closePath(); + } + + if (isPlainBg) { + setCtx(ctx, 'fillStyle', textBackgroundColor); + + if (style.fillOpacity != null) { + var originalGlobalAlpha = ctx.globalAlpha; + ctx.globalAlpha = style.fillOpacity * style.opacity; + ctx.fill(); + ctx.globalAlpha = originalGlobalAlpha; + } + else { + ctx.fill(); + } + } + else if (isFunction$1(textBackgroundColor)) { + setCtx(ctx, 'fillStyle', textBackgroundColor(style)); + ctx.fill(); + } + else if (isObject$1(textBackgroundColor)) { + var image = textBackgroundColor.image; + + image = createOrUpdateImage( + image, null, hostEl, onBgImageLoaded, textBackgroundColor + ); + if (image && isImageReady(image)) { + ctx.drawImage(image, x, y, width, height); + } + } + + if (textBorderWidth && textBorderColor) { + setCtx(ctx, 'lineWidth', textBorderWidth); + setCtx(ctx, 'strokeStyle', textBorderColor); + + if (style.strokeOpacity != null) { + var originalGlobalAlpha = ctx.globalAlpha; + ctx.globalAlpha = style.strokeOpacity * style.opacity; + ctx.stroke(); + ctx.globalAlpha = originalGlobalAlpha; + } + else { + ctx.stroke(); + } + } +} + +function onBgImageLoaded(image, textBackgroundColor) { + // Replace image, so that `contain/text.js#parseRichText` + // will get correct result in next tick. + textBackgroundColor.image = image; +} + +function getBoxPosition(blockHeiht, style, rect) { + var baseX = style.x || 0; + var baseY = style.y || 0; + var textAlign = style.textAlign; + var textVerticalAlign = style.textVerticalAlign; + + // Text position represented by coord + if (rect) { + var textPosition = style.textPosition; + if (textPosition instanceof Array) { + // Percent + baseX = rect.x + parsePercent(textPosition[0], rect.width); + baseY = rect.y + parsePercent(textPosition[1], rect.height); + } + else { + var res = adjustTextPositionOnRect( + textPosition, rect, style.textDistance + ); + baseX = res.x; + baseY = res.y; + // Default align and baseline when has textPosition + textAlign = textAlign || res.textAlign; + textVerticalAlign = textVerticalAlign || res.textVerticalAlign; + } + + // textOffset is only support in RectText, otherwise + // we have to adjust boundingRect for textOffset. + var textOffset = style.textOffset; + if (textOffset) { + baseX += textOffset[0]; + baseY += textOffset[1]; + } + } + + return { + baseX: baseX, + baseY: baseY, + textAlign: textAlign, + textVerticalAlign: textVerticalAlign + }; +} + +function setCtx(ctx, prop, value) { + ctx[prop] = fixShadow(ctx, prop, value); + return ctx[prop]; +} + +/** + * @param {string} [stroke] If specified, do not check style.textStroke. + * @param {string} [lineWidth] If specified, do not check style.textStroke. + * @param {number} style + */ +function getStroke(stroke, lineWidth) { + return (stroke == null || lineWidth <= 0 || stroke === 'transparent' || stroke === 'none') + ? null + // TODO pattern and gradient? + : (stroke.image || stroke.colorStops) + ? '#000' + : stroke; +} + +function getFill(fill) { + return (fill == null || fill === 'none') + ? null + // TODO pattern and gradient? + : (fill.image || fill.colorStops) + ? '#000' + : fill; +} + +function parsePercent(value, maxValue) { + if (typeof value === 'string') { + if (value.lastIndexOf('%') >= 0) { + return parseFloat(value) / 100 * maxValue; + } + return parseFloat(value); + } + return value; +} + +function getTextXForPadding(x, textAlign, textPadding) { + return textAlign === 'right' + ? (x - textPadding[1]) + : textAlign === 'center' + ? (x + textPadding[3] / 2 - textPadding[1] / 2) + : (x + textPadding[3]); +} + +/** + * @param {string} text + * @param {module:zrender/Style} style + * @return {boolean} + */ +function needDrawText(text, style) { + return text != null + && (text + || style.textBackgroundColor + || (style.textBorderWidth && style.textBorderColor) + || style.textPadding + ); +} + +/** + * Mixin for drawing text in a element bounding rect + * @module zrender/mixin/RectText + */ + +var tmpRect$1 = new BoundingRect(); + +var RectText = function () {}; + +RectText.prototype = { + + constructor: RectText, + + /** + * Draw text in a rect with specified position. + * @param {CanvasRenderingContext2D} ctx + * @param {Object} rect Displayable rect + */ + drawRectText: function (ctx, rect) { + var style = this.style; + + rect = style.textRect || rect; + + // Optimize, avoid normalize every time. + this.__dirty && normalizeTextStyle(style, true); + + var text = style.text; + + // Convert to string + text != null && (text += ''); + + if (!needDrawText(text, style)) { + return; + } + + // FIXME + // Do not provide prevEl to `textHelper.renderText` for ctx prop cache, + // but use `ctx.save()` and `ctx.restore()`. Because the cache for rect + // text propably break the cache for its host elements. + ctx.save(); + + // Transform rect to view space + var transform = this.transform; + if (!style.transformText) { + if (transform) { + tmpRect$1.copy(rect); + tmpRect$1.applyTransform(transform); + rect = tmpRect$1; + } + } + else { + this.setTransform(ctx); + } + + // transformText and textRotation can not be used at the same time. + renderText(this, ctx, text, style, rect); + + ctx.restore(); + } +}; + +/** + * 可绘制的图形基类 + * Base class of all displayable graphic objects + * @module zrender/graphic/Displayable + */ + + +/** + * @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); + + 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, + + /** + * Render the element progressively when the value >= 0, + * usefull for large data. + * @type {boolean} + */ + progressive: false, + + /** + * @type {boolean} + */ + incremental: false, + /** + * Scale ratio for global scale. + * @type {boolean} + */ + globalScaleRatio: 1, + + beforeBrush: function (ctx) {}, + + afterBrush: function (ctx) {}, + + /** + * 图形绘制方法 + * @param {CanvasRenderingContext2D} ctx + */ + // Interface + brush: function (ctx, prevEl) {}, + + /** + * 获取最小包围盒 + * @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 = this.__dirtyText = 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; + }, + + /** + * Use given style object + * @param {Object} obj + */ + useStyle: function (obj) { + this.style = new Style(obj, this); + this.dirty(false); + return this; + } +}; + +inherits(Displayable, Element); + +mixin(Displayable, RectText); + +/** + * @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, prevEl) { + var style = this.style; + var src = style.image; + + // Must bind each time + style.bind(ctx, this, prevEl); + + var image = this._image = createOrUpdateImage( + src, + this._image, + this, + this.onload + ); + + if (!image || !isImageReady(image)) { + return; + } + + // 图片已经加载完成 + // if (image.nodeName.toUpperCase() == 'IMG') { + // if (!image.complete) { + // return; + // } + // } + // Else is canvas + + var x = style.x || 0; + var y = style.y || 0; + var width = style.width; + var height = style.height; + var aspect = image.width / image.height; + if (width == null && height != null) { + // Keep image/height ratio + width = height * aspect; + } + else if (height == null && width != null) { + height = width / aspect; + } + else if (width == null && height == null) { + width = image.width; + height = image.height; + } + + // 设置transform + this.setTransform(ctx); + + 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); + } + + // Draw rect text + if (style.text != null) { + // Only restore transform when needs draw text. + this.restoreTransform(ctx); + this.drawRectText(ctx, this.getBoundingRect()); + } + }, + + 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; + } +}; + +inherits(ZImage, Displayable); + +var HOVER_LAYER_ZLEVEL = 1e5; +var CANVAS_ZLEVEL = 314159; + +var EL_AFTER_INCREMENTAL_INC = 0.01; +var INCREMENTAL_INC = 0.001; + +function parseInt10(val) { + return parseInt(val, 10); +} + +function isLayerValid(layer) { + if (!layer) { + return false; + } + + if (layer.__builtin__) { + return true; + } + + if (typeof(layer.resize) !== 'function' + || typeof(layer.refresh) !== 'function' + ) { + return false; + } + + return true; +} + +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) { // Can both be null or undefined + return false; + } + + 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]; + + clipPath.setTransform(ctx); + ctx.beginPath(); + clipPath.buildPath(ctx, clipPath.shape); + ctx.clip(); + // Transform back + clipPath.restoreTransform(ctx); + } +} + +function createRoot(width, height) { + var domRoot = document.createElement('div'); + + // domRoot.onselectstart = returnFalse; // 避免页面选中的尴尬 + domRoot.style.cssText = [ + 'position:relative', + 'overflow:hidden', + 'width:' + width + 'px', + 'height:' + height + 'px', + 'padding:0', + 'margin:0', + 'border-width:0' + ].join(';') + ';'; + + return domRoot; +} + + +/** + * @alias module:zrender/Painter + * @constructor + * @param {HTMLElement} root 绘图容器 + * @param {module:zrender/Storage} storage + * @param {Object} opts + */ +var Painter = function (root, storage, opts) { + + this.type = 'canvas'; + + // In node environment using node-canvas + var singleCanvas = !root.nodeName // In node ? + || root.nodeName.toUpperCase() === 'CANVAS'; + + this._opts = opts = extend({}, opts || {}); + + /** + * @type {number} + */ + this.dpr = opts.devicePixelRatio || devicePixelRatio; + /** + * @type {boolean} + * @private + */ + this._singleCanvas = singleCanvas; + /** + * 绘图容器 + * @type {HTMLElement} + */ + this.root = root; + + var rootStyle = root.style; + + if (rootStyle) { + rootStyle['-webkit-tap-highlight-color'] = 'transparent'; + rootStyle['-webkit-user-select'] = + rootStyle['user-select'] = + rootStyle['-webkit-touch-callout'] = 'none'; + + root.innerHTML = ''; + } + + /** + * @type {module:zrender/Storage} + */ + this.storage = storage; + + /** + * @type {Array.} + * @private + */ + var zlevelList = this._zlevelList = []; + + /** + * @type {Object.} + * @private + */ + var layers = this._layers = {}; + + /** + * @type {Object.} + * @private + */ + this._layerConfig = {}; + + /** + * zrender will do compositing when root is a canvas and have multiple zlevels. + */ + this._needsManuallyCompositing = false; + + if (!singleCanvas) { + this._width = this._getSize(0); + this._height = this._getSize(1); + + var domRoot = this._domRoot = createRoot( + this._width, this._height + ); + root.appendChild(domRoot); + } + else { + var width = root.width; + var height = root.height; + + if (opts.width != null) { + width = opts.width; + } + if (opts.height != null) { + height = opts.height; + } + this.dpr = opts.devicePixelRatio || 1; + + // Use canvas width and height directly + root.width = width * this.dpr; + root.height = height * this.dpr; + + this._width = width; + this._height = height; + + // Create layer if only one given canvas + // Device can be specified to create a high dpi image. + var mainLayer = new Layer(root, this, this.dpr); + mainLayer.__builtin__ = true; + mainLayer.initContext(); + // FIXME Use canvas width and height + // mainLayer.resize(width, height); + layers[CANVAS_ZLEVEL] = mainLayer; + mainLayer.zlevel = CANVAS_ZLEVEL; + // Not use common zlevel. + zlevelList.push(CANVAS_ZLEVEL); + + this._domRoot = root; + } + + /** + * @type {module:zrender/Layer} + * @private + */ + this._hoverlayer = null; + + this._hoverElements = []; +}; + +Painter.prototype = { + + constructor: Painter, + + getType: function () { + return 'canvas'; + }, + + /** + * If painter use a single canvas + * @return {boolean} + */ + isSingleCanvas: function () { + return this._singleCanvas; + }, + /** + * @return {HTMLDivElement} + */ + getViewportRoot: function () { + return this._domRoot; + }, + + getViewportRootOffset: function () { + var viewportRoot = this.getViewportRoot(); + if (viewportRoot) { + return { + offsetLeft: viewportRoot.offsetLeft || 0, + offsetTop: viewportRoot.offsetTop || 0 + }; + } + }, + + /** + * 刷新 + * @param {boolean} [paintAll=false] 强制绘制所有displayable + */ + refresh: function (paintAll) { + + var list = this.storage.getDisplayList(true); + + var zlevelList = this._zlevelList; + + this._redrawId = Math.random(); + + this._paintList(list, paintAll, this._redrawId); + + // Paint custum layers + for (var i = 0; i < zlevelList.length; i++) { + var z = zlevelList[i]; + var layer = this._layers[z]; + if (!layer.__builtin__ && layer.refresh) { + var clearColor = i === 0 ? this._backgroundColor : null; + layer.refresh(clearColor); + } + } + + this.refreshHover(); + + return this; + }, + + addHover: function (el, hoverStyle) { + if (el.__hoverMir) { + return; + } + var elMirror = new el.constructor({ + style: el.style, + shape: el.shape, + z: el.z, + z2: el.z2, + silent: el.silent + }); + elMirror.__from = el; + el.__hoverMir = elMirror; + hoverStyle && elMirror.setStyle(hoverStyle); + this._hoverElements.push(elMirror); + + return elMirror; + }, + + removeHover: function (el) { + var elMirror = el.__hoverMir; + var hoverElements = this._hoverElements; + var idx = indexOf(hoverElements, elMirror); + if (idx >= 0) { + hoverElements.splice(idx, 1); + } + el.__hoverMir = null; + }, + + clearHover: function (el) { + var hoverElements = this._hoverElements; + for (var i = 0; i < hoverElements.length; i++) { + var from = hoverElements[i].__from; + if (from) { + from.__hoverMir = null; + } + } + hoverElements.length = 0; + }, + + refreshHover: function () { + var hoverElements = this._hoverElements; + var len = hoverElements.length; + var hoverLayer = this._hoverlayer; + hoverLayer && hoverLayer.clear(); + + if (!len) { + return; + } + sort(hoverElements, this.storage.displayableSortFunc); + + // Use a extream large zlevel + // FIXME? + if (!hoverLayer) { + hoverLayer = this._hoverlayer = this.getLayer(HOVER_LAYER_ZLEVEL); + } + + var scope = {}; + hoverLayer.ctx.save(); + for (var i = 0; i < len;) { + var el = hoverElements[i]; + var originalEl = el.__from; + // Original el is removed + // PENDING + if (!(originalEl && originalEl.__zr)) { + hoverElements.splice(i, 1); + originalEl.__hoverMir = null; + len--; + continue; + } + i++; + + // Use transform + // FIXME style and shape ? + if (!originalEl.invisible) { + el.transform = originalEl.transform; + el.invTransform = originalEl.invTransform; + el.__clipPaths = originalEl.__clipPaths; + // el. + this._doPaintEl(el, hoverLayer, true, scope); + } + } + + hoverLayer.ctx.restore(); + }, + + getHoverLayer: function () { + return this.getLayer(HOVER_LAYER_ZLEVEL); + }, + + _paintList: function (list, paintAll, redrawId) { + if (this._redrawId !== redrawId) { + return; + } + + paintAll = paintAll || false; + + this._updateLayerStatus(list); + + var finished = this._doPaintList(list, paintAll); + + if (this._needsManuallyCompositing) { + this._compositeManually(); + } + + if (!finished) { + var self = this; + requestAnimationFrame(function () { + self._paintList(list, paintAll, redrawId); + }); + } + }, + + _compositeManually: function () { + var ctx = this.getLayer(CANVAS_ZLEVEL).ctx; + var width = this._domRoot.width; + var height = this._domRoot.height; + ctx.clearRect(0, 0, width, height); + // PENDING, If only builtin layer? + this.eachBuiltinLayer(function (layer) { + if (layer.virtual) { + ctx.drawImage(layer.dom, 0, 0, width, height); + } + }); + }, + + _doPaintList: function (list, paintAll) { + var layerList = []; + for (var zi = 0; zi < this._zlevelList.length; zi++) { + var zlevel = this._zlevelList[zi]; + var layer = this._layers[zlevel]; + if (layer.__builtin__ + && layer !== this._hoverlayer + && (layer.__dirty || paintAll) + ) { + layerList.push(layer); + } + } + + var finished = true; + + for (var k = 0; k < layerList.length; k++) { + var layer = layerList[k]; + var ctx = layer.ctx; + var scope = {}; + ctx.save(); + + var start = paintAll ? layer.__startIndex : layer.__drawIndex; + + var useTimer = !paintAll && layer.incremental && Date.now; + var startTime = useTimer && Date.now(); + + var clearColor = layer.zlevel === this._zlevelList[0] + ? this._backgroundColor : null; + // All elements in this layer are cleared. + if (layer.__startIndex === layer.__endIndex) { + layer.clear(false, clearColor); + } + else if (start === layer.__startIndex) { + var firstEl = list[start]; + if (!firstEl.incremental || !firstEl.notClear || paintAll) { + layer.clear(false, clearColor); + } + } + if (start === -1) { + console.error('For some unknown reason. drawIndex is -1'); + start = layer.__startIndex; + } + for (var i = start; i < layer.__endIndex; i++) { + var el = list[i]; + this._doPaintEl(el, layer, paintAll, scope); + el.__dirty = el.__dirtyText = false; + + if (useTimer) { + // Date.now can be executed in 13,025,305 ops/second. + var dTime = Date.now() - startTime; + // Give 15 millisecond to draw. + // The rest elements will be drawn in the next frame. + if (dTime > 15) { + break; + } + } + } + + layer.__drawIndex = i; + + if (layer.__drawIndex < layer.__endIndex) { + finished = false; + } + + if (scope.prevElClipPaths) { + // Needs restore the state. If last drawn element is in the clipping area. + ctx.restore(); + } + + ctx.restore(); + } + + if (env$1.wxa) { + // Flush for weixin application + each$1(this._layers, function (layer) { + if (layer && layer.ctx && layer.ctx.draw) { + layer.ctx.draw(); + } + }); + } + + return finished; + }, + + _doPaintEl: function (el, currentLayer, forcePaint, scope) { + var ctx = currentLayer.ctx; + var m = el.transform; + if ( + (currentLayer.__dirty || forcePaint) + // 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 + // And setTransform with scale 0 will cause set back transform failed. + && !(m && !m[0] && !m[3]) + // Ignore culled element + && !(el.culling && isDisplayableCulled(el, this._width, this._height)) + ) { + + var clipPaths = el.__clipPaths; + + // Optimize when clipping on group with several elements + if (!scope.prevElClipPaths + || isClipPathChanged(clipPaths, scope.prevElClipPaths) + ) { + // If has previous clipping state, restore from it + if (scope.prevElClipPaths) { + currentLayer.ctx.restore(); + scope.prevElClipPaths = null; + + // Reset prevEl since context has been restored + scope.prevEl = null; + } + // New clipping state + if (clipPaths) { + ctx.save(); + doClip(clipPaths, ctx); + scope.prevElClipPaths = clipPaths; + } + } + el.beforeBrush && el.beforeBrush(ctx); + + el.brush(ctx, scope.prevEl || null); + scope.prevEl = el; + + el.afterBrush && el.afterBrush(ctx); + } + }, + + /** + * 获取 zlevel 所在层,如果不存在则会创建一个新的层 + * @param {number} zlevel + * @param {boolean} virtual Virtual layer will not be inserted into dom. + * @return {module:zrender/Layer} + */ + getLayer: function (zlevel, virtual) { + if (this._singleCanvas && !this._needsManuallyCompositing) { + zlevel = CANVAS_ZLEVEL; + } + var layer = this._layers[zlevel]; + if (!layer) { + // Create a new layer + layer = new Layer('zr_' + zlevel, this, this.dpr); + layer.zlevel = zlevel; + layer.__builtin__ = true; + + if (this._layerConfig[zlevel]) { + merge(layer, this._layerConfig[zlevel], true); + } + + if (virtual) { + layer.virtual = virtual; + } + + 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]) { + zrLog('ZLevel ' + zlevel + ' has been used already'); + return; + } + // Check if is a valid layer + if (!isLayerValid(layer)) { + zrLog('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); + + layersMap[zlevel] = layer; + + // Vitual layer will not directly show on the screen. + // (It can be a WebGL layer and assigned to a ZImage element) + // But it still under management of zrender. + if (!layer.virtual) { + 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); + } + } + } + }, + + // 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 + eachBuiltinLayer: 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.__builtin__) { + 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.__builtin__) { + cb.call(context, layer, z); + } + } + }, + + /** + * 获取所有已创建的层 + * @param {Array.} [prevLayer] + */ + getLayers: function () { + return this._layers; + }, + + _updateLayerStatus: function (list) { + + this.eachBuiltinLayer(function (layer, z) { + layer.__dirty = layer.__used = false; + }); + + function updatePrevLayer(idx) { + if (prevLayer) { + if (prevLayer.__endIndex !== idx) { + prevLayer.__dirty = true; + } + prevLayer.__endIndex = idx; + } + } + + if (this._singleCanvas) { + for (var i = 1; i < list.length; i++) { + var el = list[i]; + if (el.zlevel !== list[i - 1].zlevel || el.incremental) { + this._needsManuallyCompositing = true; + break; + } + } + } + + var prevLayer = null; + var incrementalLayerCount = 0; + for (var i = 0; i < list.length; i++) { + var el = list[i]; + var zlevel = el.zlevel; + var layer; + // PENDING If change one incremental element style ? + // TODO Where there are non-incremental elements between incremental elements. + if (el.incremental) { + layer = this.getLayer(zlevel + INCREMENTAL_INC, this._needsManuallyCompositing); + layer.incremental = true; + incrementalLayerCount = 1; + } + else { + layer = this.getLayer(zlevel + (incrementalLayerCount > 0 ? EL_AFTER_INCREMENTAL_INC : 0), this._needsManuallyCompositing); + } + + if (!layer.__builtin__) { + zrLog('ZLevel ' + zlevel + ' has been used by unkown layer ' + layer.id); + } + + if (layer !== prevLayer) { + layer.__used = true; + if (layer.__startIndex !== i) { + layer.__dirty = true; + } + layer.__startIndex = i; + if (!layer.incremental) { + layer.__drawIndex = i; + } + else { + // Mark layer draw index needs to update. + layer.__drawIndex = -1; + } + updatePrevLayer(i); + prevLayer = layer; + } + if (el.__dirty) { + layer.__dirty = true; + if (layer.incremental && layer.__drawIndex < 0) { + // Start draw from the first dirty element. + layer.__drawIndex = i; + } + } + } + + updatePrevLayer(i); + + this.eachBuiltinLayer(function (layer, z) { + // Used in last frame but not in this frame. Needs clear + if (!layer.__used && layer.getElementCount() > 0) { + layer.__dirty = true; + layer.__startIndex = layer.__endIndex = layer.__drawIndex = 0; + } + // For incremental layer. In case start index changed and no elements are dirty. + if (layer.__dirty && layer.__drawIndex < 0) { + layer.__drawIndex = layer.__startIndex; + } + }); + }, + + /** + * 清除hover层外所有内容 + */ + clear: function () { + this.eachBuiltinLayer(this._clearLayer); + return this; + }, + + _clearLayer: function (layer) { + layer.clear(); + }, + + setBackgroundColor: function (backgroundColor) { + this._backgroundColor = backgroundColor; + }, + + /** + * 修改指定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 { + merge(layerConfig[zlevel], config, true); + } + + for (var i = 0; i < this._zlevelList.length; i++) { + var _zlevel = this._zlevelList[i]; + if (_zlevel === zlevel || _zlevel === zlevel + EL_AFTER_INCREMENTAL_INC) { + var layer = this._layers[_zlevel]; + 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(indexOf(zlevelList, zlevel), 1); + }, + + /** + * 区域大小变化后重绘 + */ + resize: function (width, height) { + if (!this._domRoot.style) { // Maybe in node or worker + if (width == null || height == null) { + return; + } + this._width = width; + this._height = height; + + this.getLayer(CANVAS_ZLEVEL).resize(width, height); + } + else { + var domRoot = this._domRoot; + // FIXME Why ? + domRoot.style.display = 'none'; + + // Save input w/h + var opts = this._opts; + width != null && (opts.width = width); + height != null && (opts.height = height); + + width = this._getSize(0); + height = this._getSize(1); + + 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) { + if (this._layers.hasOwnProperty(id)) { + this._layers[id].resize(width, height); + } + } + each$1(this._progressiveLayers, function (layer) { + layer.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] + * @param {number} [opts.pixelRatio] + */ + getRenderedCanvas: function (opts) { + opts = opts || {}; + if (this._singleCanvas && !this._compositeManually) { + return this._layers[CANVAS_ZLEVEL].dom; + } + + var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr); + imageLayer.initContext(); + imageLayer.clear(false, opts.backgroundColor || this._backgroundColor); + + if (opts.pixelRatio <= this.dpr) { + this.refresh(); + + var width = imageLayer.dom.width; + var height = imageLayer.dom.height; + var ctx = imageLayer.ctx; + this.eachLayer(function (layer) { + if (layer.__builtin__) { + ctx.drawImage(layer.dom, 0, 0, width, height); + } + else if (layer.renderToCanvas) { + imageLayer.ctx.save(); + layer.renderToCanvas(imageLayer.ctx); + imageLayer.ctx.restore(); + } + }); + } + else { + // PENDING, echarts-gl and incremental rendering. + var scope = {}; + var displayList = this.storage.getDisplayList(true); + for (var i = 0; i < displayList.length; i++) { + var el = displayList[i]; + this._doPaintEl(el, imageLayer, true, scope); + } + } + + return imageLayer.dom; + }, + /** + * 获取绘图区域宽度 + */ + getWidth: function () { + return this._width; + }, + + /** + * 获取绘图区域高度 + */ + getHeight: function () { + return this._height; + }, + + _getSize: function (whIdx) { + var opts = this._opts; + var wh = ['width', 'height'][whIdx]; + var cwh = ['clientWidth', 'clientHeight'][whIdx]; + var plt = ['paddingLeft', 'paddingTop'][whIdx]; + var prb = ['paddingRight', 'paddingBottom'][whIdx]; + + if (opts[wh] != null && opts[wh] !== 'auto') { + return parseFloat(opts[wh]); + } + + var root = this.root; + // IE8 does not support getComputedStyle, but it use VML. + var stl = document.defaultView.getComputedStyle(root); + + return ( + (root[cwh] || parseInt10(stl[wh]) || parseInt10(root.style[wh])) + - (parseInt10(stl[plt]) || 0) + - (parseInt10(stl[prb]) || 0) + ) | 0; + }, + + pathToImage: function (path, dpr) { + dpr = dpr || this.dpr; + + var canvas = document.createElement('canvas'); + var ctx = canvas.getContext('2d'); + var rect = path.getBoundingRect(); + var style = path.style; + var shadowBlurSize = style.shadowBlur * dpr; + var shadowOffsetX = style.shadowOffsetX * dpr; + var shadowOffsetY = style.shadowOffsetY * dpr; + var lineWidth = style.hasStroke() ? style.lineWidth : 0; + + var leftMargin = Math.max(lineWidth / 2, -shadowOffsetX + shadowBlurSize); + var rightMargin = Math.max(lineWidth / 2, shadowOffsetX + shadowBlurSize); + var topMargin = Math.max(lineWidth / 2, -shadowOffsetY + shadowBlurSize); + var bottomMargin = Math.max(lineWidth / 2, shadowOffsetY + shadowBlurSize); + var width = rect.width + leftMargin + rightMargin; + var height = rect.height + topMargin + bottomMargin; + + canvas.width = width * dpr; + canvas.height = height * dpr; + + ctx.scale(dpr, dpr); + ctx.clearRect(0, 0, width, height); + ctx.dpr = dpr; + + var pathTransform = { + position: path.position, + rotation: path.rotation, + scale: path.scale + }; + path.position = [leftMargin - rect.x, topMargin - rect.y]; + path.rotation = 0; + path.scale = [1, 1]; + path.updateTransform(); + if (path) { + path.brush(ctx); + } + + var ImageShape = ZImage; + var imgShape = new ImageShape({ + 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; + } +}; + +/** + * 动画主类, 调度和管理所有动画控制器 + * + * @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 + +/** + * @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; + + this._pausedTime; + + this._pauseStart; + + this._paused = false; + + Eventful.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 = 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() - this._pausedTime; + 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, delta); + // 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); + + // 'frame' should be triggered before stage, because upper application + // depends on the sequence (e.g., echarts-stream and finish + // event judge) + this.trigger('frame', delta); + + if (this.stage.update) { + this.stage.update(); + } + }, + + _startLoop: function () { + var self = this; + + this._running = true; + + function step() { + if (self._running) { + + requestAnimationFrame(step); + + !self._paused && self._update(); + } + } + + requestAnimationFrame(step); + }, + + /** + * Start animation. + */ + start: function () { + + this._time = new Date().getTime(); + this._pausedTime = 0; + + this._startLoop(); + }, + + /** + * Stop animation. + */ + stop: function () { + this._running = false; + }, + + /** + * Pause animation. + */ + pause: function () { + if (!this._paused) { + this._pauseStart = new Date().getTime(); + this._paused = true; + } + }, + + /** + * Resume animation. + */ + resume: function () { + if (this._paused) { + this._pausedTime += (new Date().getTime()) - this._pauseStart; + this._paused = false; + } + }, + + /** + * Clear animation. + */ + clear: function () { + this._clips = []; + }, + + /** + * Whether animation finished. + */ + isFinished: function () { + return !this._clips.length; + }, + + /** + * Creat animator for a target, whose props can be animated. + * + * @param {Object} target + * @param {Object} options + * @param {boolean} [options.loop=false] Whether loop animation. + * @param {Function} [options.getter=null] Get value from target. + * @param {Function} [options.setter=null] Set value to target. + * @return {module:zrender/animation/Animation~Animator} + */ + // TODO Gap + animate: function (target, options) { + options = options || {}; + + var animator = new Animator( + target, + options.loop, + options.getter, + options.setter + ); + + this.addAnimator(animator); + + return animator; + } +}; + +mixin(Animation, Eventful); + +/** + * Only implements needed gestures for mobile. + */ + +var GestureMgr = function () { + + /** + * @private + * @type {Array.} + */ + this._track = []; +}; + +GestureMgr.prototype = { + + constructor: GestureMgr, + + recognize: function (event, target, root) { + this._doTrack(event, target, root); + return this._recognize(event); + }, + + clear: function () { + this._track.length = 0; + return this; + }, + + _doTrack: function (event, target, root) { + 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]; + var pos = clientToLocal(root, touch, {}); + trackItem.points.push([pos.zrX, pos.zrY]); + 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$1(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$1(pinchEnd) / dist$1(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. +}; + +var TOUCH_CLICK_DELAY = 300; + +var mouseHandlerNames = [ + 'click', 'dblclick', 'mousewheel', 'mouseout', + 'mouseup', 'mousedown', 'mousemove', 'contextmenu' +]; + +var touchHandlerNames = [ + 'touchstart', 'touchend', 'touchmove' +]; + +var pointerEventNames = { + pointerdown: 1, pointerup: 1, pointermove: 1, pointerout: 1 +}; + +var pointerHandlerNames = map(mouseHandlerNames, function (name) { + var nm = name.replace('mouse', 'pointer'); + return pointerEventNames[nm] ? nm : name; +}); + +function eventNameFix(name) { + return (name === 'mousewheel' && env$1.browser.firefox) ? 'DOMMouseScroll' : name; +} + +function processGesture(proxy, event, stage) { + var gestureMgr = proxy._gestureMgr; + + stage === 'start' && gestureMgr.clear(); + + var gestureInfo = gestureMgr.recognize( + event, + proxy.handler.findHover(event.zrX, event.zrY, null).target, + proxy.dom + ); + + stage === 'end' && gestureMgr.clear(); + + // Do not do any preventDefault here. Upper application do that if necessary. + if (gestureInfo) { + var type = gestureInfo.type; + event.gestureEvent = type; + + proxy.handler.dispatchToElement({target: gestureInfo.target}, type, gestureInfo.event); + } +} + +// function onMSGestureChange(proxy, event) { +// if (event.translationX || event.translationY) { +// // mousemove is carried by MSGesture to reduce the sensitivity. +// proxy.handler.dispatchToElement(event.target, 'mousemove', event); +// } +// if (event.scale !== 1) { +// event.pinchX = event.offsetX; +// event.pinchY = event.offsetY; +// event.pinchScale = event.scale; +// proxy.handler.dispatchToElement(event.target, 'pinch', event); +// } +// } + +/** + * Prevent mouse event from being dispatched after Touch Events action + * @see + * 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); +} + + +var domHandlers = { + /** + * Mouse move handler + * @inner + * @param {Event} event + */ + mousemove: function (event) { + event = normalizeEvent(this.dom, event); + + this.trigger('mousemove', event); + }, + + /** + * Mouse out handler + * @inner + * @param {Event} event + */ + mouseout: function (event) { + event = normalizeEvent(this.dom, event); + + var element = event.toElement || event.relatedTarget; + if (element != this.dom) { + while (element && element.nodeType != 9) { + // 忽略包含在root中的dom引起的mouseOut + if (element === this.dom) { + return; + } + + element = element.parentNode; + } + } + + this.trigger('mouseout', event); + }, + + /** + * Touch开始响应函数 + * @inner + * @param {Event} event + */ + touchstart: function (event) { + // Default mouse behaviour should not be disabled here. + // For example, page may needs to be slided. + event = normalizeEvent(this.dom, event); + + // Mark touch, which is useful in distinguish touch and + // mouse event in upper applicatoin. + event.zrByTouch = true; + + this._lastTouchMoment = new Date(); + + processGesture(this, event, 'start'); + + // In touch device, trigger `mousemove`(`mouseover`) should + // be triggered, and must before `mousedown` triggered. + domHandlers.mousemove.call(this, event); + + domHandlers.mousedown.call(this, event); + + setTouchTimer(this); + }, + + /** + * Touch移动响应函数 + * @inner + * @param {Event} event + */ + touchmove: function (event) { + + event = normalizeEvent(this.dom, event); + + // Mark touch, which is useful in distinguish touch and + // mouse event in upper applicatoin. + event.zrByTouch = true; + + 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) { + + event = normalizeEvent(this.dom, event); + + // Mark touch, which is useful in distinguish touch and + // mouse event in upper applicatoin. + event.zrByTouch = true; + + processGesture(this, event, 'end'); + + domHandlers.mouseup.call(this, event); + + // Do not trigger `mouseout` here, in spite of `mousemove`(`mouseover`) is + // triggered in `touchstart`. This seems to be illogical, but by this mechanism, + // we can conveniently implement "hover style" in both PC and touch device just + // by listening to `mouseover` to add "hover style" and listening to `mouseout` + // to remove "hover style" on an element, without any additional code for + // compatibility. (`mouseout` will not be triggered in `touchend`, so "hover + // style" will remain for user view) + + // 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) { + domHandlers.click.call(this, event); + } + + setTouchTimer(this); + }, + + pointerdown: function (event) { + domHandlers.mousedown.call(this, event); + + // if (useMSGuesture(this, event)) { + // this._msGesture.addPointer(event.pointerId); + // } + }, + + pointermove: function (event) { + // FIXME + // pointermove is so sensitive that it always triggered when + // tap(click) on touch screen, which affect some judgement in + // upper application. So, we dont support mousemove on MS touch + // device yet. + if (!isPointerFromTouch(event)) { + domHandlers.mousemove.call(this, event); + } + }, + + pointerup: function (event) { + domHandlers.mouseup.call(this, event); + }, + + pointerout: function (event) { + // pointerout will be triggered when tap on touch screen + // (IE11+/Edge on MS Surface) after click event triggered, + // which is inconsistent with the mousout behavior we defined + // in touchend. So we unify them. + // (check domHandlers.touchend for detailed explanation) + if (!isPointerFromTouch(event)) { + domHandlers.mouseout.call(this, event); + } + } +}; + +function isPointerFromTouch(event) { + var pointerType = event.pointerType; + return pointerType === 'pen' || pointerType === 'touch'; +} + +// function useMSGuesture(handlerProxy, event) { +// return isPointerFromTouch(event) && !!handlerProxy._msGesture; +// } + +// Common handlers +each$1(['click', 'mousedown', 'mouseup', 'mousewheel', 'dblclick', 'contextmenu'], function (name) { + domHandlers[name] = function (event) { + event = normalizeEvent(this.dom, event); + this.trigger(name, event); + }; +}); + +/** + * 为控制类实例初始化dom 事件处理函数 + * + * @inner + * @param {module:zrender/Handler} instance 控制类实例 + */ +function initDomHandler(instance) { + each$1(touchHandlerNames, function (name) { + instance._handlers[name] = bind(domHandlers[name], instance); + }); + + each$1(pointerHandlerNames, function (name) { + instance._handlers[name] = bind(domHandlers[name], instance); + }); + + each$1(mouseHandlerNames, function (name) { + instance._handlers[name] = makeMouseHandler(domHandlers[name], instance); + }); + + function makeMouseHandler(fn, instance) { + return function () { + if (instance._touching) { + return; + } + return fn.apply(instance, arguments); + }; + } +} + + +function HandlerDomProxy(dom) { + Eventful.call(this); + + this.dom = dom; + + /** + * @private + * @type {boolean} + */ + this._touching = false; + + /** + * @private + * @type {number} + */ + this._touchTimer; + + /** + * @private + * @type {module:zrender/core/GestureMgr} + */ + this._gestureMgr = new GestureMgr(); + + this._handlers = {}; + + initDomHandler(this); + + if (env$1.pointerEventsSupported) { // Only IE11+/Edge + // 1. On devices that both enable touch and mouse (e.g., MS Surface and lenovo X240), + // IE11+/Edge do not trigger touch event, but trigger pointer event and mouse event + // at the same time. + // 2. On MS Surface, it probablely only trigger mousedown but no mouseup when tap on + // screen, which do not occurs in pointer event. + // So we use pointer event to both detect touch gesture and mouse behavior. + mountHandlers(pointerHandlerNames, this); + + // FIXME + // Note: MS Gesture require CSS touch-action set. But touch-action is not reliable, + // which does not prevent defuault behavior occasionally (which may cause view port + // zoomed in but use can not zoom it back). And event.preventDefault() does not work. + // So we have to not to use MSGesture and not to support touchmove and pinch on MS + // touch screen. And we only support click behavior on MS touch screen now. + + // MS Gesture Event is only supported on IE11+/Edge and on Windows 8+. + // We dont support touch on IE on win7. + // See + // if (typeof MSGesture === 'function') { + // (this._msGesture = new MSGesture()).target = dom; // jshint ignore:line + // dom.addEventListener('MSGestureChange', onMSGestureChange); + // } + } + else { + if (env$1.touchEventsSupported) { + mountHandlers(touchHandlerNames, this); + // Handler of 'mouseout' event is needed in touch mode, which will be mounted below. + // addEventListener(root, 'mouseout', this._mouseoutHandler); + } + + // 1. Considering some devices that both enable touch and mouse event (like on MS Surface + // and lenovo X240, @see #2350), we make mouse event be always listened, otherwise + // mouse event can not be handle in those devices. + // 2. On MS Surface, Chrome will trigger both touch event and mouse event. How to prevent + // mouseevent after touch event triggered, see `setTouchTimer`. + mountHandlers(mouseHandlerNames, this); + } + + function mountHandlers(handlerNames, instance) { + each$1(handlerNames, function (name) { + addEventListener(dom, eventNameFix(name), instance._handlers[name]); + }, instance); + } +} + +var handlerDomProxyProto = HandlerDomProxy.prototype; +handlerDomProxyProto.dispose = function () { + var handlerNames = mouseHandlerNames.concat(touchHandlerNames); + + for (var i = 0; i < handlerNames.length; i++) { + var name = handlerNames[i]; + removeEventListener(this.dom, eventNameFix(name), this._handlers[name]); + } +}; + +handlerDomProxyProto.setCursor = function (cursorStyle) { + this.dom.style && (this.dom.style.cursor = cursorStyle || 'default'); +}; + +mixin(HandlerDomProxy, Eventful); + +/*! +* 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 +*/ + +var useVML = !env$1.canvasSupported; + +var painterCtors = { + canvas: Painter +}; + +var instances$1 = {}; // ZRender实例map索引 + +/** + * @type {string} + */ +var version$1 = '4.0.4'; + +/** + * Initializing a zrender instance + * @param {HTMLElement} dom + * @param {Object} opts + * @param {string} [opts.renderer='canvas'] 'canvas' or 'svg' + * @param {number} [opts.devicePixelRatio] + * @param {number|string} [opts.width] Can be 'auto' (the same as null/undefined) + * @param {number|string} [opts.height] Can be 'auto' (the same as null/undefined) + * @return {module:zrender/ZRender} + */ +function init$1(dom, opts) { + var zr = new ZRender(guid(), dom, opts); + instances$1[zr.id] = zr; + return zr; +} + +/** + * Dispose zrender instance + * @param {module:zrender/ZRender} zr + */ +function dispose$1(zr) { + if (zr) { + zr.dispose(); + } + else { + for (var key in instances$1) { + if (instances$1.hasOwnProperty(key)) { + instances$1[key].dispose(); + } + } + instances$1 = {}; + } + + return this; +} + +/** + * Get zrender instance by id + * @param {string} id zrender instance id + * @return {module:zrender/ZRender} + */ +function getInstance(id) { + return instances$1[id]; +} + +function registerPainter(name, Ctor) { + painterCtors[name] = Ctor; +} + +function delInstance(id) { + delete instances$1[id]; +} + +/** + * @module zrender/ZRender + */ +/** + * @constructor + * @alias module:zrender/ZRender + * @param {string} id + * @param {HTMLElement} dom + * @param {Object} opts + * @param {string} [opts.renderer='canvas'] 'canvas' or 'svg' + * @param {number} [opts.devicePixelRatio] + * @param {number} [opts.width] Can be 'auto' (the same as null/undefined) + * @param {number} [opts.height] Can be 'auto' (the same as null/undefined) + */ +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; + // TODO WebGL + 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, id); + + this.storage = storage; + this.painter = painter; + + var handerProxy = (!env$1.node && !env$1.worker) ? new HandlerDomProxy(painter.getViewportRoot()) : null; + this.handler = new Handler(storage, painter, handerProxy, painter.root); + + /** + * @type {module:zrender/animation/Animation} + */ + this.animation = new Animation({ + stage: { + update: bind(this.flush, this) + } + }); + this.animation.start(); + + /** + * @type {boolean} + * @private + */ + this._needsRefresh; + + // 修改 storage.delFromStorage, 每次删除元素之前删除动画 + // FIXME 有点ugly + var oldDelFromStorage = storage.delFromStorage; + var oldAddToStorage = storage.addToStorage; + + storage.delFromStorage = function (el) { + oldDelFromStorage.call(storage, el); + + el && el.removeSelfFromZr(self); + }; + + storage.addToStorage = function (el) { + oldAddToStorage.call(storage, el); + + el.addSelfToZr(self); + }; +}; + +ZRender.prototype = { + + constructor: ZRender, + /** + * 获取实例唯一标识 + * @return {string} + */ + getId: function () { + return this.id; + }, + + /** + * 添加元素 + * @param {module:zrender/Element} el + */ + add: function (el) { + this.storage.addRoot(el); + this._needsRefresh = true; + }, + + /** + * 删除元素 + * @param {module:zrender/Element} el + */ + remove: function (el) { + this.storage.delRoot(el); + this._needsRefresh = true; + }, + + /** + * Change configuration of layer + * @param {string} zLevel + * @param {Object} config + * @param {string} [config.clearColor=0] Clear color + * @param {string} [config.motionBlur=false] If enable motion blur + * @param {number} [config.lastFrameAlpha=0.7] Motion blur factor. Larger value cause longer trailer + */ + configLayer: function (zLevel, config) { + if (this.painter.configLayer) { + this.painter.configLayer(zLevel, config); + } + this._needsRefresh = true; + }, + + /** + * Set background color + * @param {string} backgroundColor + */ + setBackgroundColor: function (backgroundColor) { + if (this.painter.setBackgroundColor) { + this.painter.setBackgroundColor(backgroundColor); + } + this._needsRefresh = true; + }, + + /** + * Repaint the canvas immediately + */ + refreshImmediately: function () { + // var start = new Date(); + // 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; + // var end = new Date(); + // var log = document.getElementById('log'); + // if (log) { + // log.innerHTML = log.innerHTML + '
' + (end - start); + // } + }, + + /** + * Mark and repaint the canvas in the next frame of browser + */ + refresh: function() { + this._needsRefresh = true; + }, + + /** + * Perform all refresh + */ + flush: function () { + var triggerRendered; + + if (this._needsRefresh) { + triggerRendered = true; + this.refreshImmediately(); + } + if (this._needsRefreshHover) { + triggerRendered = true; + this.refreshHoverImmediately(); + } + + triggerRendered && this.trigger('rendered'); + }, + + /** + * Add element to hover layer + * @param {module:zrender/Element} el + * @param {Object} style + */ + addHover: function (el, style) { + if (this.painter.addHover) { + var elMirror = this.painter.addHover(el, style); + this.refreshHover(); + return elMirror; + } + }, + + /** + * Add element from hover layer + * @param {module:zrender/Element} el + */ + removeHover: function (el) { + if (this.painter.removeHover) { + this.painter.removeHover(el); + this.refreshHover(); + } + }, + + /** + * Clear all hover elements in hover layer + * @param {module:zrender/Element} el + */ + clearHover: function () { + if (this.painter.clearHover) { + this.painter.clearHover(); + this.refreshHover(); + } + }, + + /** + * Refresh hover in next frame + */ + refreshHover: function () { + this._needsRefreshHover = true; + }, + + /** + * Refresh hover immediately + */ + refreshHoverImmediately: function () { + this._needsRefreshHover = false; + this.painter.refreshHover && this.painter.refreshHover(); + }, + + /** + * Resize the canvas. + * Should be invoked when container size is changed + * @param {Object} [opts] + * @param {number|string} [opts.width] Can be 'auto' (the same as null/undefined) + * @param {number|string} [opts.height] Can be 'auto' (the same as null/undefined) + */ + resize: function(opts) { + opts = opts || {}; + this.painter.resize(opts.width, opts.height); + this.handler.resize(); + }, + + /** + * Stop and clear all animation immediately + */ + clearAnimation: function () { + this.animation.clear(); + }, + + /** + * Get container width + */ + getWidth: function() { + return this.painter.getWidth(); + }, + + /** + * Get container height + */ + getHeight: function() { + return this.painter.getHeight(); + }, + + /** + * Export the canvas as Base64 URL + * @param {string} type + * @param {string} [backgroundColor='#fff'] + * @return {string} Base64 URL + */ + // toDataURL: function(type, backgroundColor) { + // return this.painter.getRenderedCanvas({ + // backgroundColor: backgroundColor + // }).toDataURL(type); + // }, + + /** + * Converting a path to image. + * It has much better performance of drawing image rather than drawing a vector path. + * @param {module:zrender/graphic/Path} e + * @param {number} width + * @param {number} height + */ + pathToImage: function(e, dpr) { + return this.painter.pathToImage(e, dpr); + }, + + /** + * Set default cursor + * @param {string} [cursorStyle='default'] 例如 crosshair + */ + setCursorStyle: function (cursorStyle) { + this.handler.setCursorStyle(cursorStyle); + }, + + /** + * Find hovered element + * @param {number} x + * @param {number} y + * @return {Object} {target, topTarget} + */ + findHover: function (x, y) { + return this.handler.findHover(x, y); + }, + + /** + * Bind event + * + * @param {string} eventName Event name + * @param {Function} eventHandler Handler function + * @param {Object} [context] Context object + */ + on: function(eventName, eventHandler, context) { + this.handler.on(eventName, eventHandler, context); + }, + + /** + * Unbind event + * @param {string} eventName Event name + * @param {Function} [eventHandler] Handler function + */ + off: function(eventName, eventHandler) { + this.handler.off(eventName, eventHandler); + }, + + /** + * Trigger event manually + * + * @param {string} eventName Event name + * @param {event=} event Event object + */ + trigger: function (eventName, event) { + this.handler.trigger(eventName, event); + }, + + + /** + * Clear all objects and the canvas. + */ + clear: function () { + this.storage.delRoot(); + this.painter.clear(); + }, + + /** + * Dispose self. + */ + dispose: function () { + this.animation.stop(); + + this.clear(); + this.storage.dispose(); + this.painter.dispose(); + this.handler.dispose(); + + this.animation = + this.storage = + this.painter = + this.handler = null; + + delInstance(this.id); + } +}; + + + +var zrender = (Object.freeze || Object)({ + version: version$1, + init: init$1, + dispose: dispose$1, + getInstance: getInstance, + registerPainter: registerPainter +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$2 = each$1; +var isObject$2 = isObject$1; +var isArray$1 = isArray; + +/** + * Make the name displayable. But we should + * make sure it is not duplicated with user + * specified name, so use '\0'; + */ +var DUMMY_COMPONENT_NAME_PREFIX = 'series\0'; + +/** + * If value is not array, then translate it to array. + * @param {*} value + * @return {Array} [value] or value + */ +function normalizeToArray(value) { + return value instanceof Array + ? value + : value == null + ? [] + : [value]; +} + +/** + * Sync default option between normal and emphasis like `position` and `show` + * In case some one will write code like + * label: { + * show: false, + * position: 'outside', + * fontSize: 18 + * }, + * emphasis: { + * label: { show: true } + * } + * @param {Object} opt + * @param {string} key + * @param {Array.} subOpts + */ +function defaultEmphasis(opt, key, subOpts) { + // Caution: performance sensitive. + if (opt) { + opt[key] = opt[key] || {}; + opt.emphasis = opt.emphasis || {}; + opt.emphasis[key] = opt.emphasis[key] || {}; + + // Default emphasis option from normal + for (var i = 0, len = subOpts.length; i < len; i++) { + var subOptName = subOpts[i]; + if (!opt.emphasis[key].hasOwnProperty(subOptName) + && opt[key].hasOwnProperty(subOptName) + ) { + opt.emphasis[key][subOptName] = opt[key][subOptName]; + } + } + } +} + +var TEXT_STYLE_OPTIONS = [ + 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily', + 'rich', 'tag', 'color', 'textBorderColor', 'textBorderWidth', + 'width', 'height', 'lineHeight', 'align', 'verticalAlign', 'baseline', + 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY', + 'textShadowColor', 'textShadowBlur', 'textShadowOffsetX', 'textShadowOffsetY', + 'backgroundColor', 'borderColor', 'borderWidth', 'borderRadius', 'padding' +]; + +// modelUtil.LABEL_OPTIONS = modelUtil.TEXT_STYLE_OPTIONS.concat([ +// 'position', 'offset', 'rotate', 'origin', 'show', 'distance', 'formatter', +// 'fontStyle', 'fontWeight', 'fontSize', 'fontFamily', +// // FIXME: deprecated, check and remove it. +// 'textStyle' +// ]); + +/** + * The method do not ensure performance. + * 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.} + */ +function getDataItemValue(dataItem) { + return (isObject$2(dataItem) && !isArray$1(dataItem) && !(dataItem instanceof Date)) + ? dataItem.value : dataItem; +} + +/** + * data could be [12, 2323, {value: 223}, [1221, 23], {value: [2, 23]}] + * This helper method determine if dataItem has extra option besides value + * @param {string|number|Date|Array|Object} dataItem + */ +function isDataItemOption(dataItem) { + return isObject$2(dataItem) + && !(dataItem instanceof Array); + // // markLine data can be array + // && !(dataItem[0] && isObject(dataItem[0]) && !(dataItem[0] instanceof Array)); +} + +/** + * Mapping to exists for merge. + * + * @public + * @param {Array.|Array.} exists + * @param {Object|Array.} newCptOptions + * @return {Array.} Result, like [{exist: ..., option: ...}, {}], + * index of which is the same as exists. + */ +function mappingToExists(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 = map(exists || [], function (obj, index) { + return {exist: obj}; + }); + + // Mapping by id or name if specified. + each$2(newCptOptions, function (cptOption, index) { + if (!isObject$2(cptOption)) { + return; + } + + // id has highest priority. + for (var i = 0; i < result.length; i++) { + if (!result[i].option // Consider name: two map to one. + && cptOption.id != null + && result[i].exist.id === cptOption.id + '' + ) { + result[i].option = cptOption; + newCptOptions[index] = null; + return; + } + } + + for (var i = 0; i < result.length; i++) { + var exist = result[i].exist; + if (!result[i].option // Consider name: two map to one. + // Can not match when both ids exist but different. + && (exist.id == null || cptOption.id == null) + && cptOption.name != null + && !isIdInner(cptOption) + && !isIdInner(exist) + && exist.name === cptOption.name + '' + ) { + result[i].option = cptOption; + newCptOptions[index] = null; + return; + } + } + }); + + // Otherwise mapping by index. + each$2(newCptOptions, function (cptOption, index) { + if (!isObject$2(cptOption)) { + return; + } + + var i = 0; + for (; i < result.length; i++) { + var exist = result[i].exist; + if (!result[i].option + // Existing model that already has id should be able to + // mapped to (because after mapping performed model may + // be assigned with a id, whish should not affect next + // mapping), except those has inner id. + && !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; +} + +/** + * Make id and name for mapping result (result of mappingToExists) + * into `keyInfo` field. + * + * @public + * @param {Array.} Result, like [{exist: ..., option: ...}, {}], + * which order is the same as exists. + * @return {Array.} The input. + */ +function makeIdAndName(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 = createHashMap(); + + each$2(mapResult, function (item, index) { + var existCpt = item.exist; + existCpt && idMap.set(existCpt.id, item); + }); + + each$2(mapResult, function (item, index) { + var opt = item.option; + + assert$1( + !opt || opt.id == null || !idMap.get(opt.id) || idMap.get(opt.id) === item, + 'id duplicates: ' + (opt && opt.id) + ); + + opt && opt.id != null && idMap.set(opt.id, item); + !item.keyInfo && (item.keyInfo = {}); + }); + + // Make name and id. + each$2(mapResult, function (item, index) { + var existCpt = item.exist; + var opt = item.option; + var keyInfo = item.keyInfo; + + if (!isObject$2(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 + // Avoid diffferent series has the same name, + // because name may be used like in color pallet. + : DUMMY_COMPONENT_NAME_PREFIX + index; + + 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.get(keyInfo.id)); + } + + idMap.set(keyInfo.id, item); + }); +} + +function isNameSpecified(componentModel) { + var name = componentModel.name; + // Is specified when `indexOf` get -1 or > 0. + return !!(name && name.indexOf(DUMMY_COMPONENT_NAME_PREFIX)); +} + +/** + * @public + * @param {Object} cptOption + * @return {boolean} + */ +function isIdInner(cptOption) { + return isObject$2(cptOption) + && cptOption.id + && (cptOption.id + '').indexOf('\0_ec_\0') === 0; +} + +/** + * A helper for removing duplicate items between batchA and batchB, + * and in themselves, and categorize by series. + * + * @param {Array.} batchA Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...] + * @param {Array.} batchB Like: [{seriesId: 2, dataIndex: [32, 4, 5]}, ...] + * @return {Array., Array.>} result: [resultBatchA, resultBatchB] + */ +function compressBatches(batchA, batchB) { + var mapA = {}; + var mapB = {}; + + makeMap(batchA || [], mapA); + makeMap(batchB || [], mapB, mapA); + + return [mapToArray(mapA), mapToArray(mapB)]; + + function makeMap(sourceBatch, map$$1, otherMap) { + for (var i = 0, len = sourceBatch.length; i < len; i++) { + var seriesId = sourceBatch[i].seriesId; + var dataIndices = normalizeToArray(sourceBatch[i].dataIndex); + var otherDataIndices = otherMap && otherMap[seriesId]; + + for (var j = 0, lenj = dataIndices.length; j < lenj; j++) { + var dataIndex = dataIndices[j]; + + if (otherDataIndices && otherDataIndices[dataIndex]) { + otherDataIndices[dataIndex] = null; + } + else { + (map$$1[seriesId] || (map$$1[seriesId] = {}))[dataIndex] = 1; + } + } + } + } + + function mapToArray(map$$1, isData) { + var result = []; + for (var i in map$$1) { + if (map$$1.hasOwnProperty(i) && map$$1[i] != null) { + if (isData) { + result.push(+i); + } + else { + var dataIndices = mapToArray(map$$1[i], true); + dataIndices.length && result.push({seriesId: i, dataIndex: dataIndices}); + } + } + } + return result; + } +} + +/** + * @param {module:echarts/data/List} data + * @param {Object} payload Contains dataIndex (means rawIndex) / dataIndexInside / name + * each of which can be Array or primary type. + * @return {number|Array.} dataIndex If not found, return undefined/null. + */ +function queryDataIndex(data, payload) { + if (payload.dataIndexInside != null) { + return payload.dataIndexInside; + } + else if (payload.dataIndex != null) { + return isArray(payload.dataIndex) + ? map(payload.dataIndex, function (value) { + return data.indexOfRawIndex(value); + }) + : data.indexOfRawIndex(payload.dataIndex); + } + else if (payload.name != null) { + return isArray(payload.name) + ? map(payload.name, function (value) { + return data.indexOfName(value); + }) + : data.indexOfName(payload.name); + } +} + +/** + * Enable property storage to any host object. + * Notice: Serialization is not supported. + * + * For example: + * var inner = zrUitl.makeInner(); + * + * function some1(hostObj) { + * inner(hostObj).someProperty = 1212; + * ... + * } + * function some2() { + * var fields = inner(this); + * fields.someProperty1 = 1212; + * fields.someProperty2 = 'xx'; + * ... + * } + * + * @return {Function} + */ +function makeInner() { + // Consider different scope by es module import. + var key = '__\0ec_inner_' + innerUniqueIndex++ + '_' + Math.random().toFixed(5); + return function (hostObj) { + return hostObj[key] || (hostObj[key] = {}); + }; +} +var innerUniqueIndex = 0; + +/** + * @param {module:echarts/model/Global} ecModel + * @param {string|Object} finder + * If string, e.g., 'geo', means {geoIndex: 0}. + * If Object, could contain some of these properties below: + * { + * seriesIndex, seriesId, seriesName, + * geoIndex, geoId, geoName, + * bmapIndex, bmapId, bmapName, + * xAxisIndex, xAxisId, xAxisName, + * yAxisIndex, yAxisId, yAxisName, + * gridIndex, gridId, gridName, + * ... (can be extended) + * } + * Each properties can be number|string|Array.|Array. + * For example, a finder could be + * { + * seriesIndex: 3, + * geoId: ['aa', 'cc'], + * gridName: ['xx', 'rr'] + * } + * xxxIndex can be set as 'all' (means all xxx) or 'none' (means not specify) + * If nothing or null/undefined specified, return nothing. + * @param {Object} [opt] + * @param {string} [opt.defaultMainType] + * @param {Array.} [opt.includeMainTypes] + * @return {Object} result like: + * { + * seriesModels: [seriesModel1, seriesModel2], + * seriesModel: seriesModel1, // The first model + * geoModels: [geoModel1, geoModel2], + * geoModel: geoModel1, // The first model + * ... + * } + */ +function parseFinder(ecModel, finder, opt) { + if (isString(finder)) { + var obj = {}; + obj[finder + 'Index'] = 0; + finder = obj; + } + + var defaultMainType = opt && opt.defaultMainType; + if (defaultMainType + && !has(finder, defaultMainType + 'Index') + && !has(finder, defaultMainType + 'Id') + && !has(finder, defaultMainType + 'Name') + ) { + finder[defaultMainType + 'Index'] = 0; + } + + var result = {}; + + each$2(finder, function (value, key) { + var value = finder[key]; + + // Exclude 'dataIndex' and other illgal keys. + if (key === 'dataIndex' || key === 'dataIndexInside') { + result[key] = value; + return; + } + + var parsedKey = key.match(/^(\w+)(Index|Id|Name)$/) || []; + var mainType = parsedKey[1]; + var queryType = (parsedKey[2] || '').toLowerCase(); + + if (!mainType + || !queryType + || value == null + || (queryType === 'index' && value === 'none') + || (opt && opt.includeMainTypes && indexOf(opt.includeMainTypes, mainType) < 0) + ) { + return; + } + + var queryParam = {mainType: mainType}; + if (queryType !== 'index' || value !== 'all') { + queryParam[queryType] = value; + } + + var models = ecModel.queryComponents(queryParam); + result[mainType + 'Models'] = models; + result[mainType + 'Model'] = models[0]; + }); + + return result; +} + +function has(obj, prop) { + return obj && obj.hasOwnProperty(prop); +} + +function setAttribute(dom, key, value) { + dom.setAttribute + ? dom.setAttribute(key, value) + : (dom[key] = value); +} + +function getAttribute(dom, key) { + return dom.getAttribute + ? dom.getAttribute(key) + : dom[key]; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 TYPE_DELIMITER = '.'; +var IS_CONTAINER = '___EC__COMPONENT__CONTAINER___'; + +/** + * Notice, parseClassType('') should returns {main: '', sub: ''} + * @public + */ +function parseClassType$1(componentType) { + var ret = {main: '', sub: ''}; + if (componentType) { + componentType = componentType.split(TYPE_DELIMITER); + ret.main = componentType[0] || ''; + ret.sub = componentType[1] || ''; + } + return ret; +} + +/** + * @public + */ +function checkClassType(componentType) { + assert$1( + /^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(componentType), + 'componentType "' + componentType + '" illegal' + ); +} + +/** + * @public + */ +function enableClassExtend(RootClass, mandatoryMethods) { + + RootClass.$constructor = RootClass; + RootClass.extend = function (proto) { + + if (__DEV__) { + each$1(mandatoryMethods, function (method) { + if (!proto[method]) { + console.warn( + 'Method `' + method + '` should be implemented' + + (proto.type ? ' in ' + proto.type : '') + '.' + ); + } + }); + } + + var superClass = this; + var ExtendedClass = function () { + if (!proto.$constructor) { + superClass.apply(this, arguments); + } + else { + proto.$constructor.apply(this, arguments); + } + }; + + extend(ExtendedClass.prototype, proto); + + ExtendedClass.extend = this.extend; + ExtendedClass.superCall = superCall; + ExtendedClass.superApply = superApply; + inherits(ExtendedClass, this); + ExtendedClass.superClass = superClass; + + return ExtendedClass; + }; +} + +var classBase = 0; + +/** + * Can not use instanceof, consider different scope by + * cross domain or es module import in ec extensions. + * Mount a method "isInstance()" to Clz. + */ +function enableClassCheck(Clz) { + var classAttr = ['__\0is_clz', classBase++, Math.random().toFixed(3)].join('_'); + Clz.prototype[classAttr] = true; + + if (__DEV__) { + assert$1(!Clz.isInstance, 'The method "is" can not be defined.'); + } + + Clz.isInstance = function (obj) { + return !!(obj && obj[classAttr]); + }; +} + +// 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 = 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 + */ +function enableClassManagement(entity, options) { + options = options || {}; + + /** + * Component model classes + * key: componentType, + * value: + * componentClass, when componentType is 'xxx' + * or Object., when componentType is 'xxx.yy' + * @type {Object} + */ + var storage = {}; + + entity.registerClass = function (Clazz, componentType) { + if (componentType) { + checkClassType(componentType); + componentType = parseClassType$1(componentType); + + if (!componentType.sub) { + if (__DEV__) { + if (storage[componentType.main]) { + console.warn(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 (componentMainType, subType, throwWhenNotFound) { + var Clazz = storage[componentMainType]; + + if (Clazz && Clazz[IS_CONTAINER]) { + Clazz = subType ? Clazz[subType] : null; + } + + if (throwWhenNotFound && !Clazz) { + throw new Error( + !subType + ? componentMainType + '.' + 'type should be specified.' + : 'Component ' + componentMainType + '.' + (subType || '') + ' not exists. Load it first.' + ); + } + + return Clazz; + }; + + entity.getClassesByMainType = function (componentType) { + componentType = parseClassType$1(componentType); + + var result = []; + var obj = storage[componentType.main]; + + if (obj && obj[IS_CONTAINER]) { + each$1(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$1(componentType); + return !!storage[componentType.main]; + }; + + /** + * @return {Array.} Like ['aa', 'bb'], but can not be ['aa.xx'] + */ + entity.getAllClassMainTypes = function () { + var types = []; + each$1(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$1(componentType); + var obj = storage[componentType.main]; + return obj && obj[IS_CONTAINER]; + }; + + entity.parseClassType = parseClassType$1; + + 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.} properties + */ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// TODO Parse shadow style +// TODO Only shallow path support +var makeStyleMapper = function (properties) { + // Normalize + for (var i = 0; i < properties.length; i++) { + if (!properties[i][1]) { + properties[i][1] = properties[i][0]; + } + } + return function (model, excludes, includes) { + var style = {}; + for (var i = 0; i < properties.length; i++) { + var propName = properties[i][1]; + if ((excludes && indexOf(excludes, propName) >= 0) + || (includes && indexOf(includes, propName) < 0) + ) { + continue; + } + var val = model.getShallow(propName); + if (val != null) { + style[properties[i][0]] = val; + } + } + return style; + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 getLineStyle = makeStyleMapper( + [ + ['lineWidth', 'width'], + ['stroke', 'color'], + ['opacity'], + ['shadowBlur'], + ['shadowOffsetX'], + ['shadowOffsetY'], + ['shadowColor'] + ] +); + +var lineStyleMixin = { + getLineStyle: function (excludes) { + var style = getLineStyle(this, excludes); + var lineDash = this.getLineDash(style.lineWidth); + lineDash && (style.lineDash = lineDash); + return style; + }, + + getLineDash: function (lineWidth) { + if (lineWidth == null) { + lineWidth = 1; + } + var lineType = this.get('type'); + var dotSize = Math.max(lineWidth, 2); + var dashSize = lineWidth * 4; + return (lineType === 'solid' || lineType == null) ? null + : (lineType === 'dashed' ? [dashSize, dashSize] : [dotSize, dotSize]); + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 getAreaStyle = makeStyleMapper( + [ + ['fill', 'color'], + ['shadowBlur'], + ['shadowOffsetX'], + ['shadowOffsetY'], + ['opacity'], + ['shadowColor'] + ] +); + +var areaStyleMixin = { + getAreaStyle: function (excludes, includes) { + return getAreaStyle(this, excludes, includes); + } +}; + +/** + * 曲线辅助模块 + * @module zrender/core/curve + * @author pissang(https://www.github.com/pissang) + */ + +var mathPow = Math.pow; +var mathSqrt$2 = Math.sqrt; + +var EPSILON$1 = 1e-8; +var EPSILON_NUMERIC = 1e-4; + +var THREE_SQRT = mathSqrt$2(3); +var ONE_THIRD = 1 / 3; + +// 临时变量 +var _v0 = create(); +var _v1 = create(); +var _v2 = create(); + +function isAroundZero(val) { + return val > -EPSILON$1 && val < EPSILON$1; +} +function isNotAroundZero$1(val) { + return val > EPSILON$1 || val < -EPSILON$1; +} +/** + * 计算三次贝塞尔值 + * @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.} 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$2(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$2(A * A * A)); + var theta = Math.acos(T) / 3; + var ASqrt = mathSqrt$2(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.} 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$1(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$2(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.} 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.} [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 = distSquare(_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 = distSquare(_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 = distSquare(_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$2(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.} 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$1(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$2(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.} 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.} 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 = distSquare(_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 = distSquare(_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 = distSquare(_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$2(d); +} + +/** + * @author Yi Shen(https://github.com/pissang) + */ + +var mathMin$3 = Math.min; +var mathMax$3 = Math.max; +var mathSin$2 = Math.sin; +var mathCos$2 = Math.cos; +var PI2 = Math.PI * 2; + +var start = create(); +var end = create(); +var extremity = create(); + +/** + * 从顶点数组中计算出最小包围盒,写入`min`和`max`中 + * @module zrender/core/bbox + * @param {Array} points 顶点数组 + * @param {number} min + * @param {number} max + */ +function fromPoints(points, min$$1, max$$1) { + 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$3(left, p[0]); + right = mathMax$3(right, p[0]); + top = mathMin$3(top, p[1]); + bottom = mathMax$3(bottom, p[1]); + } + + min$$1[0] = left; + min$$1[1] = top; + max$$1[0] = right; + max$$1[1] = bottom; +} + +/** + * @memberOf module:zrender/core/bbox + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {Array.} min + * @param {Array.} max + */ +function fromLine(x0, y0, x1, y1, min$$1, max$$1) { + min$$1[0] = mathMin$3(x0, x1); + min$$1[1] = mathMin$3(y0, y1); + max$$1[0] = mathMax$3(x0, x1); + max$$1[1] = mathMax$3(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.} min + * @param {Array.} max + */ +function fromCubic( + x0, y0, x1, y1, x2, y2, x3, y3, min$$1, max$$1 +) { + var cubicExtrema$$1 = cubicExtrema; + var cubicAt$$1 = cubicAt; + var i; + var n = cubicExtrema$$1(x0, x1, x2, x3, xDim); + min$$1[0] = Infinity; + min$$1[1] = Infinity; + max$$1[0] = -Infinity; + max$$1[1] = -Infinity; + + for (i = 0; i < n; i++) { + var x = cubicAt$$1(x0, x1, x2, x3, xDim[i]); + min$$1[0] = mathMin$3(x, min$$1[0]); + max$$1[0] = mathMax$3(x, max$$1[0]); + } + n = cubicExtrema$$1(y0, y1, y2, y3, yDim); + for (i = 0; i < n; i++) { + var y = cubicAt$$1(y0, y1, y2, y3, yDim[i]); + min$$1[1] = mathMin$3(y, min$$1[1]); + max$$1[1] = mathMax$3(y, max$$1[1]); + } + + min$$1[0] = mathMin$3(x0, min$$1[0]); + max$$1[0] = mathMax$3(x0, max$$1[0]); + min$$1[0] = mathMin$3(x3, min$$1[0]); + max$$1[0] = mathMax$3(x3, max$$1[0]); + + min$$1[1] = mathMin$3(y0, min$$1[1]); + max$$1[1] = mathMax$3(y0, max$$1[1]); + min$$1[1] = mathMin$3(y3, min$$1[1]); + max$$1[1] = mathMax$3(y3, max$$1[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.} min + * @param {Array.} max + */ +function fromQuadratic(x0, y0, x1, y1, x2, y2, min$$1, max$$1) { + var quadraticExtremum$$1 = quadraticExtremum; + var quadraticAt$$1 = quadraticAt; + // Find extremities, where derivative in x dim or y dim is zero + var tx = + mathMax$3( + mathMin$3(quadraticExtremum$$1(x0, x1, x2), 1), 0 + ); + var ty = + mathMax$3( + mathMin$3(quadraticExtremum$$1(y0, y1, y2), 1), 0 + ); + + var x = quadraticAt$$1(x0, x1, x2, tx); + var y = quadraticAt$$1(y0, y1, y2, ty); + + min$$1[0] = mathMin$3(x0, x2, x); + min$$1[1] = mathMin$3(y0, y2, y); + max$$1[0] = mathMax$3(x0, x2, x); + max$$1[1] = mathMax$3(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.} min + * @param {Array.} max + */ +function fromArc( + x, y, rx, ry, startAngle, endAngle, anticlockwise, min$$1, max$$1 +) { + var vec2Min = min; + var vec2Max = max; + + var diff = Math.abs(startAngle - endAngle); + + + if (diff % PI2 < 1e-4 && diff > 1e-4) { + // Is a circle + min$$1[0] = x - rx; + min$$1[1] = y - ry; + max$$1[0] = x + rx; + max$$1[1] = y + ry; + return; + } + + start[0] = mathCos$2(startAngle) * rx + x; + start[1] = mathSin$2(startAngle) * ry + y; + + end[0] = mathCos$2(endAngle) * rx + x; + end[1] = mathSin$2(endAngle) * ry + y; + + vec2Min(min$$1, start, end); + vec2Max(max$$1, 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$2(angle) * rx + x; + extremity[1] = mathSin$2(angle) * ry + y; + + vec2Min(min$$1, extremity, min$$1); + vec2Max(max$$1, extremity, max$$1); + } + } +} + +/** + * Path 代理,可以在`buildPath`中用于替代`ctx`, 会保存每个path操作的命令到pathCommands属性中 + * 可以用于 isInsidePath 判断以及获取boundingRect + * + * @module zrender/core/PathProxy + * @author Yi Shen (http://www.github.com/pissang) + */ + +// TODO getTotalLength, getPointAtLength + +var CMD = { + M: 1, + L: 2, + C: 3, + Q: 4, + A: 5, + Z: 6, + // Rect + R: 7 +}; + +// var CMD_MEM_SIZE = { +// M: 3, +// L: 3, +// C: 7, +// Q: 5, +// A: 9, +// R: 5, +// Z: 1 +// }; + +var min$1 = []; +var max$1 = []; +var min2 = []; +var max2 = []; +var mathMin$2 = Math.min; +var mathMax$2 = Math.max; +var mathCos$1 = Math.cos; +var mathSin$1 = Math.sin; +var mathSqrt$1 = Math.sqrt; +var mathAbs = Math.abs; + +var hasTypedArray = typeof Float32Array != 'undefined'; + +/** + * @alias module:zrender/core/PathProxy + * @constructor + */ +var PathProxy = function (notSaveData) { + + this._saveData = !(notSaveData || false); + + if (this._saveData) { + /** + * Path data. Stored as flat array + * @type {Array.} + */ + this.data = []; + } + + this._ctx = null; +}; + +/** + * 快速计算Path包围盒(并不是最小包围盒) + * @return {Object} + */ +PathProxy.prototype = { + + constructor: PathProxy, + + _xi: 0, + _yi: 0, + + _x0: 0, + _y0: 0, + // Unit x, Unit y. Provide for avoiding drawing that too short line segment + _ux: 0, + _uy: 0, + + _len: 0, + + _lineDash: null, + + _dashOffset: 0, + + _dashIdx: 0, + + _dashSum: 0, + + /** + * @readOnly + */ + setScale: function (sx, sy) { + this._ux = mathAbs(1 / devicePixelRatio / sx) || 0; + this._uy = mathAbs(1 / devicePixelRatio / sy) || 0; + }, + + getContext: function () { + return this._ctx; + }, + + /** + * @param {CanvasRenderingContext2D} ctx + * @return {module:zrender/core/PathProxy} + */ + beginPath: function (ctx) { + + this._ctx = ctx; + + ctx && ctx.beginPath(); + + ctx && (this.dpr = ctx.dpr); + + // Reset + if (this._saveData) { + 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) { + var exceedUnit = mathAbs(x - this._xi) > this._ux + || mathAbs(y - this._yi) > this._uy + // Force draw the first segment + || this._len < 5; + + this.addData(CMD.L, x, y); + + if (this._ctx && exceedUnit) { + this._needsDash() ? this._dashedLineTo(x, y) + : this._ctx.lineTo(x, y); + } + if (exceedUnit) { + 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$1(endAngle) * r + cx; + this._yi = mathSin$1(endAngle) * r + cy; + 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$$1 = data.length; + + if (! (this.data && this.data.length == len$$1) && hasTypedArray) { + this.data = new Float32Array(len$$1); + } + + for (var i = 0; i < len$$1; i++) { + this.data[i] = data[i]; + } + + this._len = len$$1; + }, + + /** + * 添加子路径 + * @param {module:zrender/core/PathProxy|Array.} path + */ + appendPath: function (path) { + if (!(path instanceof Array)) { + path = [path]; + } + var len$$1 = path.length; + var appendSize = 0; + var offset = this._len; + for (var i = 0; i < len$$1; i++) { + appendSize += path[i].len(); + } + if (hasTypedArray && (this.data instanceof Float32Array)) { + this.data = new Float32Array(offset + appendSize); + } + for (var i = 0; i < len$$1; 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) { + if (!this._saveData) { + return; + } + + 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$$1 = mathSqrt$1(dx * dx + dy * dy); + var x = x0; + var y = y0; + var dash; + var nDash = lineDash.length; + var idx; + dx /= dist$$1; + dy /= dist$$1; + + 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) + || (dx == 0 && ((dy > 0 && y <= y1) || (dy < 0 && y >= y1)))) { + 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) || (dy > 0 && y < y0) || (dy < 0 && y > y0)) { + continue; + } + ctx[idx % 2 ? 'moveTo' : 'lineTo']( + dx >= 0 ? mathMin$2(x, x1) : mathMax$2(x, x1), + dy >= 0 ? mathMin$2(y, y1) : mathMax$2(y, y1) + ); + } + // Offset for next lineTo + dx = x - x1; + dy = y - y1; + this._dashOffset = -mathSqrt$1(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$$1 = 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$$1(x0, x1, x2, x3, t + 0.1) + - cubicAt$$1(x0, x1, x2, x3, t); + dy = cubicAt$$1(y0, y1, y2, y3, t + 0.1) + - cubicAt$$1(y0, y1, y2, y3, t); + bezierLen += mathSqrt$1(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$$1(x0, x1, x2, x3, t); + y = cubicAt$$1(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$1(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$1[0] = min$1[1] = min2[0] = min2[1] = Number.MAX_VALUE; + max$1[0] = max$1[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: + fromLine(xi, yi, data[i], data[i + 1], min2, max2); + xi = data[i++]; + yi = data[i++]; + break; + case CMD.C: + 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: + 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$1(startAngle) * rx + cx; + y0 = mathSin$1(startAngle) * ry + cy; + } + + fromArc( + cx, cy, rx, ry, startAngle, endAngle, + anticlockwise, min2, max2 + ); + + xi = mathCos$1(endAngle) * rx + cx; + yi = mathSin$1(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 + fromLine(x0, y0, x0 + width, y0 + height, min2, max2); + break; + case CMD.Z: + xi = x0; + yi = y0; + break; + } + + // Union + min(min$1, min$1, min2); + max(max$1, max$1, max2); + } + + // No data + if (i === 0) { + min$1[0] = min$1[1] = max$1[0] = max$1[1] = 0; + } + + return new BoundingRect( + min$1[0], min$1[1], max$1[0] - min$1[0], max$1[1] - min$1[1] + ); + }, + + /** + * Rebuild path from current data + * Rebuild path will not consider javascript implemented line dash. + * @param {CanvasRenderingContext2D} ctx + */ + rebuildPath: function (ctx) { + var d = this.data; + var x0, y0; + var xi, yi; + var x, y; + var ux = this._ux; + var uy = this._uy; + var len$$1 = this._len; + for (var i = 0; i < len$$1;) { + var cmd = d[i++]; + + if (i == 1) { + // 如果第一个命令是 L, C, Q + // 则 previous point 同绘制命令的第一个 point + // + // 第一个命令为 Arc 的情况下会在后面特殊处理 + xi = d[i]; + yi = d[i + 1]; + + x0 = xi; + y0 = yi; + } + switch (cmd) { + case CMD.M: + x0 = xi = d[i++]; + y0 = yi = d[i++]; + ctx.moveTo(xi, yi); + break; + case CMD.L: + x = d[i++]; + y = d[i++]; + // Not draw too small seg between + if (mathAbs(x - xi) > ux || mathAbs(y - yi) > uy || i === len$$1 - 1) { + ctx.lineTo(x, y); + xi = x; + yi = y; + } + break; + case CMD.C: + ctx.bezierCurveTo( + d[i++], d[i++], d[i++], d[i++], d[i++], d[i++] + ); + xi = d[i - 2]; + yi = d[i - 1]; + break; + case CMD.Q: + ctx.quadraticCurveTo(d[i++], d[i++], d[i++], d[i++]); + xi = d[i - 2]; + yi = d[i - 1]; + 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; + var endAngle = theta + dTheta; + if (isEllipse) { + ctx.translate(cx, cy); + ctx.rotate(psi); + ctx.scale(scaleX, scaleY); + ctx.arc(0, 0, r, theta, endAngle, 1 - fs); + ctx.scale(1 / scaleX, 1 / scaleY); + ctx.rotate(-psi); + ctx.translate(-cx, -cy); + } + else { + ctx.arc(cx, cy, r, theta, endAngle, 1 - fs); + } + + if (i == 1) { + // 直接使用 arc 命令 + // 第一个命令起点还未定义 + x0 = mathCos$1(theta) * rx + cx; + y0 = mathSin$1(theta) * ry + cy; + } + xi = mathCos$1(endAngle) * rx + cx; + yi = mathSin$1(endAngle) * ry + cy; + break; + case CMD.R: + x0 = xi = d[i]; + y0 = yi = d[i + 1]; + ctx.rect(d[i++], d[i++], d[i++], d[i++]); + break; + case CMD.Z: + ctx.closePath(); + xi = x0; + yi = y0; + } + } + } +}; + +PathProxy.CMD = CMD; + +/** + * 线段包含判断 + * @param {number} x0 + * @param {number} y0 + * @param {number} x1 + * @param {number} y1 + * @param {number} lineWidth + * @param {number} x + * @param {number} y + * @return {boolean} + */ +function containStroke$1(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; +} + +/** + * 三次贝塞尔曲线描边包含判断 + * @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} + */ +function containStroke$2(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 = cubicProjectPoint( + x0, y0, x1, y1, x2, y2, x3, y3, + x, y, null + ); + return d <= _l / 2; +} + +/** + * 二次贝塞尔曲线描边包含判断 + * @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} + */ +function containStroke$3(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 = quadraticProjectPoint( + x0, y0, x1, y1, x2, y2, + x, y, null + ); + return d <= _l / 2; +} + +var PI2$3 = Math.PI * 2; + +function normalizeRadian(angle) { + angle %= PI2$3; + if (angle < 0) { + angle += PI2$3; + } + return angle; +} + +var PI2$2 = Math.PI * 2; + +/** + * 圆弧描边包含判断 + * @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} + */ +function containStroke$4( + 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$2 < 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$2; + } + + var angle = Math.atan2(y, x); + if (angle < 0) { + angle += PI2$2; + } + return (angle >= startAngle && angle <= endAngle) + || (angle + PI2$2 >= startAngle && angle + PI2$2 <= endAngle); +} + +function windingLine(x0, y0, x1, y1, x, y) { + if ((y > y0 && y > y1) || (y < y0 && y < y1)) { + return 0; + } + // Ignore horizontal line + if (y1 === y0) { + return 0; + } + var dir = y1 < y0 ? 1 : -1; + var t = (y - y0) / (y1 - y0); + + // Avoid winding error when intersection point is the connect point of two line of polygon + if (t === 1 || t === 0) { + dir = y1 < y0 ? 0.5 : -0.5; + } + + var x_ = t * (x1 - x0) + x0; + + // If (x, y) on the line, considered as "contain". + return x_ === x ? Infinity : x_ > x ? dir : 0; +} + +var CMD$1 = PathProxy.CMD; +var PI2$1 = Math.PI * 2; + +var EPSILON$2 = 1e-4; + +function isAroundEqual(a, b) { + return Math.abs(a - b) < EPSILON$2; +} + +// 临时数组 +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 = 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]; + + // Avoid winding error when intersection point is the connect point of two line of polygon + var unit = (t === 0 || t === 1) ? 0.5 : 1; + + var x_ = cubicAt(x0, x1, x2, x3, t); + if (x_ < x) { // Quick reject + continue; + } + if (nExtrema < 0) { + nExtrema = cubicExtrema(y0, y1, y2, y3, extrema); + if (extrema[1] < extrema[0] && nExtrema > 1) { + swapExtrema(); + } + y0_ = cubicAt(y0, y1, y2, y3, extrema[0]); + if (nExtrema > 1) { + y1_ = cubicAt(y0, y1, y2, y3, extrema[1]); + } + } + if (nExtrema == 2) { + // 分成三段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? unit : -unit; + } + else if (t < extrema[1]) { + w += y1_ < y0_ ? unit : -unit; + } + else { + w += y3 < y1_ ? unit : -unit; + } + } + else { + // 分成两段单调函数 + if (t < extrema[0]) { + w += y0_ < y0 ? unit : -unit; + } + else { + w += y3 < y0_ ? unit : -unit; + } + } + } + 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 = quadraticRootAt(y0, y1, y2, y, roots); + if (nRoots === 0) { + return 0; + } + else { + var t = quadraticExtremum(y0, y1, y2); + if (t >= 0 && t <= 1) { + var w = 0; + var y_ = quadraticAt(y0, y1, y2, t); + for (var i = 0; i < nRoots; i++) { + // Remove one endpoint. + var unit = (roots[i] === 0 || roots[i] === 1) ? 0.5 : 1; + + var x_ = quadraticAt(x0, x1, x2, roots[i]); + if (x_ < x) { // Quick reject + continue; + } + if (roots[i] < t) { + w += y_ < y0 ? unit : -unit; + } + else { + w += y2 < y_ ? unit : -unit; + } + } + return w; + } + else { + // Remove one endpoint. + var unit = (roots[0] === 0 || roots[0] === 1) ? 0.5 : 1; + + var x_ = quadraticAt(x0, x1, x2, roots[0]); + if (x_ < x) { // Quick reject + return 0; + } + return y2 < y0 ? unit : -unit; + } + } +} + +// 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$1 < 1e-4) { + // Is a circle + startAngle = 0; + endAngle = PI2$1; + 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$1; + } + + 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$1 + angle; + } + if ( + (angle >= startAngle && angle <= endAngle) + || (angle + PI2$1 >= startAngle && angle + PI2$1 <= 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$1.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$1.M: + // moveTo 命令重新创建一个新的 subpath, 并且更新新的起点 + // 在 closePath 的时候使用 + x0 = data[i++]; + y0 = data[i++]; + xi = x0; + yi = y0; + break; + case CMD$1.L: + if (isStroke) { + if (containStroke$1(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$1.C: + if (isStroke) { + if (containStroke$2(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$1.Q: + if (isStroke) { + if (containStroke$3(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$1.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 (containStroke$4( + 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$1.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$1(x0, y0, x1, y0, lineWidth, x, y) + || containStroke$1(x1, y0, x1, y1, lineWidth, x, y) + || containStroke$1(x1, y1, x0, y1, lineWidth, x, y) + || containStroke$1(x0, y1, x0, y0, 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$1.Z: + if (isStroke) { + if (containStroke$1( + xi, yi, x0, y0, lineWidth, x, y + )) { + return true; + } + } + else { + // Close a subpath + w += windingLine(xi, yi, x0, y0, x, y); + // 如果被任何一个 subpath 包含 + // FIXME subpaths may overlap + // 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; +} + +function contain(pathData, x, y) { + return containPath(pathData, 0, false, x, y); +} + +function containStroke(pathData, lineWidth, x, y) { + return containPath(pathData, lineWidth, true, x, y); +} + +var getCanvasPattern = Pattern.prototype.getCanvasPattern; + +var abs = Math.abs; + +var pathProxyForDraw = new PathProxy(true); +/** + * @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 = null; +} + +Path.prototype = { + + constructor: Path, + + type: 'path', + + __dirtyPath: true, + + strokeContainThreshold: 5, + + brush: function (ctx, prevEl) { + var style = this.style; + var path = this.path || pathProxyForDraw; + var hasStroke = style.hasStroke(); + var hasFill = style.hasFill(); + var fill = style.fill; + var stroke = style.stroke; + var hasFillGradient = hasFill && !!(fill.colorStops); + var hasStrokeGradient = hasStroke && !!(stroke.colorStops); + var hasFillPattern = hasFill && !!(fill.image); + var hasStrokePattern = hasStroke && !!(stroke.image); + + style.bind(ctx, this, prevEl); + this.setTransform(ctx); + + if (this.__dirty) { + var rect; + // Update gradient because bounding rect may changed + if (hasFillGradient) { + rect = rect || this.getBoundingRect(); + this._fillGradient = style.getGradient(ctx, fill, rect); + } + if (hasStrokeGradient) { + rect = rect || this.getBoundingRect(); + this._strokeGradient = style.getGradient(ctx, stroke, rect); + } + } + // Use the gradient or pattern + if (hasFillGradient) { + // PENDING If may have affect the state + ctx.fillStyle = this._fillGradient; + } + else if (hasFillPattern) { + ctx.fillStyle = getCanvasPattern.call(fill, ctx); + } + if (hasStrokeGradient) { + ctx.strokeStyle = this._strokeGradient; + } + else if (hasStrokePattern) { + ctx.strokeStyle = getCanvasPattern.call(stroke, ctx); + } + + var lineDash = style.lineDash; + var lineDashOffset = style.lineDashOffset; + + var ctxLineDash = !!ctx.setLineDash; + + // Update path sx, sy + var scale = this.getGlobalScale(); + path.setScale(scale[0], scale[1]); + + // 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.beginPath(ctx); + + // Setting line dash before build path + if (lineDash && !ctxLineDash) { + path.setLineDash(lineDash); + path.setLineDashOffset(lineDashOffset); + } + + this.buildPath(path, this.shape, false); + + // Clear path dirty flag + if (this.path) { + this.__dirtyPath = false; + } + } + else { + // Replay path building + ctx.beginPath(); + this.path.rebuildPath(ctx); + } + + if (hasFill) { + if (style.fillOpacity != null) { + var originalGlobalAlpha = ctx.globalAlpha; + ctx.globalAlpha = style.fillOpacity * style.opacity; + path.fill(ctx); + ctx.globalAlpha = originalGlobalAlpha; + } + else { + path.fill(ctx); + } + } + + if (lineDash && ctxLineDash) { + ctx.setLineDash(lineDash); + ctx.lineDashOffset = lineDashOffset; + } + + if (hasStroke) { + if (style.strokeOpacity != null) { + var originalGlobalAlpha = ctx.globalAlpha; + ctx.globalAlpha = style.strokeOpacity * style.opacity; + path.stroke(ctx); + ctx.globalAlpha = originalGlobalAlpha; + } + else { + path.stroke(ctx); + } + } + + if (lineDash && ctxLineDash) { + // PENDING + // Remove lineDash + ctx.setLineDash([]); + } + + // Draw rect text + if (style.text != null) { + // Only restore transform when needs draw text. + this.restoreTransform(ctx); + this.drawRectText(ctx, this.getBoundingRect()); + } + }, + + // When bundling path, some shape may decide if use moveTo to begin a new subpath or closePath + // Like in circle + buildPath: function (ctx, shapeCfg, inBundle) {}, + + createPathProxy: function () { + this.path = new PathProxy(); + }, + + getBoundingRect: function () { + var rect = this._rect; + var style = this.style; + var needsUpdateRect = !rect; + if (needsUpdateRect) { + var path = this.path; + if (!path) { + // Create path on demand. + path = this.path = new PathProxy(); + } + if (this.__dirtyPath) { + path.beginPath(); + this.buildPath(path, this.shape, false); + } + rect = path.getBoundingRect(); + } + this._rect = rect; + + if (style.hasStroke()) { + // Needs update rect with stroke lineWidth when + // 1. Element changes scale or lineWidth + // 2. Shape is changed + var rectWithStroke = this._rectWithStroke || (this._rectWithStroke = rect.clone()); + if (this.__dirty || needsUpdateRect) { + 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 (!style.hasFill()) { + w = Math.max(w, this.strokeContainThreshold || 4); + } + // 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 (style.hasStroke()) { + 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 (!style.hasFill()) { + lineWidth = Math.max(lineWidth, this.strokeContainThreshold); + } + if (containStroke( + pathData, lineWidth / lineScale, x, y + )) { + return true; + } + } + } + if (style.hasFill()) { + return contain(pathData, x, y); + } + } + return false; + }, + + /** + * @param {boolean} dirtyPath + */ + dirty: function (dirtyPath) { + if (dirtyPath == null) { + dirtyPath = true; + } + // Only mark dirty, not mark clean + if (dirtyPath) { + this.__dirtyPath = dirtyPath; + this._rect = null; + } + + this.__dirty = this.__dirtyText = 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); + this.__dirtyPath = true; + this._rect = null; + } + 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 (isObject$1(key)) { + for (var name in key) { + if (key.hasOwnProperty(name)) { + 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$$1) { + var Sub = function (opts) { + Path.call(this, opts); + + if (defaults$$1.style) { + // Extend default style + this.style.extendFrom(defaults$$1.style, false); + } + + // Extend default shape + var defaultShape = defaults$$1.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$$1.init && defaults$$1.init.call(this, opts); + }; + + inherits(Sub, Path); + + // FIXME 不能 extend position, rotation 等引用对象 + for (var name in defaults$$1) { + // Extending prototype values and methods + if (name !== 'style' && name !== 'shape') { + Sub.prototype[name] = defaults$$1[name]; + } + } + + return Sub; +}; + +inherits(Path, Displayable); + +var CMD$2 = PathProxy.CMD; + +var points = [[], [], []]; +var mathSqrt$3 = Math.sqrt; +var mathAtan2 = Math.atan2; + +var transformPath = function (path, m) { + var data = path.data; + var cmd; + var nPoint; + var i; + var j; + var k; + var p; + + var M = CMD$2.M; + var C = CMD$2.C; + var L = CMD$2.L; + var R = CMD$2.R; + var A = CMD$2.A; + var Q = CMD$2.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$3(m[0] * m[0] + m[1] * m[1]); + var sy = mathSqrt$3(m[2] * m[2] + m[3] * m[3]); + var angle = mathAtan2(-m[1] / sy, m[0] / sx); + // cx + data[i] *= sx; + data[i++] += x; + // cy + data[i] *= sy; + 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++]; + applyTransform(p, p, m); + data[j++] = p[0]; + data[j++] = p[1]; + // x1, y1 + p[0] += data[i++]; + p[1] += data[i++]; + applyTransform(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++]; + + applyTransform(p, p, m); + // Write back + data[j++] = p[0]; + data[j++] = p[1]; + } + } +}; + +// 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); +} + + +var commandReg = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig; +// Consider case: +// (1) delimiter can be comma or space, where continuous commas +// or spaces should be seen as one comma. +// (2) value can be like: +// '2e-4', 'l.5.9' (ignore 0), 'M-10-10', 'l-2.43e-1,34.9983', +// 'l-.5E1,54', '121-23-44-11' (no delimiter) +var numberReg = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g; +// var valueSplitReg = /[\s,]+/; + +function createPathProxyFromString(data) { + if (!data) { + return new PathProxy(); + } + + // var data = 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]); + // } + + // data = data.replace(/-/g, ',-'); + + // create array + // var arr = cs.split('|'); + // init context point + var cpx = 0; + var cpy = 0; + var subpathX = cpx; + var subpathY = cpy; + var prevCmd; + + var path = new PathProxy(); + var CMD = PathProxy.CMD; + + // commandReg.lastIndex = 0; + // var cmdResult; + // while ((cmdResult = commandReg.exec(data)) != null) { + // var cmdStr = cmdResult[1]; + // var cmdContent = cmdResult[2]; + + var cmdList = data.match(commandReg); + for (var l = 0; l < cmdList.length; l++) { + var cmdText = cmdList[l]; + var cmdStr = cmdText.charAt(0); + + var cmd; + + // String#split is faster a little bit than String#replace or RegExp#exec. + // var p = cmdContent.split(valueSplitReg); + // var pLen = 0; + // for (var i = 0; i < p.length; i++) { + // // '' and other invalid str => NaN + // var val = parseFloat(p[i]); + // !isNaN(val) && (p[pLen++] = val); + // } + + var p = cmdText.match(numberReg) || []; + var pLen = p.length; + for (var i = 0; i < pLen; i++) { + p[i] = parseFloat(p[i]); + } + + var off = 0; + while (off < pLen) { + 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 (cmdStr) { + 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); + subpathX = cpx; + subpathY = cpy; + cmdStr = 'l'; + break; + case 'M': + cpx = p[off++]; + cpy = p[off++]; + cmd = CMD.M; + path.addData(cmd, cpx, cpy); + subpathX = cpx; + subpathY = cpy; + cmdStr = '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 (cmdStr === 'z' || cmdStr === 'Z') { + cmd = CMD.Z; + path.addData(cmd); + // z may be in the middle of the path. + cpx = subpathX; + cpy = subpathY; + } + + prevCmd = cmd; + } + + path.toStatic(); + + return path; +} + +// TODO Optimize double memory cost problem +function createPathOptions(str, opts) { + var pathProxy = createPathProxyFromString(str); + opts = opts || {}; + opts.buildPath = function (path) { + if (path.setData) { + path.setData(pathProxy.data); + // Svg and vml renderer don't have context + var ctx = path.getContext(); + if (ctx) { + path.rebuildPath(ctx); + } + } + else { + var ctx = path; + pathProxy.rebuildPath(ctx); + } + }; + + opts.applyTransform = function (m) { + transformPath(pathProxy, m); + this.dirty(true); + }; + + return opts; +} + +/** + * Create a Path object from path string data + * http://www.w3.org/TR/SVG/paths.html#PathData + * @param {Object} opts Other options + */ +function createFromString(str, opts) { + return new Path(createPathOptions(str, opts)); +} + +/** + * Create a Path class from path string data + * @param {string} str + * @param {Object} opts Other options + */ +function extendFromString(str, opts) { + return Path.extend(createPathOptions(str, opts)); +} + +/** + * Merge multiple paths + */ +// TODO Apply transform +// TODO stroke dash +// TODO Optimize double memory cost problem +function mergePath$1(pathEls, opts) { + var pathList = []; + var len = pathEls.length; + for (var i = 0; i < len; i++) { + var pathEl = pathEls[i]; + if (!pathEl.path) { + pathEl.createPathProxy(); + } + if (pathEl.__dirtyPath) { + pathEl.buildPath(pathEl.path, pathEl.shape, true); + } + pathList.push(pathEl.path); + } + + var pathBundle = new Path(opts); + // Need path proxy. + pathBundle.createPathProxy(); + 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; +} + +/** + * @alias zrender/graphic/Text + * @extends module:zrender/graphic/Displayable + * @constructor + * @param {Object} opts + */ +var Text = function (opts) { // jshint ignore:line + Displayable.call(this, opts); +}; + +Text.prototype = { + + constructor: Text, + + type: 'text', + + brush: function (ctx, prevEl) { + var style = this.style; + + // Optimize, avoid normalize every time. + this.__dirty && normalizeTextStyle(style, true); + + // Use props with prefix 'text'. + style.fill = style.stroke = style.shadowBlur = style.shadowColor = + style.shadowOffsetX = style.shadowOffsetY = null; + + var text = style.text; + // Convert to string + text != null && (text += ''); + + // Do not apply style.bind in Text node. Because the real bind job + // is in textHelper.renderText, and performance of text render should + // be considered. + // style.bind(ctx, this, prevEl); + + if (!needDrawText(text, style)) { + return; + } + + this.setTransform(ctx); + + renderText(this, ctx, text, style, null, prevEl); + + this.restoreTransform(ctx); + }, + + getBoundingRect: function () { + var style = this.style; + + // Optimize, avoid normalize every time. + this.__dirty && normalizeTextStyle(style, true); + + if (!this._rect) { + var text = style.text; + text != null ? (text += '') : (text = ''); + + var rect = getBoundingRect( + style.text + '', + style.font, + style.textAlign, + style.textVerticalAlign, + style.textPadding, + style.rich + ); + + rect.x += style.x || 0; + rect.y += style.y || 0; + + if (getStroke(style.textStroke, style.textStrokeWidth)) { + var w = style.textStrokeWidth; + rect.x -= w / 2; + rect.y -= w / 2; + rect.width += w; + rect.height += w; + } + + this._rect = rect; + } + + return this._rect; + } +}; + +inherits(Text, Displayable); + +/** + * 圆形 + * @module zrender/shape/Circle + */ + +var Circle = Path.extend({ + + type: 'circle', + + shape: { + cx: 0, + cy: 0, + r: 0 + }, + + + buildPath: function (ctx, shape, inBundle) { + // Better stroking in ShapeBundle + // Always do it may have performence issue ( fill may be 2x more cost) + if (inBundle) { + ctx.moveTo(shape.cx + shape.r, shape.cy); + } + // else { + // if (ctx.allocate && !ctx.data.length) { + // ctx.allocate(ctx.CMD_MEM_SIZE.A); + // } + // } + // 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); + } +}); + +// Fix weird bug in some version of IE11 (like 11.0.9600.178**), +// where exception "unexpected call to method or property access" +// might be thrown when calling ctx.fill or ctx.stroke after a path +// whose area size is zero is drawn and ctx.clip() is called and +// shadowBlur is set. See #4572, #3112, #5777. +// (e.g., +// ctx.moveTo(10, 10); +// ctx.lineTo(20, 10); +// ctx.closePath(); +// ctx.clip(); +// ctx.shadowBlur = 10; +// ... +// ctx.fill(); +// ) + +var shadowTemp = [ + ['shadowBlur', 0], + ['shadowColor', '#000'], + ['shadowOffsetX', 0], + ['shadowOffsetY', 0] +]; + +var fixClipWithShadow = function (orignalBrush) { + + // version string can be: '11.0' + return (env$1.browser.ie && env$1.browser.version >= 11) + + ? function () { + var clipPaths = this.__clipPaths; + var style = this.style; + var modified; + + if (clipPaths) { + for (var i = 0; i < clipPaths.length; i++) { + var clipPath = clipPaths[i]; + var shape = clipPath && clipPath.shape; + var type = clipPath && clipPath.type; + + if (shape && ( + (type === 'sector' && shape.startAngle === shape.endAngle) + || (type === 'rect' && (!shape.width || !shape.height)) + )) { + for (var j = 0; j < shadowTemp.length; j++) { + // It is save to put shadowTemp static, because shadowTemp + // will be all modified each item brush called. + shadowTemp[j][2] = style[shadowTemp[j][0]]; + style[shadowTemp[j][0]] = shadowTemp[j][1]; + } + modified = true; + break; + } + } + } + + orignalBrush.apply(this, arguments); + + if (modified) { + for (var j = 0; j < shadowTemp.length; j++) { + style[shadowTemp[j][0]] = shadowTemp[j][2]; + } + } + } + + : orignalBrush; +}; + +/** + * 扇形 + * @module zrender/graphic/shape/Sector + */ + +var Sector = Path.extend({ + + type: 'sector', + + shape: { + + cx: 0, + + cy: 0, + + r0: 0, + + r: 0, + + startAngle: 0, + + endAngle: Math.PI * 2, + + clockwise: true + }, + + brush: fixClipWithShadow(Path.prototype.brush), + + 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(); + } +}); + +/** + * 圆环 + * @module zrender/graphic/shape/Ring + */ + +var Ring = Path.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); + } +}); + +/** + * 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) + */ + +/** + * @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} + */ +var smoothSpline = function (points, isLoop) { + var len$$1 = points.length; + var ret = []; + + var distance$$1 = 0; + for (var i = 1; i < len$$1; i++) { + distance$$1 += distance(points[i - 1], points[i]); + } + + var segs = distance$$1 / 2; + segs = segs < len$$1 ? len$$1 : segs; + for (var i = 0; i < segs; i++) { + var pos = i / (segs - 1) * (isLoop ? len$$1 : len$$1 - 1); + var idx = Math.floor(pos); + + var w = pos - idx; + + var p0; + var p1 = points[idx % len$$1]; + var p2; + var p3; + if (!isLoop) { + p0 = points[idx === 0 ? idx : idx - 1]; + p2 = points[idx > len$$1 - 2 ? len$$1 - 1 : idx + 1]; + p3 = points[idx > len$$1 - 3 ? len$$1 - 1 : idx + 2]; + } + else { + p0 = points[(idx - 1 + len$$1) % len$$1]; + p2 = points[(idx + 1) % len$$1]; + p3 = points[(idx + 2) % len$$1]; + } + + 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; +}; + +/** + * 贝塞尔平滑曲线 + * @module zrender/shape/util/smoothBezier + * @author pissang (https://www.github.com/pissang) + * Kener (@Kener-林峰, kener.linfeng@gmail.com) + * errorrik (errorrik@gmail.com) + */ + +/** + * 贝塞尔平滑曲线 + * @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} 计算出来的控制点数组 + */ +var smoothBezier = function (points, smooth, isLoop, constraint) { + var cps = []; + + var v = []; + var v1 = []; + var v2 = []; + var prevPoint; + var nextPoint; + + var min$$1, max$$1; + if (constraint) { + min$$1 = [Infinity, Infinity]; + max$$1 = [-Infinity, -Infinity]; + for (var i = 0, len$$1 = points.length; i < len$$1; i++) { + min(min$$1, min$$1, points[i]); + max(max$$1, max$$1, points[i]); + } + // 与指定的包围盒做并集 + min(min$$1, min$$1, constraint[0]); + max(max$$1, max$$1, constraint[1]); + } + + for (var i = 0, len$$1 = points.length; i < len$$1; i++) { + var point = points[i]; + + if (isLoop) { + prevPoint = points[i ? i - 1 : len$$1 - 1]; + nextPoint = points[(i + 1) % len$$1]; + } + else { + if (i === 0 || i === len$$1 - 1) { + cps.push(clone$1(points[i])); + continue; + } + else { + prevPoint = points[i - 1]; + nextPoint = points[i + 1]; + } + } + + sub(v, nextPoint, prevPoint); + + // use degree to scale the handle length + scale(v, v, smooth); + + var d0 = distance(point, prevPoint); + var d1 = distance(point, nextPoint); + var sum = d0 + d1; + if (sum !== 0) { + d0 /= sum; + d1 /= sum; + } + + scale(v1, v, -d0); + scale(v2, v, d1); + var cp0 = add([], point, v1); + var cp1 = add([], point, v2); + if (constraint) { + max(cp0, cp0, min$$1); + min(cp0, cp0, max$$1); + max(cp1, cp1, min$$1); + min(cp1, cp1, max$$1); + } + cps.push(cp0); + cps.push(cp1); + } + + if (isLoop) { + cps.push(cps.shift()); + } + + return cps; +}; + +function buildPath$1(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(); + } +} + +/** + * 多边形 + * @module zrender/shape/Polygon + */ + +var Polygon = Path.extend({ + + type: 'polygon', + + shape: { + points: null, + + smooth: false, + + smoothConstraint: null + }, + + buildPath: function (ctx, shape) { + buildPath$1(ctx, shape, true); + } +}); + +/** + * @module zrender/graphic/shape/Polyline + */ + +var Polyline = Path.extend({ + + type: 'polyline', + + shape: { + points: null, + + smooth: false, + + smoothConstraint: null + }, + + style: { + stroke: '#000', + + fill: null + }, + + buildPath: function (ctx, shape) { + buildPath$1(ctx, shape, false); + } +}); + +/** + * 矩形 + * @module zrender/graphic/shape/Rect + */ + +var Rect = Path.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 { + buildPath(ctx, shape); + } + ctx.closePath(); + return; + } +}); + +/** + * 直线 + * @module zrender/graphic/shape/Line + */ + +var Line = Path.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.} + */ + pointAt: function (p) { + var shape = this.shape; + return [ + shape.x1 * (1 - p) + shape.x2 * p, + shape.y1 * (1 - p) + shape.y2 * p + ]; + } +}); + +/** + * 贝塞尔曲线 + * @module zrender/shape/BezierCurve + */ + +var out = []; + +function someVectorAt(shape, t, isTangent) { + var cpx2 = shape.cpx2; + var cpy2 = shape.cpy2; + if (cpx2 === null || cpy2 === null) { + return [ + (isTangent ? cubicDerivativeAt : cubicAt)(shape.x1, shape.cpx1, shape.cpx2, shape.x2, t), + (isTangent ? cubicDerivativeAt : cubicAt)(shape.y1, shape.cpy1, shape.cpy2, shape.y2, t) + ]; + } + else { + return [ + (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.x1, shape.cpx1, shape.x2, t), + (isTangent ? quadraticDerivativeAt : quadraticAt)(shape.y1, shape.cpy1, shape.y2, t) + ]; + } +} + +var BezierCurve = Path.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} t + * @return {Array.} + */ + pointAt: function (t) { + return someVectorAt(this.shape, t, false); + }, + + /** + * Get tangent at percent + * @param {number} t + * @return {Array.} + */ + tangentAt: function (t) { + var p = someVectorAt(this.shape, t, true); + return normalize(p, p); + } +}); + +/** + * 圆弧 + * @module zrender/graphic/shape/Arc + */ + +var Arc = Path.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); + } +}); + +// CompoundPath to improve performance + +var CompoundPath = Path.extend({ + + type: 'compound', + + shape: { + + paths: null + }, + + _updatePathDirty: function () { + var dirtyPath = this.__dirtyPath; + var paths = this.shape.paths; + for (var i = 0; i < paths.length; i++) { + // Mark as dirty if any subpath is dirty + dirtyPath = dirtyPath || paths[i].__dirtyPath; + } + this.__dirtyPath = dirtyPath; + this.__dirty = this.__dirty || dirtyPath; + }, + + beforeBrush: function () { + this._updatePathDirty(); + var paths = this.shape.paths || []; + var scale = this.getGlobalScale(); + // Update path scale + for (var i = 0; i < paths.length; i++) { + if (!paths[i].path) { + paths[i].createPathProxy(); + } + paths[i].path.setScale(scale[0], scale[1]); + } + }, + + buildPath: function (ctx, shape) { + var paths = shape.paths || []; + for (var i = 0; i < paths.length; i++) { + paths[i].buildPath(ctx, paths[i].shape, true); + } + }, + + afterBrush: function () { + var paths = this.shape.paths || []; + for (var i = 0; i < paths.length; i++) { + paths[i].__dirtyPath = false; + } + }, + + getBoundingRect: function () { + this._updatePathDirty(); + return Path.prototype.getBoundingRect.call(this); + } +}); + +/** + * @param {Array.} colorStops + */ +var Gradient = function (colorStops) { + + this.colorStops = colorStops || []; + +}; + +Gradient.prototype = { + + constructor: Gradient, + + addColorStop: function (offset, color) { + this.colorStops.push({ + + offset: offset, + + color: color + }); + } + +}; + +/** + * 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.} colorStops + * @param {boolean} [globalCoord=false] + */ +var LinearGradient = function (x, y, x2, y2, colorStops, globalCoord) { + // Should do nothing more in this constructor. Because gradient can be + // declard by `color: {type: 'linear', colorStops: ...}`, where + // this constructor will not be called. + + this.x = x == null ? 0 : x; + + this.y = y == null ? 0 : y; + + this.x2 = x2 == null ? 1 : x2; + + this.y2 = y2 == null ? 0 : y2; + + // Can be cloned + this.type = 'linear'; + + // If use global coord + this.global = globalCoord || false; + + Gradient.call(this, colorStops); +}; + +LinearGradient.prototype = { + + constructor: LinearGradient +}; + +inherits(LinearGradient, Gradient); + +/** + * 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.} [colorStops] + * @param {boolean} [globalCoord=false] + */ +var RadialGradient = function (x, y, r, colorStops, globalCoord) { + // Should do nothing more in this constructor. Because gradient can be + // declard by `color: {type: 'radial', colorStops: ...}`, where + // this constructor will not be called. + + this.x = x == null ? 0.5 : x; + + this.y = y == null ? 0.5 : y; + + this.r = r == null ? 0.5 : r; + + // Can be cloned + this.type = 'radial'; + + // If use global coord + this.global = globalCoord || false; + + Gradient.call(this, colorStops); +}; + +RadialGradient.prototype = { + + constructor: RadialGradient +}; + +inherits(RadialGradient, Gradient); + +/** + * Displayable for incremental rendering. It will be rendered in a separate layer + * IncrementalDisplay have too main methods. `clearDisplayables` and `addDisplayables` + * addDisplayables will render the added displayables incremetally. + * + * It use a not clearFlag to tell the painter don't clear the layer if it's the first element. + */ +// TODO Style override ? +function IncrementalDisplayble(opts) { + + Displayable.call(this, opts); + + this._displayables = []; + + this._temporaryDisplayables = []; + + this._cursor = 0; + + this.notClear = true; +} + +IncrementalDisplayble.prototype.incremental = true; + +IncrementalDisplayble.prototype.clearDisplaybles = function () { + this._displayables = []; + this._temporaryDisplayables = []; + this._cursor = 0; + this.dirty(); + + this.notClear = false; +}; + +IncrementalDisplayble.prototype.addDisplayable = function (displayable, notPersistent) { + if (notPersistent) { + this._temporaryDisplayables.push(displayable); + } + else { + this._displayables.push(displayable); + } + this.dirty(); +}; + +IncrementalDisplayble.prototype.addDisplayables = function (displayables, notPersistent) { + notPersistent = notPersistent || false; + for (var i = 0; i < displayables.length; i++) { + this.addDisplayable(displayables[i], notPersistent); + } +}; + +IncrementalDisplayble.prototype.eachPendingDisplayable = function (cb) { + for (var i = this._cursor; i < this._displayables.length; i++) { + cb && cb(this._displayables[i]); + } + for (var i = 0; i < this._temporaryDisplayables.length; i++) { + cb && cb(this._temporaryDisplayables[i]); + } +}; + +IncrementalDisplayble.prototype.update = function () { + this.updateTransform(); + for (var i = this._cursor; i < this._displayables.length; i++) { + var displayable = this._displayables[i]; + // PENDING + displayable.parent = this; + displayable.update(); + displayable.parent = null; + } + for (var i = 0; i < this._temporaryDisplayables.length; i++) { + var displayable = this._temporaryDisplayables[i]; + // PENDING + displayable.parent = this; + displayable.update(); + displayable.parent = null; + } +}; + +IncrementalDisplayble.prototype.brush = function (ctx, prevEl) { + // Render persistant displayables. + for (var i = this._cursor; i < this._displayables.length; i++) { + var displayable = this._displayables[i]; + displayable.beforeBrush && displayable.beforeBrush(ctx); + displayable.brush(ctx, i === this._cursor ? null : this._displayables[i - 1]); + displayable.afterBrush && displayable.afterBrush(ctx); + } + this._cursor = i; + // Render temporary displayables. + for (var i = 0; i < this._temporaryDisplayables.length; i++) { + var displayable = this._temporaryDisplayables[i]; + displayable.beforeBrush && displayable.beforeBrush(ctx); + displayable.brush(ctx, i === 0 ? null : this._temporaryDisplayables[i - 1]); + displayable.afterBrush && displayable.afterBrush(ctx); + } + + this._temporaryDisplayables = []; + + this.notClear = true; +}; + +var m = []; +IncrementalDisplayble.prototype.getBoundingRect = function () { + if (!this._rect) { + var rect = new BoundingRect(Infinity, Infinity, -Infinity, -Infinity); + for (var i = 0; i < this._displayables.length; i++) { + var displayable = this._displayables[i]; + var childRect = displayable.getBoundingRect().clone(); + if (displayable.needLocalTransform()) { + childRect.applyTransform(displayable.getLocalTransform(m)); + } + rect.union(childRect); + } + this._rect = rect; + } + return this._rect; +}; + +IncrementalDisplayble.prototype.contain = function (x, y) { + var localPos = this.transformCoordToLocal(x, y); + var rect = this.getBoundingRect(); + + if (rect.contain(localPos[0], localPos[1])) { + for (var i = 0; i < this._displayables.length; i++) { + var displayable = this._displayables[i]; + if (displayable.contain(x, y)) { + return true; + } + } + } + return false; +}; + +inherits(IncrementalDisplayble, Displayable); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 round = Math.round; +var mathMax$1 = Math.max; +var mathMin$1 = Math.min; + +var EMPTY_OBJ = {}; + +/** + * Extend shape with parameters + */ +function extendShape(opts) { + return Path.extend(opts); +} + +/** + * Extend path + */ +function extendPath(pathData, opts) { + return 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' + */ +function makePath(pathData, opts, rect, layout) { + var path = createFromString(pathData, opts); + var boundingRect = path.getBoundingRect(); + if (rect) { + if (layout === 'center') { + rect = centerGraphic(rect, boundingRect); + } + + resizePath(path, rect); + } + return path; +} + +/** + * Create a image element from image url + * @param {string} imageUrl image url + * @param {Object} opts options + * @param {module:zrender/core/BoundingRect} rect constrain rect + * @param {string} [layout=cover] 'center' or 'cover' + */ +function makeImage(imageUrl, rect, layout) { + var path = new ZImage({ + style: { + image: imageUrl, + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + onload: function (img) { + if (layout === 'center') { + var boundingRect = { + width: img.width, + height: img.height + }; + path.setStyle(centerGraphic(rect, boundingRect)); + } + } + }); + return path; +} + +/** + * Get position of centered element in bounding box. + * + * @param {Object} rect element local bounding box + * @param {Object} boundingRect constraint bounding box + * @return {Object} element position containing x, y, width, and height + */ +function centerGraphic(rect, boundingRect) { + // Set rect to center, keep width / height ratio. + var aspect = boundingRect.width / boundingRect.height; + 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; + + return { + x: cx - width / 2, + y: cy - height / 2, + width: width, + height: height + }; +} + +var mergePath = mergePath$1; + +/** + * Resize a path to fit the rect + * @param {module:zrender/graphic/Path} path + * @param {Object} rect + */ +function resizePath(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 + */ +function subPixelOptimizeLine(param) { + 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 + */ +function subPixelOptimizeRect(param) { + 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. + */ +function subPixelOptimize(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; +} + +function hasFillOrStroke(fillOrStroke) { + return fillOrStroke != null && fillOrStroke != 'none'; +} + +// Most lifted color are duplicated. +var liftedColorMap = createHashMap(); +var liftedColorCount = 0; + +function liftColor(color) { + if (typeof color !== 'string') { + return color; + } + var liftedColor = liftedColorMap.get(color); + if (!liftedColor) { + liftedColor = lift(color, -0.1); + if (liftedColorCount < 10000) { + liftedColorMap.set(color, liftedColor); + liftedColorCount++; + } + } + return liftedColor; +} + +function cacheElementStl(el) { + if (!el.__hoverStlDirty) { + return; + } + el.__hoverStlDirty = false; + + var hoverStyle = el.__hoverStl; + if (!hoverStyle) { + el.__normalStl = null; + return; + } + + var normalStyle = el.__normalStl = {}; + var elStyle = el.style; + + for (var name in hoverStyle) { + // See comment in `doSingleEnterHover`. + if (hoverStyle[name] != null) { + normalStyle[name] = elStyle[name]; + } + } + + // Always cache fill and stroke to normalStyle for lifting color. + normalStyle.fill = elStyle.fill; + normalStyle.stroke = elStyle.stroke; +} + +function doSingleEnterHover(el) { + var hoverStl = el.__hoverStl; + + if (!hoverStl || el.__highlighted) { + return; + } + + var useHoverLayer = el.useHoverLayer; + el.__highlighted = useHoverLayer ? 'layer' : 'plain'; + + var zr = el.__zr; + if (!zr && useHoverLayer) { + return; + } + + var elTarget = el; + var targetStyle = el.style; + + if (useHoverLayer) { + elTarget = zr.addHover(el); + targetStyle = elTarget.style; + } + + // Consider case: only `position: 'top'` is set on emphasis, then text + // color should be returned to `autoColor`, rather than remain '#fff'. + // So we should rollback then apply again after style merging. + rollbackDefaultTextStyle(targetStyle); + + if (!useHoverLayer) { + cacheElementStl(elTarget); + } + + // styles can be: + // { + // label: { + // show: false, + // position: 'outside', + // fontSize: 18 + // }, + // emphasis: { + // label: { + // show: true + // } + // } + // }, + // where properties of `emphasis` may not appear in `normal`. We previously use + // module:echarts/util/model#defaultEmphasis to merge `normal` to `emphasis`. + // But consider rich text and setOption in merge mode, it is impossible to cover + // all properties in merge. So we use merge mode when setting style here, where + // only properties that is not `null/undefined` can be set. The disadventage: + // null/undefined can not be used to remove style any more in `emphasis`. + targetStyle.extendFrom(hoverStl); + + setDefaultHoverFillStroke(targetStyle, hoverStl, 'fill'); + setDefaultHoverFillStroke(targetStyle, hoverStl, 'stroke'); + + applyDefaultTextStyle(targetStyle); + + if (!useHoverLayer) { + el.dirty(false); + el.z2 += 1; + } +} + +function setDefaultHoverFillStroke(targetStyle, hoverStyle, prop) { + if (!hasFillOrStroke(hoverStyle[prop]) && hasFillOrStroke(targetStyle[prop])) { + targetStyle[prop] = liftColor(targetStyle[prop]); + } +} + +function doSingleLeaveHover(el) { + if (el.__highlighted) { + doSingleRestoreHoverStyle(el); + el.__highlighted = false; + } +} + +function doSingleRestoreHoverStyle(el) { + var highlighted = el.__highlighted; + + if (highlighted === 'layer') { + el.__zr && el.__zr.removeHover(el); + } + else if (highlighted) { + var style = el.style; + var normalStl = el.__normalStl; + + if (normalStl) { + rollbackDefaultTextStyle(style); + + // Consider null/undefined value, should use + // `setStyle` but not `extendFrom(stl, true)`. + el.setStyle(normalStl); + + applyDefaultTextStyle(style); + + el.z2 -= 1; + } + } +} + +function traverseCall(el, method) { + el.isGroup + ? el.traverse(function (child) { + !child.isGroup && method(child); + }) + : method(el); +} + +/** + * Set hover style of element. + * + * @param {module:zrender/Element} el Should not be `zrender/container/Group`. + * @param {Object|boolean} [hoverStl] The specified hover style. + * If set as `false`, disable the hover style. + * Similarly, The `el.hoverStyle` can alse be set + * as `false` to disable the hover style. + * Otherwise, use the default hover style if not provided. + * @param {Object} [opt] + * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger` + */ +function setElementHoverStyle(el, hoverStl) { + hoverStl = el.__hoverStl = hoverStl !== false && (hoverStl || {}); + el.__hoverStlDirty = true; + + if (el.__highlighted) { + doSingleLeaveHover(el); + doSingleEnterHover(el); + } +} + +/** + * @param {module:zrender/Element} el + * @return {boolean} + */ +function isInEmphasis(el) { + return el && el.__isEmphasis; +} + +function onElementMouseOver(e) { + if (this.__hoverSilentOnTouch && e.zrByTouch) { + return; + } + + // Only if element is not in emphasis status + !this.__isEmphasis && traverseCall(this, doSingleEnterHover); +} + +function onElementMouseOut(e) { + if (this.__hoverSilentOnTouch && e.zrByTouch) { + return; + } + + // Only if element is not in emphasis status + !this.__isEmphasis && traverseCall(this, doSingleLeaveHover); +} + +function enterEmphasis() { + this.__isEmphasis = true; + traverseCall(this, doSingleEnterHover); +} + +function leaveEmphasis() { + this.__isEmphasis = false; + traverseCall(this, doSingleLeaveHover); +} + +/** + * Set hover style of element. + * + * [Caveat]: + * This method can be called repeatly and achieve the same result. + * + * [Usage]: + * Call the method for a "root" element once. Do not call it for each descendants. + * If the descendants elemenets of a group has itself hover style different from the + * root group, we can simply mount the style on `el.hoverStyle` for them, but should + * not call this method for them. + * + * @param {module:zrender/Element} el + * @param {Object|boolean} [hoverStyle] See `graphic.setElementHoverStyle`. + * @param {Object} [opt] + * @param {boolean} [opt.hoverSilentOnTouch=false] See `graphic.setAsHoverStyleTrigger`. + */ +function setHoverStyle(el, hoverStyle, opt) { + el.isGroup + ? el.traverse(function (child) { + // 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 + !child.isGroup && setElementHoverStyle(child, child.hoverStyle || hoverStyle); + }) + : setElementHoverStyle(el, el.hoverStyle || hoverStyle); + + setAsHoverStyleTrigger(el, opt); +} + +/** + * @param {Object|boolean} [opt] If `false`, means disable trigger. + * @param {boolean} [opt.hoverSilentOnTouch=false] + * In touch device, mouseover event will be trigger on touchstart event + * (see module:zrender/dom/HandlerProxy). By this mechanism, we can + * conveniently use hoverStyle when tap on touch screen without additional + * code for compatibility. + * But if the chart/component has select feature, which usually also use + * hoverStyle, there might be conflict between 'select-highlight' and + * 'hover-highlight' especially when roam is enabled (see geo for example). + * In this case, hoverSilentOnTouch should be used to disable hover-highlight + * on touch device. + */ +function setAsHoverStyleTrigger(el, opt) { + var disable = opt === false; + el.__hoverSilentOnTouch = opt != null && opt.hoverSilentOnTouch; + + // Simple optimize, since this method might be + // called for each elements of a group in some cases. + if (!disable || el.__hoverStyleTrigger) { + var method = disable ? 'off' : 'on'; + + // Duplicated function will be auto-ignored, see Eventful.js. + el[method]('mouseover', onElementMouseOver)[method]('mouseout', onElementMouseOut); + // Emphasis, normal can be triggered manually + el[method]('emphasis', enterEmphasis)[method]('normal', leaveEmphasis); + + el.__hoverStyleTrigger = !disable; + } +} + +/** + * @param {Object|module:zrender/graphic/Style} normalStyle + * @param {Object} emphasisStyle + * @param {module:echarts/model/Model} normalModel + * @param {module:echarts/model/Model} emphasisModel + * @param {Object} opt Check `opt` of `setTextStyleCommon` to find other props. + * @param {string|Function} [opt.defaultText] + * @param {module:echarts/model/Model} [opt.labelFetcher] Fetch text by + * `opt.labelFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)` + * @param {module:echarts/model/Model} [opt.labelDataIndex] Fetch text by + * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)` + * @param {module:echarts/model/Model} [opt.labelDimIndex] Fetch text by + * `opt.textFetcher.getFormattedLabel(opt.labelDataIndex, 'normal'/'emphasis', null, opt.labelDimIndex)` + * @param {Object} [normalSpecified] + * @param {Object} [emphasisSpecified] + */ +function setLabelStyle( + normalStyle, emphasisStyle, + normalModel, emphasisModel, + opt, + normalSpecified, emphasisSpecified +) { + opt = opt || EMPTY_OBJ; + var labelFetcher = opt.labelFetcher; + var labelDataIndex = opt.labelDataIndex; + var labelDimIndex = opt.labelDimIndex; + + // This scenario, `label.normal.show = true; label.emphasis.show = false`, + // is not supported util someone requests. + + var showNormal = normalModel.getShallow('show'); + var showEmphasis = emphasisModel.getShallow('show'); + + // Consider performance, only fetch label when necessary. + // If `normal.show` is `false` and `emphasis.show` is `true` and `emphasis.formatter` is not set, + // label should be displayed, where text is fetched by `normal.formatter` or `opt.defaultText`. + var baseText; + if (showNormal || showEmphasis) { + if (labelFetcher) { + baseText = labelFetcher.getFormattedLabel(labelDataIndex, 'normal', null, labelDimIndex); + } + if (baseText == null) { + baseText = isFunction$1(opt.defaultText) ? opt.defaultText(labelDataIndex, opt) : opt.defaultText; + } + } + var normalStyleText = showNormal ? baseText : null; + var emphasisStyleText = showEmphasis + ? retrieve2( + labelFetcher + ? labelFetcher.getFormattedLabel(labelDataIndex, 'emphasis', null, labelDimIndex) + : null, + baseText + ) + : null; + + // Optimize: If style.text is null, text will not be drawn. + if (normalStyleText != null || emphasisStyleText != null) { + // Always set `textStyle` even if `normalStyle.text` is null, because default + // values have to be set on `normalStyle`. + // If we set default values on `emphasisStyle`, consider case: + // Firstly, `setOption(... label: {normal: {text: null}, emphasis: {show: true}} ...);` + // Secondly, `setOption(... label: {noraml: {show: true, text: 'abc', color: 'red'} ...);` + // Then the 'red' will not work on emphasis. + setTextStyle(normalStyle, normalModel, normalSpecified, opt); + setTextStyle(emphasisStyle, emphasisModel, emphasisSpecified, opt, true); + } + + normalStyle.text = normalStyleText; + emphasisStyle.text = emphasisStyleText; +} + +/** + * Set basic textStyle properties. + * @param {Object|module:zrender/graphic/Style} textStyle + * @param {module:echarts/model/Model} model + * @param {Object} [specifiedTextStyle] Can be overrided by settings in model. + * @param {Object} [opt] See `opt` of `setTextStyleCommon`. + * @param {boolean} [isEmphasis] + */ +function setTextStyle( + textStyle, textStyleModel, specifiedTextStyle, opt, isEmphasis +) { + setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis); + specifiedTextStyle && extend(textStyle, specifiedTextStyle); + // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false); + + return textStyle; +} + +/** + * Set text option in the style. + * @deprecated + * @param {Object} textStyle + * @param {module:echarts/model/Model} labelModel + * @param {string|boolean} defaultColor Default text color. + * If set as false, it will be processed as a emphasis style. + */ +function setText(textStyle, labelModel, defaultColor) { + var opt = {isRectText: true}; + var isEmphasis; + + if (defaultColor === false) { + isEmphasis = true; + } + else { + // Support setting color as 'auto' to get visual color. + opt.autoColor = defaultColor; + } + setTextStyleCommon(textStyle, labelModel, opt, isEmphasis); + // textStyle.host && textStyle.host.dirty && textStyle.host.dirty(false); +} + +/** + * { + * disableBox: boolean, Whether diable drawing box of block (outer most). + * isRectText: boolean, + * autoColor: string, specify a color when color is 'auto', + * for textFill, textStroke, textBackgroundColor, and textBorderColor. + * If autoColor specified, it is used as default textFill. + * useInsideStyle: + * `true`: Use inside style (textFill, textStroke, textStrokeWidth) + * if `textFill` is not specified. + * `false`: Do not use inside style. + * `null/undefined`: use inside style if `isRectText` is true and + * `textFill` is not specified and textPosition contains `'inside'`. + * forceRich: boolean + * } + */ +function setTextStyleCommon(textStyle, textStyleModel, opt, isEmphasis) { + // Consider there will be abnormal when merge hover style to normal style if given default value. + opt = opt || EMPTY_OBJ; + + if (opt.isRectText) { + var textPosition = textStyleModel.getShallow('position') + || (isEmphasis ? null : 'inside'); + // 'outside' is not a valid zr textPostion value, but used + // in bar series, and magric type should be considered. + textPosition === 'outside' && (textPosition = 'top'); + textStyle.textPosition = textPosition; + textStyle.textOffset = textStyleModel.getShallow('offset'); + var labelRotate = textStyleModel.getShallow('rotate'); + labelRotate != null && (labelRotate *= Math.PI / 180); + textStyle.textRotation = labelRotate; + textStyle.textDistance = retrieve2( + textStyleModel.getShallow('distance'), isEmphasis ? null : 5 + ); + } + + var ecModel = textStyleModel.ecModel; + var globalTextStyle = ecModel && ecModel.option.textStyle; + + // Consider case: + // { + // data: [{ + // value: 12, + // label: { + // rich: { + // // no 'a' here but using parent 'a'. + // } + // } + // }], + // rich: { + // a: { ... } + // } + // } + var richItemNames = getRichItemNames(textStyleModel); + var richResult; + if (richItemNames) { + richResult = {}; + for (var name in richItemNames) { + if (richItemNames.hasOwnProperty(name)) { + // Cascade is supported in rich. + var richTextStyle = textStyleModel.getModel(['rich', name]); + // In rich, never `disableBox`. + setTokenTextStyle(richResult[name] = {}, richTextStyle, globalTextStyle, opt, isEmphasis); + } + } + } + textStyle.rich = richResult; + + setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEmphasis, true); + + if (opt.forceRich && !opt.textStyle) { + opt.textStyle = {}; + } + + return textStyle; +} + +// Consider case: +// { +// data: [{ +// value: 12, +// label: { +// rich: { +// // no 'a' here but using parent 'a'. +// } +// } +// }], +// rich: { +// a: { ... } +// } +// } +function getRichItemNames(textStyleModel) { + // Use object to remove duplicated names. + var richItemNameMap; + while (textStyleModel && textStyleModel !== textStyleModel.ecModel) { + var rich = (textStyleModel.option || EMPTY_OBJ).rich; + if (rich) { + richItemNameMap = richItemNameMap || {}; + for (var name in rich) { + if (rich.hasOwnProperty(name)) { + richItemNameMap[name] = 1; + } + } + } + textStyleModel = textStyleModel.parentModel; + } + return richItemNameMap; +} + +function setTokenTextStyle(textStyle, textStyleModel, globalTextStyle, opt, isEmphasis, isBlock) { + // In merge mode, default value should not be given. + globalTextStyle = !isEmphasis && globalTextStyle || EMPTY_OBJ; + + textStyle.textFill = getAutoColor(textStyleModel.getShallow('color'), opt) + || globalTextStyle.color; + textStyle.textStroke = getAutoColor(textStyleModel.getShallow('textBorderColor'), opt) + || globalTextStyle.textBorderColor; + textStyle.textStrokeWidth = retrieve2( + textStyleModel.getShallow('textBorderWidth'), + globalTextStyle.textBorderWidth + ); + + // Save original textPosition, because style.textPosition will be repalced by + // real location (like [10, 30]) in zrender. + textStyle.insideRawTextPosition = textStyle.textPosition; + + if (!isEmphasis) { + if (isBlock) { + textStyle.insideRollbackOpt = opt; + applyDefaultTextStyle(textStyle); + } + + // Set default finally. + if (textStyle.textFill == null) { + textStyle.textFill = opt.autoColor; + } + } + + // Do not use `getFont` here, because merge should be supported, where + // part of these properties may be changed in emphasis style, and the + // others should remain their original value got from normal style. + textStyle.fontStyle = textStyleModel.getShallow('fontStyle') || globalTextStyle.fontStyle; + textStyle.fontWeight = textStyleModel.getShallow('fontWeight') || globalTextStyle.fontWeight; + textStyle.fontSize = textStyleModel.getShallow('fontSize') || globalTextStyle.fontSize; + textStyle.fontFamily = textStyleModel.getShallow('fontFamily') || globalTextStyle.fontFamily; + + textStyle.textAlign = textStyleModel.getShallow('align'); + textStyle.textVerticalAlign = textStyleModel.getShallow('verticalAlign') + || textStyleModel.getShallow('baseline'); + + textStyle.textLineHeight = textStyleModel.getShallow('lineHeight'); + textStyle.textWidth = textStyleModel.getShallow('width'); + textStyle.textHeight = textStyleModel.getShallow('height'); + textStyle.textTag = textStyleModel.getShallow('tag'); + + if (!isBlock || !opt.disableBox) { + textStyle.textBackgroundColor = getAutoColor(textStyleModel.getShallow('backgroundColor'), opt); + textStyle.textPadding = textStyleModel.getShallow('padding'); + textStyle.textBorderColor = getAutoColor(textStyleModel.getShallow('borderColor'), opt); + textStyle.textBorderWidth = textStyleModel.getShallow('borderWidth'); + textStyle.textBorderRadius = textStyleModel.getShallow('borderRadius'); + + textStyle.textBoxShadowColor = textStyleModel.getShallow('shadowColor'); + textStyle.textBoxShadowBlur = textStyleModel.getShallow('shadowBlur'); + textStyle.textBoxShadowOffsetX = textStyleModel.getShallow('shadowOffsetX'); + textStyle.textBoxShadowOffsetY = textStyleModel.getShallow('shadowOffsetY'); + } + + textStyle.textShadowColor = textStyleModel.getShallow('textShadowColor') + || globalTextStyle.textShadowColor; + textStyle.textShadowBlur = textStyleModel.getShallow('textShadowBlur') + || globalTextStyle.textShadowBlur; + textStyle.textShadowOffsetX = textStyleModel.getShallow('textShadowOffsetX') + || globalTextStyle.textShadowOffsetX; + textStyle.textShadowOffsetY = textStyleModel.getShallow('textShadowOffsetY') + || globalTextStyle.textShadowOffsetY; +} + +function getAutoColor(color, opt) { + return color !== 'auto' ? color : (opt && opt.autoColor) ? opt.autoColor : null; +} + +// When text position is `inside` and `textFill` not specified, we +// provide a mechanism to auto make text border for better view. But +// text position changing when hovering or being emphasis should be +// considered, where the `insideRollback` enables to restore the style. +function applyDefaultTextStyle(textStyle) { + if (textStyle.textFill != null) { + return; + } + + var opt = textStyle.insideRollbackOpt; + var useInsideStyle = opt.useInsideStyle; + var textPosition = textStyle.insideRawTextPosition; + var insideRollback; + var autoColor = opt.autoColor; + + if (useInsideStyle !== false + && (useInsideStyle === true + || (opt.isRectText + && textPosition + // textPosition can be [10, 30] + && typeof textPosition === 'string' + && textPosition.indexOf('inside') >= 0 + ) + ) + ) { + insideRollback = { + textFill: null, + textStroke: textStyle.textStroke, + textStrokeWidth: textStyle.textStrokeWidth + }; + textStyle.textFill = '#fff'; + // Consider text with #fff overflow its container. + if (textStyle.textStroke == null) { + textStyle.textStroke = autoColor; + textStyle.textStrokeWidth == null && (textStyle.textStrokeWidth = 2); + } + } + else if (autoColor != null) { + insideRollback = {textFill: null}; + textStyle.textFill = autoColor; + } + + // Always set `insideRollback`, for clearing previous. + if (insideRollback) { + textStyle.insideRollback = insideRollback; + } +} + +function rollbackDefaultTextStyle(style) { + var insideRollback = style.insideRollback; + if (insideRollback) { + style.textFill = insideRollback.textFill; + style.textStroke = insideRollback.textStroke; + style.textStrokeWidth = insideRollback.textStrokeWidth; + style.insideRollback = null; + } +} + +function getFont(opt, ecModel) { + // ecModel or default text style model. + var gTextStyleModel = ecModel || ecModel.getModel('textStyle'); + return trim([ + // FIXME in node-canvas fontWeight is before fontStyle + opt.fontStyle || gTextStyleModel && gTextStyleModel.getShallow('fontStyle') || '', + opt.fontWeight || gTextStyleModel && gTextStyleModel.getShallow('fontWeight') || '', + (opt.fontSize || gTextStyleModel && gTextStyleModel.getShallow('fontSize') || 12) + 'px', + opt.fontFamily || gTextStyleModel && gTextStyleModel.getShallow('fontFamily') || 'sans-serif' + ].join(' ')); +} + +function animateOrSetProps(isUpdate, el, props, animatableModel, dataIndex, cb) { + if (typeof dataIndex === 'function') { + cb = dataIndex; + dataIndex = null; + } + // Do not check 'animation' property directly here. Consider this case: + // animation model is an `itemModel`, whose does not have `isAnimationEnabled` + // but its parent model (`seriesModel`) does. + var animationEnabled = animatableModel && animatableModel.isAnimationEnabled(); + + if (animationEnabled) { + var postfix = isUpdate ? 'Update' : ''; + var duration = animatableModel.getShallow('animationDuration' + postfix); + var animationEasing = animatableModel.getShallow('animationEasing' + postfix); + var animationDelay = animatableModel.getShallow('animationDelay' + postfix); + if (typeof animationDelay === 'function') { + animationDelay = animationDelay( + dataIndex, + animatableModel.getAnimationDelayParams + ? animatableModel.getAnimationDelayParams(el, dataIndex) + : null + ); + } + if (typeof duration === 'function') { + duration = duration(dataIndex); + } + + duration > 0 + ? el.animateTo(props, duration, animationDelay || 0, animationEasing, cb, !!cb) + : (el.stopAnimation(), el.attr(props), cb && cb()); + } + else { + el.stopAnimation(); + el.attr(props); + cb && cb(); + } +} + +/** + * Update graphic element properties with or without animation according to the + * configuration in series. + * + * Caution: this method will stop previous animation. + * So if do not use this method to one element twice before + * animation starts, unless you know what you are doing. + * + * @param {module:zrender/Element} el + * @param {Object} props + * @param {module:echarts/model/Model} [animatableModel] + * @param {number} [dataIndex] + * @param {Function} [cb] + * @example + * graphic.updateProps(el, { + * position: [100, 100] + * }, seriesModel, dataIndex, function () { console.log('Animation done!'); }); + * // Or + * graphic.updateProps(el, { + * position: [100, 100] + * }, seriesModel, function () { console.log('Animation done!'); }); + */ +function updateProps(el, props, animatableModel, dataIndex, cb) { + animateOrSetProps(true, el, props, animatableModel, dataIndex, cb); +} + +/** + * Init graphic element properties with or without animation according to the + * configuration in series. + * + * Caution: this method will stop previous animation. + * So if do not use this method to one element twice before + * animation starts, unless you know what you are doing. + * + * @param {module:zrender/Element} el + * @param {Object} props + * @param {module:echarts/model/Model} [animatableModel] + * @param {number} [dataIndex] + * @param {Function} cb + */ +function initProps(el, props, animatableModel, dataIndex, cb) { + animateOrSetProps(false, el, props, animatableModel, dataIndex, cb); +} + +/** + * 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] + */ +function getTransform(target, ancestor) { + var mat = identity([]); + + while (target && target !== ancestor) { + mul$1(mat, target.getLocalTransform(), mat); + target = target.parent; + } + + return mat; +} + +/** + * Apply transform to an vertex. + * @param {Array.} target [x, y] + * @param {Array.|TypedArray.|Object} transform Can be: + * + Transform matrix: like [1, 0, 0, 1, 0, 0] + * + {position, rotation, scale}, the same as `zrender/Transformable`. + * @param {boolean=} invert Whether use invert matrix. + * @return {Array.} [x, y] + */ +function applyTransform$1(target, transform, invert$$1) { + if (transform && !isArrayLike(transform)) { + transform = Transformable.getLocalTransform(transform); + } + + if (invert$$1) { + transform = invert([], transform); + } + return applyTransform([], target, transform); +} + +/** + * @param {string} direction 'left' 'right' 'top' 'bottom' + * @param {Array.} 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' + */ +function transformDirection(direction, transform, invert$$1) { + + // 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 = applyTransform$1(vertex, transform, invert$$1); + + return Math.abs(vertex[0]) > Math.abs(vertex[1]) + ? (vertex[0] > 0 ? 'right' : 'left') + : (vertex[1] > 0 ? 'bottom' : 'top'); +} + +/** + * Apply group transition animation from g1 to g2. + * If no animatableModel, no animation. + */ +function groupTransition(g1, g2, animatableModel, cb) { + if (!g1 || !g2) { + return; + } + + function getElMap(g) { + var elMap = {}; + g.traverse(function (el) { + if (!el.isGroup && el.anid) { + elMap[el.anid] = el; + } + }); + return elMap; + } + function getAnimatableProps(el) { + var obj = { + position: clone$1(el.position), + rotation: el.rotation + }; + if (el.shape) { + obj.shape = extend({}, el.shape); + } + return obj; + } + var elMap1 = getElMap(g1); + + g2.traverse(function (el) { + if (!el.isGroup && el.anid) { + var oldEl = elMap1[el.anid]; + if (oldEl) { + var newProp = getAnimatableProps(el); + el.attr(getAnimatableProps(oldEl)); + updateProps(el, newProp, animatableModel, el.dataIndex); + } + // else { + // if (el.previousProps) { + // graphic.updateProps + // } + // } + } + }); +} + +/** + * @param {Array.>} points Like: [[23, 44], [53, 66], ...] + * @param {Object} rect {x, y, width, height} + * @return {Array.>} A new clipped points. + */ +function clipPointsByRect(points, rect) { + return map(points, function (point) { + var x = point[0]; + x = mathMax$1(x, rect.x); + x = mathMin$1(x, rect.x + rect.width); + var y = point[1]; + y = mathMax$1(y, rect.y); + y = mathMin$1(y, rect.y + rect.height); + return [x, y]; + }); +} + +/** + * @param {Object} targetRect {x, y, width, height} + * @param {Object} rect {x, y, width, height} + * @return {Object} A new clipped rect. If rect size are negative, return undefined. + */ +function clipRectByRect(targetRect, rect) { + var x = mathMax$1(targetRect.x, rect.x); + var x2 = mathMin$1(targetRect.x + targetRect.width, rect.x + rect.width); + var y = mathMax$1(targetRect.y, rect.y); + var y2 = mathMin$1(targetRect.y + targetRect.height, rect.y + rect.height); + + if (x2 >= x && y2 >= y) { + return { + x: x, + y: y, + width: x2 - x, + height: y2 - y + }; + } +} + +/** + * @param {string} iconStr Support 'image://' or 'path://' or direct svg path. + * @param {Object} [opt] Properties of `module:zrender/Element`, except `style`. + * @param {Object} [rect] {x, y, width, height} + * @return {module:zrender/Element} Icon path or image element. + */ +function createIcon(iconStr, opt, rect) { + opt = extend({rectHover: true}, opt); + var style = opt.style = {strokeNoScale: true}; + rect = rect || {x: -1, y: -1, width: 2, height: 2}; + + if (iconStr) { + return iconStr.indexOf('image://') === 0 + ? ( + style.image = iconStr.slice(8), + defaults(style, rect), + new ZImage(opt) + ) + : ( + makePath( + iconStr.replace('path://', ''), + opt, + rect, + 'center' + ) + ); + } +} + + + + +var graphic = (Object.freeze || Object)({ + extendShape: extendShape, + extendPath: extendPath, + makePath: makePath, + makeImage: makeImage, + mergePath: mergePath, + resizePath: resizePath, + subPixelOptimizeLine: subPixelOptimizeLine, + subPixelOptimizeRect: subPixelOptimizeRect, + subPixelOptimize: subPixelOptimize, + setElementHoverStyle: setElementHoverStyle, + isInEmphasis: isInEmphasis, + setHoverStyle: setHoverStyle, + setAsHoverStyleTrigger: setAsHoverStyleTrigger, + setLabelStyle: setLabelStyle, + setTextStyle: setTextStyle, + setText: setText, + getFont: getFont, + updateProps: updateProps, + initProps: initProps, + getTransform: getTransform, + applyTransform: applyTransform$1, + transformDirection: transformDirection, + groupTransition: groupTransition, + clipPointsByRect: clipPointsByRect, + clipRectByRect: clipRectByRect, + createIcon: createIcon, + Group: Group, + Image: ZImage, + Text: Text, + Circle: Circle, + Sector: Sector, + Ring: Ring, + Polygon: Polygon, + Polyline: Polyline, + Rect: Rect, + Line: Line, + BezierCurve: BezierCurve, + Arc: Arc, + IncrementalDisplayable: IncrementalDisplayble, + CompoundPath: CompoundPath, + LinearGradient: LinearGradient, + RadialGradient: RadialGradient, + BoundingRect: BoundingRect +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 PATH_COLOR = ['textStyle', 'color']; + +var textStyleMixin = { + /** + * Get color property or get color from option.textStyle.color + * @param {boolean} [isEmphasis] + * @return {string} + */ + getTextColor: function (isEmphasis) { + var ecModel = this.ecModel; + return this.getShallow('color') + || ( + (!isEmphasis && ecModel) ? ecModel.get(PATH_COLOR) : null + ); + }, + + /** + * Create font string from fontStyle, fontWeight, fontSize, fontFamily + * @return {string} + */ + getFont: function () { + return getFont({ + fontStyle: this.getShallow('fontStyle'), + fontWeight: this.getShallow('fontWeight'), + fontSize: this.getShallow('fontSize'), + fontFamily: this.getShallow('fontFamily') + }, this.ecModel); + }, + + getTextRect: function (text) { + return getBoundingRect( + text, + this.getFont(), + this.getShallow('align'), + this.getShallow('verticalAlign') || this.getShallow('baseline'), + this.getShallow('padding'), + this.getShallow('rich'), + this.getShallow('truncateText') + ); + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 getItemStyle = makeStyleMapper( + [ + ['fill', 'color'], + ['stroke', 'borderColor'], + ['lineWidth', 'borderWidth'], + ['opacity'], + ['shadowBlur'], + ['shadowOffsetX'], + ['shadowOffsetY'], + ['shadowColor'], + ['textPosition'], + ['textAlign'] + ] +); + +var itemStyleMixin = { + getItemStyle: function (excludes, includes) { + var style = getItemStyle(this, excludes, includes); + var lineDash = this.getBorderLineDash(); + lineDash && (style.lineDash = lineDash); + return style; + }, + + getBorderLineDash: function () { + var lineType = this.get('borderType'); + return (lineType === 'solid' || lineType == null) ? null + : (lineType === 'dashed' ? [5, 5] : [1, 1]); + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @module echarts/model/Model + */ + +var mixin$1 = mixin; +var inner = makeInner(); + +/** + * @alias module:echarts/model/Model + * @constructor + * @param {Object} option + * @param {module:echarts/model/Model} [parentModel] + * @param {module:echarts/model/Global} [ecModel] + */ +function Model(option, parentModel, ecModel) { + /** + * @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) { + merge(this.option, option, true); + }, + + /** + * @param {string|Array.} path + * @param {boolean} [ignoreParent=false] + * @return {*} + */ + get: function (path, ignoreParent) { + if (path == null) { + return this.option; + } + + return doGet( + this.option, + this.parsePath(path), + !ignoreParent && getParent(this, path) + ); + }, + + /** + * @param {string} key + * @param {boolean} [ignoreParent=false] + * @return {*} + */ + getShallow: function (key, ignoreParent) { + var option = this.option; + + var val = option == null ? option : option[key]; + var parentModel = !ignoreParent && getParent(this, key); + if (val == null && parentModel) { + val = parentModel.getShallow(key); + } + return val; + }, + + /** + * @param {string|Array.} [path] + * @param {module:echarts/model/Model} [parentModel] + * @return {module:echarts/model/Model} + */ + getModel: function (path, parentModel) { + var obj = path == null + ? this.option + : doGet(this.option, path = this.parsePath(path)); + + var thisParentModel; + parentModel = parentModel || ( + (thisParentModel = getParent(this, path)) + && thisParentModel.getModel(path) + ); + + return new Model(obj, parentModel, this.ecModel); + }, + + /** + * If model has option + */ + isEmpty: function () { + return this.option == null; + }, + + restoreData: function () {}, + + // Pending + clone: function () { + var Ctor = this.constructor; + return new Ctor(clone(this.option)); + }, + + setReadOnly: function (properties) { + // clazzUtil.setReadOnly(this, properties); + }, + + // If path is null/undefined, return null/undefined. + parsePath: function(path) { + if (typeof path === 'string') { + path = path.split('.'); + } + return path; + }, + + /** + * @param {Function} getParentMethod + * param {Array.|string} path + * return {module:echarts/model/Model} + */ + customizeGetParent: function (getParentMethod) { + inner(this).getParent = getParentMethod; + }, + + isAnimationEnabled: function () { + if (!env$1.node) { + if (this.option.animation != null) { + return !!this.option.animation; + } + else if (this.parentModel) { + return this.parentModel.isAnimationEnabled(); + } + } + } + +}; + +function doGet(obj, pathArr, parentModel) { + for (var i = 0; i < pathArr.length; i++) { + // Ignore empty + if (!pathArr[i]) { + continue; + } + // obj could be number/string/... (like 0) + obj = (obj && typeof obj === 'object') ? obj[pathArr[i]] : null; + if (obj == null) { + break; + } + } + if (obj == null && parentModel) { + obj = parentModel.get(pathArr); + } + return obj; +} + +// `path` can be null/undefined +function getParent(model, path) { + var getParentMethod = inner(model).getParent; + return getParentMethod ? getParentMethod.call(model, path) : model.parentModel; +} + +// Enable Model.extend. +enableClassExtend(Model); +enableClassCheck(Model); + +mixin$1(Model, lineStyleMixin); +mixin$1(Model, areaStyleMixin); +mixin$1(Model, textStyleMixin); +mixin$1(Model, itemStyleMixin); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 base = 0; + +/** + * @public + * @param {string} type + * @return {string} + */ +function getUID(type) { + // Considering the case of crossing js context, + // use Math.random to make id as unique as possible. + return [(type || ''), base++, Math.random().toFixed(5)].join('_'); +} + +/** + * @inner + */ +function enableSubTypeDefaulter(entity) { + + var subTypeDefaulters = {}; + + entity.registerSubTypeDefaulter = function (componentType, defaulter) { + componentType = parseClassType$1(componentType); + subTypeDefaulters[componentType.main] = defaulter; + }; + + entity.determineSubType = function (componentType, option) { + var type = option.type; + if (!type) { + var componentTypeMain = parseClassType$1(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. + * + */ +function enableTopologicalTravel(entity, dependencyGetter) { + + /** + * @public + * @param {Array.} targetNameList Target Component type list. + * Can be ['aa', 'bb', 'aa.xx'] + * @param {Array.} 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 = {}; + each$1(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]; + } + each$1( + currVertex.successor, + isInTargetNameSet ? removeEdgeAndAdd : removeEdge + ); + } + + each$1(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 = []; + + each$1(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); + } + + each$1(availableDeps, function (dependentName) { + if (indexOf(thisItem.predecessor, dependentName) < 0) { + thisItem.predecessor.push(dependentName); + } + var thatItem = createDependencyGraphItem(graph, dependentName); + if (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 = []; + each$1(originalDeps, function (dep) { + indexOf(fullNameList, dep) >= 0 && availableDeps.push(dep); + }); + return availableDeps; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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.)} val + * @param {Array.} domain Domain extent domain[0] can be bigger than domain[1] + * @param {Array.} range Range extent range[0] can be bigger than range[1] + * @param {boolean} clamp + * @return {(number|Array.} + */ +function linearMap(val, domain, range, clamp) { + var subDomain = domain[1] - domain[0]; + var subRange = range[1] - range[0]; + + if (subDomain === 0) { + return subRange === 0 + ? range[0] + : (range[0] + range[1]) / 2; + } + + // Avoid accuracy problem in edge, such as + // 146.39 - 62.83 === 83.55999999999999. + // See echarts/test/ut/spec/util/number.js#linearMap#accuracyError + // It is a little verbose for efficiency considering this method + // is a hotspot. + if (clamp) { + if (subDomain > 0) { + if (val <= domain[0]) { + return range[0]; + } + else if (val >= domain[1]) { + return range[1]; + } + } + else { + if (val >= domain[0]) { + return range[0]; + } + else if (val <= domain[1]) { + return range[1]; + } + } + } + else { + if (val === domain[0]) { + return range[0]; + } + if (val === domain[1]) { + return range[1]; + } + } + + return (val - domain[0]) / subDomain * subRange + 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} + */ +function parsePercent$1(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; +} + +/** + * (1) Fix rounding error of float numbers. + * (2) Support return string to avoid scientific notation like '3.5e-7'. + * + * @param {number} x + * @param {number} [precision] + * @param {boolean} [returnStr] + * @return {number|string} + */ +function round$1(x, precision, returnStr) { + if (precision == null) { + precision = 10; + } + // Avoid range error + precision = Math.min(Math.max(0, precision), 20); + x = (+x).toFixed(precision); + return returnStr ? x : +x; +} + +function asc(arr) { + arr.sort(function (a, b) { + return a - b; + }); + return arr; +} + +/** + * Get precision + * @param {number} val + */ +function getPrecision(val) { + val = +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 {string|number} val + * @return {number} + */ +function getPrecisionSafe(val) { + var str = val.toString(); + + // Consider scientific notation: '3.4e-12' '3.4e+12' + var eIndex = str.indexOf('e'); + if (eIndex > 0) { + var precision = +str.slice(eIndex + 1); + return precision < 0 ? -precision : 0; + } + else { + var dotIndex = str.indexOf('.'); + return dotIndex < 0 ? 0 : str.length - 1 - dotIndex; + } +} + +/** + * Minimal dicernible data precisioin according to a single pixel. + * + * @param {Array.} dataExtent + * @param {Array.} pixelExtent + * @return {number} precision + */ +function getPixelPrecision(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); + // toFixed() digits argument must be between 0 and 20. + var precision = Math.min(Math.max(-dataQuantity + sizeQuantity, 0), 20); + return !isFinite(precision) ? 20 : precision; +} + +/** + * Get a data of given precision, assuring the sum of percentages + * in valueList is 1. + * The largest remainer method is used. + * https://en.wikipedia.org/wiki/Largest_remainder_method + * + * @param {Array.} valueList a list of all data + * @param {number} idx index of the data to be processed in valueList + * @param {number} precision integer number showing digits of precision + * @return {number} percent ranging from 0 to 100 + */ +function getPercentWithPrecision(valueList, idx, precision) { + if (!valueList[idx]) { + return 0; + } + + var sum = reduce(valueList, function (acc, val) { + return acc + (isNaN(val) ? 0 : val); + }, 0); + if (sum === 0) { + return 0; + } + + var digits = Math.pow(10, precision); + var votesPerQuota = map(valueList, function (val) { + return (isNaN(val) ? 0 : val) / sum * digits * 100; + }); + var targetSeats = digits * 100; + + var seats = map(votesPerQuota, function (votes) { + // Assign automatic seats. + return Math.floor(votes); + }); + var currentSum = reduce(seats, function (acc, val) { + return acc + val; + }, 0); + + var remainder = map(votesPerQuota, function (votes, idx) { + return votes - seats[idx]; + }); + + // Has remainding votes. + while (currentSum < targetSeats) { + // Find next largest remainder. + var max = Number.NEGATIVE_INFINITY; + var maxId = null; + for (var i = 0, len = remainder.length; i < len; ++i) { + if (remainder[i] > max) { + max = remainder[i]; + maxId = i; + } + } + + // Add a vote to max remainder. + ++seats[maxId]; + remainder[maxId] = 0; + ++currentSum; + } + + return seats[idx] / digits; +} + +// Number.MAX_SAFE_INTEGER, ie do not support. +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * To 0 - 2 * PI, considering negative radian. + * @param {number} radian + * @return {number} + */ +function remRadian(radian) { + var pi2 = Math.PI * 2; + return (radian % pi2 + pi2) % pi2; +} + +/** + * @param {type} radian + * @return {boolean} + */ +function isRadianAroundZero(val) { + return val > -RADIAN_EPSILON && val < RADIAN_EPSILON; +} + +var TIME_REG = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/; // jshint ignore:line + +/** + * @param {string|Date|number} value These values can be accepted: + * + An instance of Date, represent a time in its own time zone. + * + Or string in a subset of ISO 8601, only including: + * + only year, month, date: '2012-03', '2012-03-01', '2012-03-01 05', '2012-03-01 05:06', + * + separated with T or space: '2012-03-01T12:22:33.123', '2012-03-01 12:22:33.123', + * + time zone: '2012-03-01T12:22:33Z', '2012-03-01T12:22:33+8000', '2012-03-01T12:22:33-05:00', + * all of which will be treated as local time if time zone is not specified + * (see ). + * + Or other string format, including (all of which will be treated as loacal time): + * '2012', '2012-3-1', '2012/3/1', '2012/03/01', + * '2009/6/12 2:00', '2009/6/12 2:05:08', '2009/6/12 2:05:08.123' + * + a timestamp, which represent a time in UTC. + * @return {Date} date + */ +function parseDate(value) { + if (value instanceof Date) { + return value; + } + else if (typeof value === 'string') { + // Different browsers parse date in different way, so we parse it manually. + // Some other issues: + // new Date('1970-01-01') is UTC, + // new Date('1970/01/01') and new Date('1970-1-01') is local. + // See issue #3623 + var match = TIME_REG.exec(value); + + if (!match) { + // return Invalid Date. + return new Date(NaN); + } + + // Use local time when no timezone offset specifed. + if (!match[8]) { + // match[n] can only be string or undefined. + // But take care of '12' + 1 => '121'. + return new Date( + +match[1], + +(match[2] || 1) - 1, + +match[3] || 1, + +match[4] || 0, + +(match[5] || 0), + +match[6] || 0, + +match[7] || 0 + ); + } + // Timezoneoffset of Javascript Date has considered DST (Daylight Saving Time, + // https://tc39.github.io/ecma262/#sec-daylight-saving-time-adjustment). + // For example, system timezone is set as "Time Zone: America/Toronto", + // then these code will get different result: + // `new Date(1478411999999).getTimezoneOffset(); // get 240` + // `new Date(1478412000000).getTimezoneOffset(); // get 300` + // So we should not use `new Date`, but use `Date.UTC`. + else { + var hour = +match[4] || 0; + if (match[8].toUpperCase() !== 'Z') { + hour -= match[8].slice(0, 3); + } + return new Date(Date.UTC( + +match[1], + +(match[2] || 1) - 1, + +match[3] || 1, + hour, + +(match[5] || 0), + +match[6] || 0, + +match[7] || 0 + )); + } + } + else if (value == null) { + return new Date(NaN); + } + + return new Date(Math.round(value)); +} + +/** + * Quantity of a number. e.g. 0.1, 1, 10, 100 + * + * @param {number} val + * @return {number} + */ +function quantity(val) { + return Math.pow(10, quantityExponent(val)); +} + +function quantityExponent(val) { + return Math.floor(Math.log(val) / Math.LN10); +} + +/** + * 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. + * + * See "Nice Numbers for Graph Labels" of Graphic Gems. + * + * @param {number} val Non-negative value. + * @param {boolean} round + * @return {number} + */ +function nice(val, round) { + var exponent = quantityExponent(val); + var exp10 = Math.pow(10, exponent); + var f = val / exp10; // 1 <= f < 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; } + } + val = nf * exp10; + + // Fix 3 * 0.1 === 0.30000000000000004 issue (see IEEE 754). + // 20 is the uppper bound of toFixed. + return exponent >= -20 ? +val.toFixed(exponent < 0 ? -exponent : 0) : val; +} + +/** + * BSD 3-Clause + * + * Copyright (c) 2010-2015, Michael Bostock + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * The name Michael Bostock may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @see + * @see + * @param {Array.} ascArr + */ +function quantile(ascArr, p) { + var H = (ascArr.length - 1) * p + 1; + var h = Math.floor(H); + var v = +ascArr[h - 1]; + var e = H - h; + return e ? v + e * (ascArr[h] - v) : v; +} + +/** + * Order intervals asc, and split them when overlap. + * expect(numberUtil.reformIntervals([ + * {interval: [18, 62], close: [1, 1]}, + * {interval: [-Infinity, -70], close: [0, 0]}, + * {interval: [-70, -26], close: [1, 1]}, + * {interval: [-26, 18], close: [1, 1]}, + * {interval: [62, 150], close: [1, 1]}, + * {interval: [106, 150], close: [1, 1]}, + * {interval: [150, Infinity], close: [0, 0]} + * ])).toEqual([ + * {interval: [-Infinity, -70], close: [0, 0]}, + * {interval: [-70, -26], close: [1, 1]}, + * {interval: [-26, 18], close: [0, 1]}, + * {interval: [18, 62], close: [0, 1]}, + * {interval: [62, 150], close: [0, 1]}, + * {interval: [150, Infinity], close: [0, 0]} + * ]); + * @param {Array.} list, where `close` mean open or close + * of the interval, and Infinity can be used. + * @return {Array.} The origin list, which has been reformed. + */ +function reformIntervals(list) { + list.sort(function (a, b) { + return littleThan(a, b, 0) ? -1 : 1; + }); + + var curr = -Infinity; + var currClose = 1; + for (var i = 0; i < list.length;) { + var interval = list[i].interval; + var close = list[i].close; + + for (var lg = 0; lg < 2; lg++) { + if (interval[lg] <= curr) { + interval[lg] = curr; + close[lg] = !lg ? 1 - currClose : 1; + } + curr = interval[lg]; + currClose = close[lg]; + } + + if (interval[0] === interval[1] && close[0] * close[1] !== 1) { + list.splice(i, 1); + } + else { + i++; + } + } + + return list; + + function littleThan(a, b, lg) { + return a.interval[lg] < b.interval[lg] + || ( + a.interval[lg] === b.interval[lg] + && ( + (a.close[lg] - b.close[lg] === (!lg ? 1 : -1)) + || (!lg && littleThan(a, b, 1)) + ) + ); + } +} + +/** + * parseFloat NaNs numeric-cast false positives (null|true|false|"") + * ...but misinterprets leading-number strings, particularly hex literals ("0x...") + * subtraction forces infinities to NaN + * + * @param {*} v + * @return {boolean} + */ +function isNumeric(v) { + return v - parseFloat(v) >= 0; +} + + +var number = (Object.freeze || Object)({ + linearMap: linearMap, + parsePercent: parsePercent$1, + round: round$1, + asc: asc, + getPrecision: getPrecision, + getPrecisionSafe: getPrecisionSafe, + getPixelPrecision: getPixelPrecision, + getPercentWithPrecision: getPercentWithPrecision, + MAX_SAFE_INTEGER: MAX_SAFE_INTEGER, + remRadian: remRadian, + isRadianAroundZero: isRadianAroundZero, + parseDate: parseDate, + quantity: quantity, + nice: nice, + quantile: quantile, + reformIntervals: reformIntervals, + isNumeric: isNumeric +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * 每三位默认加,格式化 + * @param {string|number} x + * @return {string} + */ +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 + * @param {boolean} [upperCaseFirst=false] + * @return {string} str + */ +function toCamelCase(str, upperCaseFirst) { + str = (str || '').toLowerCase().replace(/-(.)/g, function(match, group1) { + return group1.toUpperCase(); + }); + + if (upperCaseFirst && str) { + str = str.charAt(0).toUpperCase() + str.slice(1); + } + + return str; +} + +var normalizeCssArray$1 = normalizeCssArray; + + +var replaceReg = /([&<>"'])/g; +var replaceMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + '\'': ''' +}; + +function encodeHTML(source) { + return source == null + ? '' + : (source + '').replace(replaceReg, function (str, c) { + return replaceMap[c]; + }); +} + +var TPL_VAR_ALIAS = ['a', 'b', 'c', 'd', 'e', 'f', 'g']; + +var wrapVar = function (varName, seriesIdx) { + return '{' + varName + (seriesIdx == null ? '' : seriesIdx) + '}'; +}; + +/** + * Template formatter + * @param {string} tpl + * @param {Array.|Object} paramsList + * @param {boolean} [encode=false] + * @return {string} + */ +function formatTpl(tpl, paramsList, encode) { + if (!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++) { + var val = paramsList[seriesIdx][$vars[k]]; + tpl = tpl.replace( + wrapVar(TPL_VAR_ALIAS[k], seriesIdx), + encode ? encodeHTML(val) : val + ); + } + } + + return tpl; +} + +/** + * simple Template formatter + * + * @param {string} tpl + * @param {Object} param + * @param {boolean} [encode=false] + * @return {string} + */ +function formatTplSimple(tpl, param, encode) { + each$1(param, function (value, key) { + tpl = tpl.replace( + '{' + key + '}', + encode ? encodeHTML(value) : value + ); + }); + return tpl; +} + +/** + * @param {Object|string} [opt] If string, means color. + * @param {string} [opt.color] + * @param {string} [opt.extraCssText] + * @param {string} [opt.type='item'] 'item' or 'subItem' + * @param {string} [opt.renderMode='html'] render mode of tooltip, 'html' or 'richText' + * @param {string} [opt.markerId='X'] id name for marker. If only one marker is in a rich text, this can be omitted. + * @return {string} + */ +function getTooltipMarker(opt, extraCssText) { + opt = isString(opt) ? {color: opt, extraCssText: extraCssText} : (opt || {}); + var color = opt.color; + var type = opt.type; + var extraCssText = opt.extraCssText; + var renderMode = opt.renderMode || 'html'; + var markerId = opt.markerId || 'X'; + + if (!color) { + return ''; + } + + if (renderMode === 'html') { + return type === 'subItem' + ? '' + : ''; + } + else { + // Space for rich element marker + return { + renderMode: renderMode, + content: '{marker' + markerId + '|} ', + style: { + color: color + } + }; + } +} + +function pad(str, len) { + str += ''; + return '0000'.substr(0, len - str.length) + str; +} + + +/** + * ISO Date format + * @param {string} tpl + * @param {number} value + * @param {boolean} [isUTC=false] Default in local time. + * see `module:echarts/scale/Time` + * and `module:echarts/util/number#parseDate`. + * @inner + */ +function formatTime(tpl, value, isUTC) { + if (tpl === 'week' + || tpl === 'month' + || tpl === 'quarter' + || tpl === 'half-year' + || tpl === 'year' + ) { + tpl = 'MM-dd\nyyyy'; + } + + var date = parseDate(value); + var utc = isUTC ? 'UTC' : ''; + var y = date['get' + utc + 'FullYear'](); + var M = date['get' + utc + 'Month']() + 1; + var d = date['get' + utc + 'Date'](); + var h = date['get' + utc + 'Hours'](); + var m = date['get' + utc + 'Minutes'](); + var s = date['get' + utc + 'Seconds'](); + var S = date['get' + utc + 'Milliseconds'](); + + tpl = tpl.replace('MM', pad(M, 2)) + .replace('M', M) + .replace('yyyy', y) + .replace('yy', y % 100) + .replace('dd', pad(d, 2)) + .replace('d', d) + .replace('hh', pad(h, 2)) + .replace('h', h) + .replace('mm', pad(m, 2)) + .replace('m', m) + .replace('ss', pad(s, 2)) + .replace('s', s) + .replace('SSS', pad(S, 3)); + + return tpl; +} + +/** + * Capital first + * @param {string} str + * @return {string} + */ +function capitalFirst(str) { + return str ? str.charAt(0).toUpperCase() + str.substr(1) : str; +} + +var truncateText$1 = truncateText; + +var getTextRect = getBoundingRect; + + +var format = (Object.freeze || Object)({ + addCommas: addCommas, + toCamelCase: toCamelCase, + normalizeCssArray: normalizeCssArray$1, + encodeHTML: encodeHTML, + formatTpl: formatTpl, + formatTplSimple: formatTplSimple, + getTooltipMarker: getTooltipMarker, + formatTime: formatTime, + capitalFirst: capitalFirst, + truncateText: truncateText$1, + getTextRect: getTextRect +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Layout helpers for each component positioning + +var each$3 = each$1; + +/** + * @public + */ +var LOCATION_PARAMS = [ + 'left', 'right', 'top', 'bottom', 'width', 'height' +]; + +/** + * @public + */ +var HV_NAMES = [ + ['width', 'left', 'right'], + ['height', 'top', 'bottom'] +]; + +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 + // FIXME compare before adding gap? + if (nextX > maxWidth || child.newline) { + x = 0; + nextX = moveX; + y += currentLineMaxSize + gap; + currentLineMaxSize = rect.height; + } + else { + // FIXME: consider rect.y is not `0`? + 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] + */ +var box = boxLayout; + +/** + * VBox layouting + * @param {module:zrender/container/Group} group + * @param {number} gap + * @param {number} [width=Infinity] + * @param {number} [height=Infinity] + */ +var vbox = curry(boxLayout, 'vertical'); + +/** + * HBox layouting + * @param {module:zrender/container/Group} group + * @param {number} gap + * @param {number} [width=Infinity] + * @param {number} [height=Infinity] + */ +var hbox = 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 {width, height} + * @param {string|number} margin + * @return {Object} {width, height} + */ +function getAvailableSize(positionInfo, containerRect, margin) { + var containerWidth = containerRect.width; + var containerHeight = containerRect.height; + + var x = parsePercent$1(positionInfo.x, containerWidth); + var y = parsePercent$1(positionInfo.y, containerHeight); + var x2 = parsePercent$1(positionInfo.x2, containerWidth); + var y2 = parsePercent$1(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 = normalizeCssArray$1(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} + */ +function getLayoutRect( + positionInfo, containerRect, margin +) { + margin = normalizeCssArray$1(margin || 0); + + var containerWidth = containerRect.width; + var containerHeight = containerRect.height; + + var left = parsePercent$1(positionInfo.left, containerWidth); + var top = parsePercent$1(positionInfo.top, containerHeight); + var right = parsePercent$1(positionInfo.right, containerWidth); + var bottom = parsePercent$1(positionInfo.bottom, containerHeight); + var width = parsePercent$1(positionInfo.width, containerWidth); + var height = parsePercent$1(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 (aspect != null) { + // 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 + // FIXME + // Margin is not considered, because there is no case that both + // using margin and aspect so far. + if (isNaN(width) && isNaN(height)) { + if (aspect > containerWidth / containerHeight) { + width = containerWidth * 0.8; + } + else { + height = containerHeight * 0.8; + } + } + + // 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 - horizontalMargin - left - (right || 0); + } + if (isNaN(height)) { + // Height may be NaN if only one value is given except height + height = containerHeight - verticalMargin - top - (bottom || 0); + } + + var rect = new BoundingRect(left + margin[3], top + margin[0], width, height); + rect.margin = margin; + return rect; +} + + +/** + * Position a zr element in viewport + * Group position is specified by either + * {left, top}, {right, bottom} + * If all properties exists, right and bottom will be igonred. + * + * Logic: + * 1. Scale (against origin point in parent coord) + * 2. Rotate (against origin point in parent coord) + * 3. Traslate (with el.position by this method) + * So this method only fixes the last step 'Traslate', which does not affect + * scaling and rotating. + * + * If be called repeatly with the same input el, the same result will be gotten. + * + * @param {module:zrender/Element} el Should have `getBoundingRect` method. + * @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] Only for opt.boundingModel: 'raw' + * @param {number|string} [positionInfo.height] Only for opt.boundingModel: 'raw' + * @param {Object} containerRect + * @param {string|number} margin + * @param {Object} [opt] + * @param {Array.} [opt.hv=[1,1]] Only horizontal or only vertical. + * @param {Array.} [opt.boundingMode='all'] + * Specify how to calculate boundingRect when locating. + * 'all': Position the boundingRect that is transformed and uioned + * both itself and its descendants. + * This mode simplies confine the elements in the bounding + * of their container (e.g., using 'right: 0'). + * 'raw': Position the boundingRect that is not transformed and only itself. + * This mode is useful when you want a element can overflow its + * container. (Consider a rotated circle needs to be located in a corner.) + * In this mode positionInfo.width/height can only be number. + */ +function positionElement(el, positionInfo, containerRect, margin, opt) { + var h = !opt || !opt.hv || opt.hv[0]; + var v = !opt || !opt.hv || opt.hv[1]; + var boundingMode = opt && opt.boundingMode || 'all'; + + if (!h && !v) { + return; + } + + var rect; + if (boundingMode === 'raw') { + rect = el.type === 'group' + ? new BoundingRect(0, 0, +positionInfo.width || 0, +positionInfo.height || 0) + : el.getBoundingRect(); + } + else { + rect = el.getBoundingRect(); + if (el.needLocalTransform()) { + var transform = el.getLocalTransform(); + // Notice: raw rect may be inner object of el, + // which should not be modified. + rect = rect.clone(); + rect.applyTransform(transform); + } + } + + // The real width and height can not be specified but calculated by the given el. + positionInfo = getLayoutRect( + defaults( + {width: rect.width, height: rect.height}, + positionInfo + ), + containerRect, + margin + ); + + // Because 'tranlate' is the last step in transform + // (see zrender/core/Transformable#getLocalTransform), + // we can just only modify el.position to get final result. + var elPos = el.position; + var dx = h ? positionInfo.x - rect.x : 0; + var dy = v ? positionInfo.y - rect.y : 0; + + el.attr('position', boundingMode === 'raw' ? [dx, dy] : [elPos[0] + dx, elPos[1] + dy]); +} + +/** + * @param {Object} option Contains some of the properties in HV_NAMES. + * @param {number} hvIdx 0: horizontal; 1: vertical. + */ +function sizeCalculable(option, hvIdx) { + return option[HV_NAMES[hvIdx][0]] != null + || (option[HV_NAMES[hvIdx][1]] != null && option[HV_NAMES[hvIdx][2]] != null); +} + +/** + * 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|Array.} [opt.ignoreSize=false] Used for the components + * that width (or height) should not be calculated by left and right (or top and bottom). + */ +function mergeLayoutParam(targetOption, newOption, opt) { + !isObject$1(opt) && (opt = {}); + + var ignoreSize = opt.ignoreSize; + !isArray(ignoreSize) && (ignoreSize = [ignoreSize, ignoreSize]); + + var hResult = merge$$1(HV_NAMES[0], 0); + var vResult = merge$$1(HV_NAMES[1], 1); + + copy(HV_NAMES[0], targetOption, hResult); + copy(HV_NAMES[1], targetOption, vResult); + + function merge$$1(names, hvIdx) { + var newParams = {}; + var newValueCount = 0; + var merged = {}; + var mergedValueCount = 0; + var enoughParamNumber = 2; + + each$3(names, function (name) { + merged[name] = targetOption[name]; + }); + each$3(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++; + }); + + if (ignoreSize[hvIdx]) { + // Only one of left/right is premitted to exist. + if (hasValue(newOption, names[1])) { + merged[names[2]] = null; + } + else if (hasValue(newOption, names[2])) { + merged[names[1]] = null; + } + return merged; + } + + // 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. + 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$3(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. + */ +function getLayoutParams(source) { + return copyLayoutParams({}, source); +} + +/** + * Retrieve 'left', 'right', 'top', 'bottom', 'width', 'height' from object. + * @param {Object} source + * @return {Object} Result contains those props. + */ +function copyLayoutParams(target, source) { + source && target && each$3(LOCATION_PARAMS, function (name) { + source.hasOwnProperty(name) && (target[name] = source[name]); + }); + return target; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 boxLayoutMixin = { + 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') + }; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Component model + * + * @module echarts/model/Component + */ + +var inner$1 = makeInner(); + +/** + * @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: '', + + /** + * Because simplified concept is probably better, series.name (or component.name) + * has been having too many resposibilities: + * (1) Generating id (which requires name in option should not be modified). + * (2) As an index to mapping series when merging option or calling API (a name + * can refer to more then one components, which is convinient is some case). + * (3) Display. + * @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.>} + * @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, + + $constructor: function (option, parentModel, ecModel, extraOpt) { + Model.call(this, option, parentModel, ecModel, extraOpt); + + this.uid = getUID('ec_cpt_model'); + }, + + init: function (option, parentModel, ecModel, extraOpt) { + this.mergeDefaultAndTheme(option, ecModel); + }, + + mergeDefaultAndTheme: function (option, ecModel) { + var layoutMode = this.layoutMode; + var inputPositionParams = layoutMode + ? getLayoutParams(option) : {}; + + var themeModel = ecModel.getTheme(); + merge(option, themeModel.get(this.mainType)); + merge(option, this.getDefaultOption()); + + if (layoutMode) { + mergeLayoutParam(option, inputPositionParams, layoutMode); + } + }, + + mergeOption: function (option, extraOpt) { + merge(this.option, option, true); + + var layoutMode = this.layoutMode; + if (layoutMode) { + mergeLayoutParam(this.option, option, layoutMode); + } + }, + + // Hooker after init or mergeOption + optionUpdated: function (newCptOption, isInit) {}, + + getDefaultOption: function () { + var fields = inner$1(this); + if (!fields.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 = merge(defaultOption, optList[i], true); + } + fields.defaultOption = defaultOption; + } + return fields.defaultOption; + }, + + getReferringComponents: function (mainType) { + return this.ecModel.queryComponents({ + mainType: mainType, + index: this.get(mainType + 'Index', true), + id: this.get(mainType + 'Id', true) + }); + } + +}); + +// 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. +enableClassManagement( + ComponentModel, {registerWhenExtend: true} +); +enableSubTypeDefaulter(ComponentModel); + +// Add capability of ComponentModel.topologicalTravel. +enableTopologicalTravel(ComponentModel, getDependencies); + +function getDependencies(componentType) { + var deps = []; + each$1(ComponentModel.getClassesByMainType(componentType), function (Clazz) { + deps = deps.concat(Clazz.prototype.dependencies || []); + }); + + // Ensure main type. + deps = map(deps, function (type) { + return parseClassType$1(type).main; + }); + + // Hack dataset for convenience. + if (componentType !== 'dataset' && indexOf(deps, 'dataset') <= 0) { + deps.unshift('dataset'); + } + + return deps; +} + +mixin(ComponentModel, boxLayoutMixin); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 platform = ''; +// Navigator not exists in node +if (typeof navigator !== 'undefined') { + platform = navigator.platform || ''; +} + +var globalDefault = { + // backgroundColor: 'rgba(0,0,0,0)', + + // https://dribbble.com/shots/1065960-Infographic-Pie-chart-visualization + // color: ['#5793f3', '#d14a61', '#fd9c35', '#675bba', '#fec42c', '#dd4444', '#d4df5a', '#cd4870'], + // Light colors: + // color: ['#bcd3bb', '#e88f70', '#edc1a5', '#9dc5c8', '#e1e8c8', '#7b7c68', '#e5b5b5', '#f0b489', '#928ea8', '#bda29a'], + // color: ['#cc5664', '#9bd6ec', '#ea946e', '#8acaaa', '#f1ec64', '#ee8686', '#a48dc1', '#5da6bc', '#b9dcae'], + // Dark colors: + color: ['#c23531','#2f4554', '#61a0a8', '#d48265', '#91c7ae','#749f83', '#ca8622', '#bda29a','#6e7074', '#546570', '#c4ccd3'], + + gradientColor: ['#f6efa6', '#d88273', '#bf444c'], + + // If xAxis and yAxis declared, grid is created by default. + // 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' + }, + + // http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/ + // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation + // Default is source-over + blendMode: null, + + animation: 'auto', + animationDuration: 1000, + animationDurationUpdate: 300, + animationEasing: 'exponentialOut', + animationEasingUpdate: 'cubicOut', + + animationThreshold: 2000, + // Configuration for progressive/incremental rendering + progressiveThreshold: 3000, + progressive: 400, + + // Threshold of if use single hover layer to optimize. + // It is recommended that `hoverLayerThreshold` is equivalent to or less than + // `progressiveThreshold`, otherwise hover will cause restart of progressive, + // which is unexpected. + // see example . + hoverLayerThreshold: 3000, + + // See: module:echarts/scale/Time + useUTC: false +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 inner$2 = makeInner(); + +function getNearestColorPalette(colors, requestColorNum) { + var paletteNum = colors.length; + // TODO colors must be in order + for (var i = 0; i < paletteNum; i++) { + if (colors[i].length > requestColorNum) { + return colors[i]; + } + } + return colors[paletteNum - 1]; +} + +var colorPaletteMixin = { + clearColorPalette: function () { + inner$2(this).colorIdx = 0; + inner$2(this).colorNameMap = {}; + }, + + /** + * @param {string} name MUST NOT be null/undefined. Otherwise call this function + * twise with the same parameters will get different result. + * @param {Object} [scope=this] + * @param {Object} [requestColorNum] + * @return {string} color string. + */ + getColorFromPalette: function (name, scope, requestColorNum) { + scope = scope || this; + var scopeFields = inner$2(scope); + var colorIdx = scopeFields.colorIdx || 0; + var colorNameMap = scopeFields.colorNameMap = scopeFields.colorNameMap || {}; + // Use `hasOwnProperty` to avoid conflict with Object.prototype. + if (colorNameMap.hasOwnProperty(name)) { + return colorNameMap[name]; + } + var defaultColorPalette = normalizeToArray(this.get('color', true)); + var layeredColorPalette = this.get('colorLayer', true); + var colorPalette = ((requestColorNum == null || !layeredColorPalette) + ? defaultColorPalette : getNearestColorPalette(layeredColorPalette, requestColorNum)); + + // In case can't find in layered color palette. + colorPalette = colorPalette || defaultColorPalette; + + if (!colorPalette || !colorPalette.length) { + return; + } + + var color = colorPalette[colorIdx]; + if (name) { + colorNameMap[name] = color; + } + scopeFields.colorIdx = (colorIdx + 1) % colorPalette.length; + + return color; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Helper for model references. + * There are many manners to refer axis/coordSys. + */ + +// TODO +// merge relevant logic to this file? +// check: "modelHelper" of tooltip and "BrushTargetManager". + +/** + * @return {Object} For example: + * { + * coordSysName: 'cartesian2d', + * coordSysDims: ['x', 'y', ...], + * axisMap: HashMap({ + * x: xAxisModel, + * y: yAxisModel + * }), + * categoryAxisMap: HashMap({ + * x: xAxisModel, + * y: undefined + * }), + * // It also indicate that whether there is category axis. + * firstCategoryDimIndex: 1, + * // To replace user specified encode. + * } + */ +function getCoordSysDefineBySeries(seriesModel) { + var coordSysName = seriesModel.get('coordinateSystem'); + var result = { + coordSysName: coordSysName, + coordSysDims: [], + axisMap: createHashMap(), + categoryAxisMap: createHashMap() + }; + var fetch = fetchers[coordSysName]; + if (fetch) { + fetch(seriesModel, result, result.axisMap, result.categoryAxisMap); + return result; + } +} + +var fetchers = { + + cartesian2d: function (seriesModel, result, axisMap, categoryAxisMap) { + var xAxisModel = seriesModel.getReferringComponents('xAxis')[0]; + var yAxisModel = seriesModel.getReferringComponents('yAxis')[0]; + + if (__DEV__) { + if (!xAxisModel) { + throw new Error('xAxis "' + retrieve( + seriesModel.get('xAxisIndex'), + seriesModel.get('xAxisId'), + 0 + ) + '" not found'); + } + if (!yAxisModel) { + throw new Error('yAxis "' + retrieve( + seriesModel.get('xAxisIndex'), + seriesModel.get('yAxisId'), + 0 + ) + '" not found'); + } + } + + result.coordSysDims = ['x', 'y']; + axisMap.set('x', xAxisModel); + axisMap.set('y', yAxisModel); + + if (isCategory(xAxisModel)) { + categoryAxisMap.set('x', xAxisModel); + result.firstCategoryDimIndex = 0; + } + if (isCategory(yAxisModel)) { + categoryAxisMap.set('y', yAxisModel); + result.firstCategoryDimIndex = 1; + } + }, + + singleAxis: function (seriesModel, result, axisMap, categoryAxisMap) { + var singleAxisModel = seriesModel.getReferringComponents('singleAxis')[0]; + + if (__DEV__) { + if (!singleAxisModel) { + throw new Error('singleAxis should be specified.'); + } + } + + result.coordSysDims = ['single']; + axisMap.set('single', singleAxisModel); + + if (isCategory(singleAxisModel)) { + categoryAxisMap.set('single', singleAxisModel); + result.firstCategoryDimIndex = 0; + } + }, + + polar: function (seriesModel, result, axisMap, categoryAxisMap) { + var polarModel = seriesModel.getReferringComponents('polar')[0]; + var radiusAxisModel = polarModel.findAxisModel('radiusAxis'); + var angleAxisModel = polarModel.findAxisModel('angleAxis'); + + if (__DEV__) { + if (!angleAxisModel) { + throw new Error('angleAxis option not found'); + } + if (!radiusAxisModel) { + throw new Error('radiusAxis option not found'); + } + } + + result.coordSysDims = ['radius', 'angle']; + axisMap.set('radius', radiusAxisModel); + axisMap.set('angle', angleAxisModel); + + if (isCategory(radiusAxisModel)) { + categoryAxisMap.set('radius', radiusAxisModel); + result.firstCategoryDimIndex = 0; + } + if (isCategory(angleAxisModel)) { + categoryAxisMap.set('angle', angleAxisModel); + result.firstCategoryDimIndex = 1; + } + }, + + geo: function (seriesModel, result, axisMap, categoryAxisMap) { + result.coordSysDims = ['lng', 'lat']; + }, + + parallel: function (seriesModel, result, axisMap, categoryAxisMap) { + var ecModel = seriesModel.ecModel; + var parallelModel = ecModel.getComponent( + 'parallel', seriesModel.get('parallelIndex') + ); + var coordSysDims = result.coordSysDims = parallelModel.dimensions.slice(); + + each$1(parallelModel.parallelAxisIndex, function (axisIndex, index) { + var axisModel = ecModel.getComponent('parallelAxis', axisIndex); + var axisDim = coordSysDims[index]; + axisMap.set(axisDim, axisModel); + + if (isCategory(axisModel) && result.firstCategoryDimIndex == null) { + categoryAxisMap.set(axisDim, axisModel); + result.firstCategoryDimIndex = index; + } + }); + } +}; + +function isCategory(axisModel) { + return axisModel.get('type') === 'category'; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Avoid typo. +var SOURCE_FORMAT_ORIGINAL = 'original'; +var SOURCE_FORMAT_ARRAY_ROWS = 'arrayRows'; +var SOURCE_FORMAT_OBJECT_ROWS = 'objectRows'; +var SOURCE_FORMAT_KEYED_COLUMNS = 'keyedColumns'; +var SOURCE_FORMAT_UNKNOWN = 'unknown'; +// ??? CHANGE A NAME +var SOURCE_FORMAT_TYPED_ARRAY = 'typedArray'; + +var SERIES_LAYOUT_BY_COLUMN = 'column'; +var SERIES_LAYOUT_BY_ROW = 'row'; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * [sourceFormat] + * + * + "original": + * This format is only used in series.data, where + * itemStyle can be specified in data item. + * + * + "arrayRows": + * [ + * ['product', 'score', 'amount'], + * ['Matcha Latte', 89.3, 95.8], + * ['Milk Tea', 92.1, 89.4], + * ['Cheese Cocoa', 94.4, 91.2], + * ['Walnut Brownie', 85.4, 76.9] + * ] + * + * + "objectRows": + * [ + * {product: 'Matcha Latte', score: 89.3, amount: 95.8}, + * {product: 'Milk Tea', score: 92.1, amount: 89.4}, + * {product: 'Cheese Cocoa', score: 94.4, amount: 91.2}, + * {product: 'Walnut Brownie', score: 85.4, amount: 76.9} + * ] + * + * + "keyedColumns": + * { + * 'product': ['Matcha Latte', 'Milk Tea', 'Cheese Cocoa', 'Walnut Brownie'], + * 'count': [823, 235, 1042, 988], + * 'score': [95.8, 81.4, 91.2, 76.9] + * } + * + * + "typedArray" + * + * + "unknown" + */ + +/** + * @constructor + * @param {Object} fields + * @param {string} fields.sourceFormat + * @param {Array|Object} fields.fromDataset + * @param {Array|Object} [fields.data] + * @param {string} [seriesLayoutBy='column'] + * @param {Array.} [dimensionsDefine] + * @param {Objet|HashMap} [encodeDefine] + * @param {number} [startIndex=0] + * @param {number} [dimensionsDetectCount] + */ +function Source(fields) { + + /** + * @type {boolean} + */ + this.fromDataset = fields.fromDataset; + + /** + * Not null/undefined. + * @type {Array|Object} + */ + this.data = fields.data || ( + fields.sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS ? {} : [] + ); + + /** + * See also "detectSourceFormat". + * Not null/undefined. + * @type {string} + */ + this.sourceFormat = fields.sourceFormat || SOURCE_FORMAT_UNKNOWN; + + /** + * 'row' or 'column' + * Not null/undefined. + * @type {string} seriesLayoutBy + */ + this.seriesLayoutBy = fields.seriesLayoutBy || SERIES_LAYOUT_BY_COLUMN; + + /** + * dimensions definition in option. + * can be null/undefined. + * @type {Array.} + */ + this.dimensionsDefine = fields.dimensionsDefine; + + /** + * encode definition in option. + * can be null/undefined. + * @type {Objet|HashMap} + */ + this.encodeDefine = fields.encodeDefine && createHashMap(fields.encodeDefine); + + /** + * Not null/undefined, uint. + * @type {number} + */ + this.startIndex = fields.startIndex || 0; + + /** + * Can be null/undefined (when unknown), uint. + * @type {number} + */ + this.dimensionsDetectCount = fields.dimensionsDetectCount; +} + +/** + * Wrap original series data for some compatibility cases. + */ +Source.seriesDataToSource = function (data) { + return new Source({ + data: data, + sourceFormat: isTypedArray(data) + ? SOURCE_FORMAT_TYPED_ARRAY + : SOURCE_FORMAT_ORIGINAL, + fromDataset: false + }); +}; + +enableClassCheck(Source); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 inner$3 = makeInner(); + +/** + * @see {module:echarts/data/Source} + * @param {module:echarts/component/dataset/DatasetModel} datasetModel + * @return {string} sourceFormat + */ +function detectSourceFormat(datasetModel) { + var data = datasetModel.option.source; + var sourceFormat = SOURCE_FORMAT_UNKNOWN; + + if (isTypedArray(data)) { + sourceFormat = SOURCE_FORMAT_TYPED_ARRAY; + } + else if (isArray(data)) { + // FIXME Whether tolerate null in top level array? + for (var i = 0, len = data.length; i < len; i++) { + var item = data[i]; + + if (item == null) { + continue; + } + else if (isArray(item)) { + sourceFormat = SOURCE_FORMAT_ARRAY_ROWS; + break; + } + else if (isObject$1(item)) { + sourceFormat = SOURCE_FORMAT_OBJECT_ROWS; + break; + } + } + } + else if (isObject$1(data)) { + for (var key in data) { + if (data.hasOwnProperty(key) && isArrayLike(data[key])) { + sourceFormat = SOURCE_FORMAT_KEYED_COLUMNS; + break; + } + } + } + else if (data != null) { + throw new Error('Invalid data'); + } + + inner$3(datasetModel).sourceFormat = sourceFormat; +} + +/** + * [Scenarios]: + * (1) Provide source data directly: + * series: { + * encode: {...}, + * dimensions: [...] + * seriesLayoutBy: 'row', + * data: [[...]] + * } + * (2) Refer to datasetModel. + * series: [{ + * encode: {...} + * // Ignore datasetIndex means `datasetIndex: 0` + * // and the dimensions defination in dataset is used + * }, { + * encode: {...}, + * seriesLayoutBy: 'column', + * datasetIndex: 1 + * }] + * + * Get data from series itself or datset. + * @return {module:echarts/data/Source} source + */ +function getSource(seriesModel) { + return inner$3(seriesModel).source; +} + +/** + * MUST be called before mergeOption of all series. + * @param {module:echarts/model/Global} ecModel + */ +function resetSourceDefaulter(ecModel) { + // `datasetMap` is used to make default encode. + inner$3(ecModel).datasetMap = createHashMap(); +} + +/** + * [Caution]: + * MUST be called after series option merged and + * before "series.getInitailData()" called. + * + * [The rule of making default encode]: + * Category axis (if exists) alway map to the first dimension. + * Each other axis occupies a subsequent dimension. + * + * [Why make default encode]: + * Simplify the typing of encode in option, avoiding the case like that: + * series: [{encode: {x: 0, y: 1}}, {encode: {x: 0, y: 2}}, {encode: {x: 0, y: 3}}], + * where the "y" have to be manually typed as "1, 2, 3, ...". + * + * @param {module:echarts/model/Series} seriesModel + */ +function prepareSource(seriesModel) { + var seriesOption = seriesModel.option; + + var data = seriesOption.data; + var sourceFormat = isTypedArray(data) + ? SOURCE_FORMAT_TYPED_ARRAY : SOURCE_FORMAT_ORIGINAL; + var fromDataset = false; + + var seriesLayoutBy = seriesOption.seriesLayoutBy; + var sourceHeader = seriesOption.sourceHeader; + var dimensionsDefine = seriesOption.dimensions; + + var datasetModel = getDatasetModel(seriesModel); + if (datasetModel) { + var datasetOption = datasetModel.option; + + data = datasetOption.source; + sourceFormat = inner$3(datasetModel).sourceFormat; + fromDataset = true; + + // These settings from series has higher priority. + seriesLayoutBy = seriesLayoutBy || datasetOption.seriesLayoutBy; + sourceHeader == null && (sourceHeader = datasetOption.sourceHeader); + dimensionsDefine = dimensionsDefine || datasetOption.dimensions; + } + + var completeResult = completeBySourceData( + data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine + ); + + // Note: dataset option does not have `encode`. + var encodeDefine = seriesOption.encode; + if (!encodeDefine && datasetModel) { + encodeDefine = makeDefaultEncode( + seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult + ); + } + + inner$3(seriesModel).source = new Source({ + data: data, + fromDataset: fromDataset, + seriesLayoutBy: seriesLayoutBy, + sourceFormat: sourceFormat, + dimensionsDefine: completeResult.dimensionsDefine, + startIndex: completeResult.startIndex, + dimensionsDetectCount: completeResult.dimensionsDetectCount, + encodeDefine: encodeDefine + }); +} + +// return {startIndex, dimensionsDefine, dimensionsCount} +function completeBySourceData(data, sourceFormat, seriesLayoutBy, sourceHeader, dimensionsDefine) { + if (!data) { + return {dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine)}; + } + + var dimensionsDetectCount; + var startIndex; + var findPotentialName; + + if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { + // Rule: Most of the first line are string: it is header. + // Caution: consider a line with 5 string and 1 number, + // it still can not be sure it is a head, because the + // 5 string may be 5 values of category columns. + if (sourceHeader === 'auto' || sourceHeader == null) { + arrayRowsTravelFirst(function (val) { + // '-' is regarded as null/undefined. + if (val != null && val !== '-') { + if (isString(val)) { + startIndex == null && (startIndex = 1); + } + else { + startIndex = 0; + } + } + // 10 is an experience number, avoid long loop. + }, seriesLayoutBy, data, 10); + } + else { + startIndex = sourceHeader ? 1 : 0; + } + + if (!dimensionsDefine && startIndex === 1) { + dimensionsDefine = []; + arrayRowsTravelFirst(function (val, index) { + dimensionsDefine[index] = val != null ? val : ''; + }, seriesLayoutBy, data); + } + + dimensionsDetectCount = dimensionsDefine + ? dimensionsDefine.length + : seriesLayoutBy === SERIES_LAYOUT_BY_ROW + ? data.length + : data[0] + ? data[0].length + : null; + } + else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { + if (!dimensionsDefine) { + dimensionsDefine = objectRowsCollectDimensions(data); + findPotentialName = true; + } + } + else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { + if (!dimensionsDefine) { + dimensionsDefine = []; + findPotentialName = true; + each$1(data, function (colArr, key) { + dimensionsDefine.push(key); + }); + } + } + else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { + var value0 = getDataItemValue(data[0]); + dimensionsDetectCount = isArray(value0) && value0.length || 1; + } + else if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { + if (__DEV__) { + assert$1(!!dimensionsDefine, 'dimensions must be given if data is TypedArray.'); + } + } + + var potentialNameDimIndex; + if (findPotentialName) { + each$1(dimensionsDefine, function (dim, idx) { + if ((isObject$1(dim) ? dim.name : dim) === 'name') { + potentialNameDimIndex = idx; + } + }); + } + + return { + startIndex: startIndex, + dimensionsDefine: normalizeDimensionsDefine(dimensionsDefine), + dimensionsDetectCount: dimensionsDetectCount, + potentialNameDimIndex: potentialNameDimIndex + // TODO: potentialIdDimIdx + }; +} + +// Consider dimensions defined like ['A', 'price', 'B', 'price', 'C', 'price'], +// which is reasonable. But dimension name is duplicated. +// Returns undefined or an array contains only object without null/undefiend or string. +function normalizeDimensionsDefine(dimensionsDefine) { + if (!dimensionsDefine) { + // The meaning of null/undefined is different from empty array. + return; + } + var nameMap = createHashMap(); + return map(dimensionsDefine, function (item, index) { + item = extend({}, isObject$1(item) ? item : {name: item}); + + // User can set null in dimensions. + // We dont auto specify name, othewise a given name may + // cause it be refered unexpectedly. + if (item.name == null) { + return item; + } + + // Also consider number form like 2012. + item.name += ''; + // User may also specify displayName. + // displayName will always exists except user not + // specified or dim name is not specified or detected. + // (A auto generated dim name will not be used as + // displayName). + if (item.displayName == null) { + item.displayName = item.name; + } + + var exist = nameMap.get(item.name); + if (!exist) { + nameMap.set(item.name, {count: 1}); + } + else { + item.name += '-' + exist.count++; + } + + return item; + }); +} + +function arrayRowsTravelFirst(cb, seriesLayoutBy, data, maxLoop) { + maxLoop == null && (maxLoop = Infinity); + if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { + for (var i = 0; i < data.length && i < maxLoop; i++) { + cb(data[i] ? data[i][0] : null, i); + } + } + else { + var value0 = data[0] || []; + for (var i = 0; i < value0.length && i < maxLoop; i++) { + cb(value0[i], i); + } + } +} + +function objectRowsCollectDimensions(data) { + var firstIndex = 0; + var obj; + while (firstIndex < data.length && !(obj = data[firstIndex++])) {} // jshint ignore: line + if (obj) { + var dimensions = []; + each$1(obj, function (value, key) { + dimensions.push(key); + }); + return dimensions; + } +} + +// ??? TODO merge to completedimensions, where also has +// default encode making logic. And the default rule +// should depends on series? consider 'map'. +function makeDefaultEncode( + seriesModel, datasetModel, data, sourceFormat, seriesLayoutBy, completeResult +) { + var coordSysDefine = getCoordSysDefineBySeries(seriesModel); + var encode = {}; + // var encodeTooltip = []; + // var encodeLabel = []; + var encodeItemName = []; + var encodeSeriesName = []; + var seriesType = seriesModel.subType; + + // ??? TODO refactor: provide by series itself. + // Consider the case: 'map' series is based on geo coordSys, + // 'graph', 'heatmap' can be based on cartesian. But can not + // give default rule simply here. + var nSeriesMap = createHashMap(['pie', 'map', 'funnel']); + var cSeriesMap = createHashMap([ + 'line', 'bar', 'pictorialBar', 'scatter', 'effectScatter', 'candlestick', 'boxplot' + ]); + + // Usually in this case series will use the first data + // dimension as the "value" dimension, or other default + // processes respectively. + if (coordSysDefine && cSeriesMap.get(seriesType) != null) { + var ecModel = seriesModel.ecModel; + var datasetMap = inner$3(ecModel).datasetMap; + var key = datasetModel.uid + '_' + seriesLayoutBy; + var datasetRecord = datasetMap.get(key) + || datasetMap.set(key, {categoryWayDim: 1, valueWayDim: 0}); + + // TODO + // Auto detect first time axis and do arrangement. + each$1(coordSysDefine.coordSysDims, function (coordDim) { + // In value way. + if (coordSysDefine.firstCategoryDimIndex == null) { + var dataDim = datasetRecord.valueWayDim++; + encode[coordDim] = dataDim; + + // ??? TODO give a better default series name rule? + // especially when encode x y specified. + // consider: when mutiple series share one dimension + // category axis, series name should better use + // the other dimsion name. On the other hand, use + // both dimensions name. + + encodeSeriesName.push(dataDim); + // encodeTooltip.push(dataDim); + // encodeLabel.push(dataDim); + } + // In category way, category axis. + else if (coordSysDefine.categoryAxisMap.get(coordDim)) { + encode[coordDim] = 0; + encodeItemName.push(0); + } + // In category way, non-category axis. + else { + var dataDim = datasetRecord.categoryWayDim++; + encode[coordDim] = dataDim; + // encodeTooltip.push(dataDim); + // encodeLabel.push(dataDim); + encodeSeriesName.push(dataDim); + } + }); + } + // Do not make a complex rule! Hard to code maintain and not necessary. + // ??? TODO refactor: provide by series itself. + // [{name: ..., value: ...}, ...] like: + else if (nSeriesMap.get(seriesType) != null) { + // Find the first not ordinal. (5 is an experience value) + var firstNotOrdinal; + for (var i = 0; i < 5 && firstNotOrdinal == null; i++) { + if (!doGuessOrdinal( + data, sourceFormat, seriesLayoutBy, + completeResult.dimensionsDefine, completeResult.startIndex, i + )) { + firstNotOrdinal = i; + } + } + if (firstNotOrdinal != null) { + encode.value = firstNotOrdinal; + var nameDimIndex = completeResult.potentialNameDimIndex + || Math.max(firstNotOrdinal - 1, 0); + // By default, label use itemName in charts. + // So we dont set encodeLabel here. + encodeSeriesName.push(nameDimIndex); + encodeItemName.push(nameDimIndex); + // encodeTooltip.push(firstNotOrdinal); + } + } + + // encodeTooltip.length && (encode.tooltip = encodeTooltip); + // encodeLabel.length && (encode.label = encodeLabel); + encodeItemName.length && (encode.itemName = encodeItemName); + encodeSeriesName.length && (encode.seriesName = encodeSeriesName); + + return encode; +} + +/** + * If return null/undefined, indicate that should not use datasetModel. + */ +function getDatasetModel(seriesModel) { + var option = seriesModel.option; + // Caution: consider the scenario: + // A dataset is declared and a series is not expected to use the dataset, + // and at the beginning `setOption({series: { noData })` (just prepare other + // option but no data), then `setOption({series: {data: [...]}); In this case, + // the user should set an empty array to avoid that dataset is used by default. + var thisData = option.data; + if (!thisData) { + return seriesModel.ecModel.getComponent('dataset', option.datasetIndex || 0); + } +} + +/** + * The rule should not be complex, otherwise user might not + * be able to known where the data is wrong. + * The code is ugly, but how to make it neat? + * + * @param {module:echars/data/Source} source + * @param {number} dimIndex + * @return {boolean} Whether ordinal. + */ +function guessOrdinal(source, dimIndex) { + return doGuessOrdinal( + source.data, + source.sourceFormat, + source.seriesLayoutBy, + source.dimensionsDefine, + source.startIndex, + dimIndex + ); +} + +// dimIndex may be overflow source data. +function doGuessOrdinal( + data, sourceFormat, seriesLayoutBy, dimensionsDefine, startIndex, dimIndex +) { + var result; + // Experience value. + var maxLoop = 5; + + if (isTypedArray(data)) { + return false; + } + + // When sourceType is 'objectRows' or 'keyedColumns', dimensionsDefine + // always exists in source. + var dimName; + if (dimensionsDefine) { + dimName = dimensionsDefine[dimIndex]; + dimName = isObject$1(dimName) ? dimName.name : dimName; + } + + if (sourceFormat === SOURCE_FORMAT_ARRAY_ROWS) { + if (seriesLayoutBy === SERIES_LAYOUT_BY_ROW) { + var sample = data[dimIndex]; + for (var i = 0; i < (sample || []).length && i < maxLoop; i++) { + if ((result = detectValue(sample[startIndex + i])) != null) { + return result; + } + } + } + else { + for (var i = 0; i < data.length && i < maxLoop; i++) { + var row = data[startIndex + i]; + if (row && (result = detectValue(row[dimIndex])) != null) { + return result; + } + } + } + } + else if (sourceFormat === SOURCE_FORMAT_OBJECT_ROWS) { + if (!dimName) { + return; + } + for (var i = 0; i < data.length && i < maxLoop; i++) { + var item = data[i]; + if (item && (result = detectValue(item[dimName])) != null) { + return result; + } + } + } + else if (sourceFormat === SOURCE_FORMAT_KEYED_COLUMNS) { + if (!dimName) { + return; + } + var sample = data[dimName]; + if (!sample || isTypedArray(sample)) { + return false; + } + for (var i = 0; i < sample.length && i < maxLoop; i++) { + if ((result = detectValue(sample[i])) != null) { + return result; + } + } + } + else if (sourceFormat === SOURCE_FORMAT_ORIGINAL) { + for (var i = 0; i < data.length && i < maxLoop; i++) { + var item = data[i]; + var val = getDataItemValue(item); + if (!isArray(val)) { + return false; + } + if ((result = detectValue(val[dimIndex])) != null) { + return result; + } + } + } + + function detectValue(val) { + // Consider usage convenience, '1', '2' will be treated as "number". + // `isFinit('')` get `true`. + if (val != null && isFinite(val) && val !== '') { + return false; + } + else if (isString(val) && val !== '-') { + return true; + } + } + + return false; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * ECharts global model + * + * @module {echarts/model/Global} + */ + + +/** + * Caution: If the mechanism should be changed some day, these cases + * should be considered: + * + * (1) In `merge option` mode, if using the same option to call `setOption` + * many times, the result should be the same (try our best to ensure that). + * (2) In `merge option` mode, if a component has no id/name specified, it + * will be merged by index, and the result sequence of the components is + * consistent to the original sequence. + * (3) `reset` feature (in toolbox). Find detailed info in comments about + * `mergeOption` in module:echarts/model/OptionManager. + */ + +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({ + + 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) { + assert$1( + !(OPTION_INNER_KEY in option), + 'please use chart.getOption()' + ); + + this._optionManager.setOption(option, optionPreprocessorFuncs); + + this.resetOption(null); + }, + + /** + * @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$1(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 = []; + + resetSourceDefaulter(this); + + // If no component class, merge directly. + // For example: color, animaiton options, etc. + each$1(newOption, function (componentOption, mainType) { + if (componentOption == null) { + return; + } + + if (!ComponentModel.hasClass(mainType)) { + // globalSettingTask.dirty(); + option[mainType] = option[mainType] == null + ? clone(componentOption) + : merge(option[mainType], componentOption, true); + } + else if (mainType) { + newCptTypes.push(mainType); + } + }); + + ComponentModel.topologicalTravel( + newCptTypes, ComponentModel.getAllClassMainTypes(), visitComponent, this + ); + + function visitComponent(mainType, dependencies) { + + var newCptOptionList = normalizeToArray(newOption[mainType]); + + var mapResult = mappingToExists( + componentsMap.get(mainType), newCptOptionList + ); + + makeIdAndName(mapResult); + + // Set mainType and complete subType. + each$1(mapResult, function (item, index) { + var opt = item.option; + if (isObject$1(opt)) { + item.keyInfo.mainType = mainType; + item.keyInfo.subType = determineSubType(mainType, opt, item.exist); + } + }); + + var dependentModels = getComponentsByTypes( + componentsMap, dependencies + ); + + option[mainType] = []; + componentsMap.set(mainType, []); + + each$1(mapResult, function (resultItem, index) { + var componentModel = resultItem.exist; + var newCptOption = resultItem.option; + + assert$1( + isObject$1(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({}, false); + } + else { + var ComponentModelClass = ComponentModel.getClass( + mainType, resultItem.keyInfo.subType, true + ); + + if (componentModel && componentModel instanceof ComponentModelClass) { + componentModel.name = resultItem.keyInfo.name; + // componentModel.settingTask && componentModel.settingTask.dirty(); + componentModel.mergeOption(newCptOption, this); + componentModel.optionUpdated(newCptOption, false); + } + else { + // PENDING Global as parent ? + var extraOpt = extend( + { + dependentModels: dependentModels, + componentIndex: index + }, + resultItem.keyInfo + ); + componentModel = new ComponentModelClass( + newCptOption, this, this, extraOpt + ); + extend(componentModel, extraOpt); + componentModel.init(newCptOption, this, this, extraOpt); + + // Call optionUpdated after init. + // newCptOption has been used as componentModel.option + // and may be merged with theme and default, so pass null + // to avoid confusion. + componentModel.optionUpdated(null, true); + } + } + + componentsMap.get(mainType)[index] = componentModel; + option[mainType][index] = componentModel.option; + }, this); + + // Backup series for filtering. + if (mainType === 'series') { + createSeriesIndices(this, componentsMap.get('series')); + } + } + + this._seriesIndicesMap = createHashMap( + this._seriesIndices = this._seriesIndices || [] + ); + }, + + /** + * Get option for output (cloned option and inner info removed) + * @public + * @return {Object} + */ + getOption: function () { + var option = clone(this.option); + + each$1(option, function (opts, mainType) { + if (ComponentModel.hasClass(mainType)) { + var opts = normalizeToArray(opts); + for (var i = opts.length - 1; i >= 0; i--) { + // Remove options with inner id. + if (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.get(mainType); + if (list) { + return list[idx || 0]; + } + }, + + /** + * If none of index and id and name used, return all components with mainType. + * @param {Object} condition + * @param {string} condition.mainType + * @param {string} [condition.subType] If ignore, only query by mainType + * @param {number|Array.} [condition.index] Either input index or id or name. + * @param {string|Array.} [condition.id] Either input index or id or name. + * @param {string|Array.} [condition.name] Either input index or id or name. + * @return {Array.} + */ + 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.get(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); + }); + } + else { + // Return all components with mainType + result = cpts.slice(); + } + + return filterBySubType(result, condition); + }, + + /** + * The interface is different from queryComponents, + * which is convenient for inner usage. + * + * @usage + * var result = findComponents( + * {mainType: 'dataZoom', query: {dataZoomId: 'abc'}} + * ); + * var result = findComponents( + * {mainType: 'series', subType: 'pie', query: {seriesName: 'uio'}} + * ); + * 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.} + */ + findComponents: function (condition) { + var query = condition.query; + var mainType = condition.mainType; + + var queryCond = getQueryCond(query); + var result = queryCond + ? this.queryComponents(queryCond) + : this._componentsMap.get(mainType); + + return doFilter(filterBySubType(result, condition)); + + function getQueryCond(q) { + var indexAttr = mainType + 'Index'; + var idAttr = mainType + 'Id'; + var nameAttr = mainType + 'Name'; + return q && ( + q[indexAttr] != null + || q[idAttr] != null + || q[nameAttr] != null + ) + ? { + 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; + componentsMap.each(function (components, componentType) { + each$1(components, function (component, index) { + cb.call(context, componentType, component, index); + }); + }); + } + else if (isString(mainType)) { + each$1(componentsMap.get(mainType), cb, context); + } + else if (isObject$1(mainType)) { + var queryResult = this.findComponents(mainType); + each$1(queryResult, cb, context); + } + }, + + /** + * @param {string} name + * @return {Array.} + */ + getSeriesByName: function (name) { + var series = this._componentsMap.get('series'); + return filter(series, function (oneSeries) { + return oneSeries.name === name; + }); + }, + + /** + * @param {number} seriesIndex + * @return {module:echarts/model/Series} + */ + getSeriesByIndex: function (seriesIndex) { + return this._componentsMap.get('series')[seriesIndex]; + }, + + /** + * Get series list before filtered by type. + * FIXME: rename to getRawSeriesByType? + * + * @param {string} subType + * @return {Array.} + */ + getSeriesByType: function (subType) { + var series = this._componentsMap.get('series'); + return filter(series, function (oneSeries) { + return oneSeries.subType === subType; + }); + }, + + /** + * @return {Array.} + */ + getSeries: function () { + return this._componentsMap.get('series').slice(); + }, + + /** + * @return {number} + */ + getSeriesCount: function () { + return this._componentsMap.get('series').length; + }, + + /** + * After filtering, series may be different + * frome raw series. + * + * @param {Function} cb + * @param {*} context + */ + eachSeries: function (cb, context) { + assertSeriesInitialized(this); + each$1(this._seriesIndices, function (rawSeriesIndex) { + var series = this._componentsMap.get('series')[rawSeriesIndex]; + cb.call(context, series, rawSeriesIndex); + }, this); + }, + + /** + * Iterate raw series before filtered. + * + * @param {Function} cb + * @param {*} context + */ + eachRawSeries: function (cb, context) { + each$1(this._componentsMap.get('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$1(this._seriesIndices, function (rawSeriesIndex) { + var series = this._componentsMap.get('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$1(this.getSeriesByType(subType), cb, context); + }, + + /** + * @param {module:echarts/model/Series} seriesModel + */ + isSeriesFiltered: function (seriesModel) { + assertSeriesInitialized(this); + return this._seriesIndicesMap.get(seriesModel.componentIndex) == null; + }, + + /** + * @return {Array.} + */ + getCurrentSeriesIndices: function () { + return (this._seriesIndices || []).slice(); + }, + + /** + * @param {Function} cb + * @param {*} context + */ + filterSeries: function (cb, context) { + assertSeriesInitialized(this); + var filteredSeries = filter( + this._componentsMap.get('series'), cb, context + ); + createSeriesIndices(this, filteredSeries); + }, + + restoreData: function (payload) { + var componentsMap = this._componentsMap; + + createSeriesIndices(this, componentsMap.get('series')); + + var componentTypes = []; + componentsMap.each(function (components, componentType) { + componentTypes.push(componentType); + }); + + ComponentModel.topologicalTravel( + componentTypes, + ComponentModel.getAllClassMainTypes(), + function (componentType, dependencies) { + each$1(componentsMap.get(componentType), function (component) { + (componentType !== 'series' || !isNotTargetSeries(component, payload)) + && component.restoreData(); + }); + } + ); + } + +}); + +function isNotTargetSeries(seriesModel, payload) { + if (payload) { + var index = payload.seiresIndex; + var id = payload.seriesId; + var name = payload.seriesName; + return (index != null && seriesModel.componentIndex !== index) + || (id != null && seriesModel.id !== id) + || (name != null && seriesModel.name !== name); + } +} + +/** + * @inner + */ +function mergeTheme(option, theme) { + // PENDING + // NOT use `colorLayer` in theme if option has `color` + var notMergeColorLayer = option.color && !option.colorLayer; + + each$1(theme, function (themeItem, name) { + if (name === 'colorLayer' && notMergeColorLayer) { + return; + } + // 如果有 component model 则把具体的 merge 逻辑交给该 model 处理 + if (!ComponentModel.hasClass(name)) { + if (typeof themeItem === 'object') { + option[name] = !option[name] + ? clone(themeItem) + : merge(option[name], themeItem, false); + } + else { + if (option[name] == null) { + option[name] = themeItem; + } + } + } + }); +} + +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; + + /** + * Init with series: [], in case of calling findSeries method + * before series initialized. + * @type {Object.>} + * @private + */ + this._componentsMap = createHashMap({series: []}); + + /** + * Mapping between filtered series list and raw series list. + * key: filtered series indices, value: raw series indices. + * @type {Array.} + * @private + */ + this._seriesIndices; + + this._seriesIndicesMap; + + mergeTheme(baseOption, this._theme.option); + + // TODO Needs clone when merging to the unexisted property + merge(baseOption, globalDefault, false); + + this.mergeOption(baseOption); +} + +/** + * @inner + * @param {Array.|string} types model types + * @return {Object} key: {string} type, value: {Array.} models + */ +function getComponentsByTypes(componentsMap, types) { + if (!isArray(types)) { + types = types ? [types] : []; + } + + var ret = {}; + each$1(types, function (type) { + ret[type] = (componentsMap.get(type) || []).slice(); + }); + + return ret; +} + +/** + * @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(ecModel, seriesModels) { + ecModel._seriesIndicesMap = createHashMap( + ecModel._seriesIndices = 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 (__DEV__) { + if (!ecModel._seriesIndices) { + throw new Error('Option should contains series.'); + } + } +} + +mixin(GlobalModel, colorPaletteMixin); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 echartsAPIList = [ + 'getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isDisposed', + 'on', 'off', 'getDataURL', 'getConnectedDataURL', 'getModel', 'getOption', + 'getViewOfComponentModel', 'getViewOfSeriesModel' +]; +// And `getCoordinateSystems` and `getComponentByElement` will be injected in echarts.js + +function ExtensionAPI(chartInstance) { + each$1(echartsAPIList, function (name) { + this[name] = bind(chartInstance[name], chartInstance); + }, this); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 coordinateSystemCreators = {}; + +function CoordinateSystemManager() { + + this._coordinateSystems = []; +} + +CoordinateSystemManager.prototype = { + + constructor: CoordinateSystemManager, + + create: function (ecModel, api) { + var coordinateSystems = []; + each$1(coordinateSystemCreators, function (creater, type) { + var list = creater.create(ecModel, api); + coordinateSystems = coordinateSystems.concat(list || []); + }); + + this._coordinateSystems = coordinateSystems; + }, + + update: function (ecModel, api) { + each$1(this._coordinateSystems, function (coordSys) { + coordSys.update && coordSys.update(ecModel, api); + }); + }, + + getCoordinateSystems: function () { + return this._coordinateSystems.slice(); + } +}; + +CoordinateSystemManager.register = function (type, coordinateSystemCreator) { + coordinateSystemCreators[type] = coordinateSystemCreator; +}; + +CoordinateSystemManager.get = function (type) { + return coordinateSystemCreators[type]; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * ECharts option manager + * + * @module {echarts/model/OptionManager} + */ + + +var each$4 = each$1; +var clone$3 = clone; +var map$1 = map; +var merge$1 = 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.} + */ + this._timelineOptions = []; + + /** + * @private + * @type {Array.} + */ + this._mediaList = []; + + /** + * @private + * @type {Object} + */ + this._mediaDefault; + + /** + * -1, means default. + * empty means no media. + * @private + * @type {Array.} + */ + this._currentMediaIndices = []; + + /** + * @private + * @type {Object} + */ + this._optionBackup; + + /** + * @private + * @type {Object} + */ + this._newBaseOption; +} + +// 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.} optionPreprocessorFuncs + * @return {Object} Init option + */ + setOption: function (rawOption, optionPreprocessorFuncs) { + if (rawOption) { + // That set dat primitive is dangerous if user reuse the data when setOption again. + each$1(normalizeToArray(rawOption.series), function (series) { + series && series.data && isTypedArray(series.data) && setAsPrimitive(series.data); + }); + } + + // Caution: some series modify option data, if do not clone, + // it should ensure that the repeat modify correctly + // (create a new object when modify itself). + rawOption = clone$3(rawOption, true); + + // FIXME + // 如果 timeline options 或者 media 中设置了某个属性,而baseOption中没有设置,则进行警告。 + + var oldOptionBackup = this._optionBackup; + var newParsedOption = parseRawOption.call( + this, rawOption, optionPreprocessorFuncs, !oldOptionBackup + ); + this._newBaseOption = newParsedOption.baseOption; + + // For setOption at second time (using merge mode); + if (oldOptionBackup) { + // Only baseOption can be merged. + mergeOption(oldOptionBackup.baseOption, newParsedOption.baseOption); + + // For simplicity, timeline options and media options do not support merge, + // that is, if you `setOption` twice and both has timeline options, the latter + // timeline opitons will not be merged to the formers, but just substitude them. + if (newParsedOption.timelineOptions.length) { + oldOptionBackup.timelineOptions = newParsedOption.timelineOptions; + } + if (newParsedOption.mediaList.length) { + oldOptionBackup.mediaList = newParsedOption.mediaList; + } + if (newParsedOption.mediaDefault) { + oldOptionBackup.mediaDefault = newParsedOption.mediaDefault; + } + } + else { + this._optionBackup = newParsedOption; + } + }, + + /** + * @param {boolean} isRecreate + * @return {Object} + */ + mountOption: function (isRecreate) { + var optionBackup = this._optionBackup; + + // TODO + // 如果没有reset功能则不clone。 + + this._timelineOptions = map$1(optionBackup.timelineOptions, clone$3); + this._mediaList = map$1(optionBackup.mediaList, clone$3); + this._mediaDefault = clone$3(optionBackup.mediaDefault); + this._currentMediaIndices = []; + + return clone$3(isRecreate + // this._optionBackup.baseOption, which is created at the first `setOption` + // called, and is merged into every new option by inner method `mergeOption` + // each time `setOption` called, can be only used in `isRecreate`, because + // its reliability is under suspicion. In other cases option merge is + // performed by `model.mergeOption`. + ? optionBackup.baseOption : this._newBaseOption + ); + }, + + /** + * @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$3( + timelineOptions[timelineModel.getCurrentIndex()], + true + ); + } + } + + return option; + }, + + /** + * @param {module:echarts/model/Global} ecModel + * @return {Array.} + */ + 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$1(indices, function (index) { + return clone$3( + index === -1 ? mediaDefault.option : mediaList[index].option + ); + }); + } + // Otherwise return nothing. + + this._currentMediaIndices = indices; + + return result; + } +}; + +function parseRawOption(rawOption, optionPreprocessorFuncs, isNew) { + 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$4(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$4([baseOption].concat(timelineOptions) + .concat(map(mediaList, function (media) { + return media.option; + })), + function (option) { + each$4(optionPreprocessorFuncs, function (preProcess) { + preProcess(option, isNew); + }); + } + ); + + return { + baseOption: baseOption, + timelineOptions: timelineOptions, + mediaDefault: mediaDefault, + mediaList: mediaList + }; +} + +/** + * @see + * 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; + + each$1(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$4(newOption, function (newCptOpt, mainType) { + if (newCptOpt == null) { + return; + } + + var oldCptOpt = oldOption[mainType]; + + if (!ComponentModel.hasClass(mainType)) { + oldOption[mainType] = merge$1(oldCptOpt, newCptOpt, true); + } + else { + newCptOpt = normalizeToArray(newCptOpt); + oldCptOpt = normalizeToArray(oldCptOpt); + + var mapResult = mappingToExists(oldCptOpt, newCptOpt); + + oldOption[mainType] = map$1(mapResult, function (item) { + return (item.option && item.exist) + ? merge$1(item.exist, item.option, true) + : (item.exist || item.option); + }); + } + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$5 = each$1; +var isObject$3 = isObject$1; + +var POSSIBLE_STYLES = [ + 'areaStyle', 'lineStyle', 'nodeStyle', 'linkStyle', + 'chordStyle', 'label', 'labelLine' +]; + +function compatEC2ItemStyle(opt) { + var itemStyleOpt = opt && opt.itemStyle; + if (!itemStyleOpt) { + return; + } + for (var i = 0, len = POSSIBLE_STYLES.length; i < len; i++) { + var styleName = POSSIBLE_STYLES[i]; + 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 { + 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 { + merge(opt[styleName].emphasis, emphasisItemStyleOpt[styleName]); + } + emphasisItemStyleOpt[styleName] = null; + } + } +} + +function convertNormalEmphasis(opt, optType, useExtend) { + if (opt && opt[optType] && (opt[optType].normal || opt[optType].emphasis)) { + var normalOpt = opt[optType].normal; + var emphasisOpt = opt[optType].emphasis; + + if (normalOpt) { + // Timeline controlStyle has other properties besides normal and emphasis + if (useExtend) { + opt[optType].normal = opt[optType].emphasis = null; + defaults(opt[optType], normalOpt); + } + else { + opt[optType] = normalOpt; + } + } + if (emphasisOpt) { + opt.emphasis = opt.emphasis || {}; + opt.emphasis[optType] = emphasisOpt; + } + } +} +function removeEC3NormalStatus(opt) { + convertNormalEmphasis(opt, 'itemStyle'); + convertNormalEmphasis(opt, 'lineStyle'); + convertNormalEmphasis(opt, 'areaStyle'); + convertNormalEmphasis(opt, 'label'); + convertNormalEmphasis(opt, 'labelLine'); + // treemap + convertNormalEmphasis(opt, 'upperLabel'); + // graph + convertNormalEmphasis(opt, 'edgeLabel'); +} + +function compatTextStyle(opt, propName) { + // Check whether is not object (string\null\undefined ...) + var labelOptSingle = isObject$3(opt) && opt[propName]; + var textStyle = isObject$3(labelOptSingle) && labelOptSingle.textStyle; + if (textStyle) { + for (var i = 0, len = TEXT_STYLE_OPTIONS.length; i < len; i++) { + var propName = TEXT_STYLE_OPTIONS[i]; + if (textStyle.hasOwnProperty(propName)) { + labelOptSingle[propName] = textStyle[propName]; + } + } + } +} + +function compatEC3CommonStyles(opt) { + if (opt) { + removeEC3NormalStatus(opt); + compatTextStyle(opt, 'label'); + opt.emphasis && compatTextStyle(opt.emphasis, 'label'); + } +} + +function processSeries(seriesOpt) { + if (!isObject$3(seriesOpt)) { + return; + } + + compatEC2ItemStyle(seriesOpt); + removeEC3NormalStatus(seriesOpt); + + compatTextStyle(seriesOpt, 'label'); + // treemap + compatTextStyle(seriesOpt, 'upperLabel'); + // graph + compatTextStyle(seriesOpt, 'edgeLabel'); + if (seriesOpt.emphasis) { + compatTextStyle(seriesOpt.emphasis, 'label'); + // treemap + compatTextStyle(seriesOpt.emphasis, 'upperLabel'); + // graph + compatTextStyle(seriesOpt.emphasis, 'edgeLabel'); + } + + var markPoint = seriesOpt.markPoint; + if (markPoint) { + compatEC2ItemStyle(markPoint); + compatEC3CommonStyles(markPoint); + } + + var markLine = seriesOpt.markLine; + if (markLine) { + compatEC2ItemStyle(markLine); + compatEC3CommonStyles(markLine); + } + + var markArea = seriesOpt.markArea; + if (markArea) { + compatEC3CommonStyles(markArea); + } + + var data = seriesOpt.data; + + // Break with ec3: if `setOption` again, there may be no `type` in option, + // then the backward compat based on option type will not be performed. + + if (seriesOpt.type === 'graph') { + data = data || seriesOpt.nodes; + var edgeData = seriesOpt.links || seriesOpt.edges; + if (edgeData && !isTypedArray(edgeData)) { + for (var i = 0; i < edgeData.length; i++) { + compatEC3CommonStyles(edgeData[i]); + } + } + each$1(seriesOpt.categories, function (opt) { + removeEC3NormalStatus(opt); + }); + } + + if (data && !isTypedArray(data)) { + for (var i = 0; i < data.length; i++) { + compatEC3CommonStyles(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++) { + compatEC3CommonStyles(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 (isArray(mlData[i])) { + compatEC3CommonStyles(mlData[i][0]); + compatEC3CommonStyles(mlData[i][1]); + } + else { + compatEC3CommonStyles(mlData[i]); + } + } + } + + // Series + if (seriesOpt.type === 'gauge') { + compatTextStyle(seriesOpt, 'axisLabel'); + compatTextStyle(seriesOpt, 'title'); + compatTextStyle(seriesOpt, 'detail'); + } + else if (seriesOpt.type === 'treemap') { + convertNormalEmphasis(seriesOpt.breadcrumb, 'itemStyle'); + each$1(seriesOpt.levels, function (opt) { + removeEC3NormalStatus(opt); + }); + } + else if (seriesOpt.type === 'tree') { + removeEC3NormalStatus(seriesOpt.leaves); + } + // sunburst starts from ec4, so it does not need to compat levels. +} + +function toArr(o) { + return isArray(o) ? o : o ? [o] : []; +} + +function toObj(o) { + return (isArray(o) ? o[0] : o) || {}; +} + +var compatStyle = function (option, isTheme) { + each$5(toArr(option.series), function (seriesOpt) { + isObject$3(seriesOpt) && processSeries(seriesOpt); + }); + + var axes = ['xAxis', 'yAxis', 'radiusAxis', 'angleAxis', 'singleAxis', 'parallelAxis', 'radar']; + isTheme && axes.push('valueAxis', 'categoryAxis', 'logAxis', 'timeAxis'); + + each$5( + axes, + function (axisName) { + each$5(toArr(option[axisName]), function (axisOpt) { + if (axisOpt) { + compatTextStyle(axisOpt, 'axisLabel'); + compatTextStyle(axisOpt.axisPointer, 'label'); + } + }); + } + ); + + each$5(toArr(option.parallel), function (parallelOpt) { + var parallelAxisDefault = parallelOpt && parallelOpt.parallelAxisDefault; + compatTextStyle(parallelAxisDefault, 'axisLabel'); + compatTextStyle(parallelAxisDefault && parallelAxisDefault.axisPointer, 'label'); + }); + + each$5(toArr(option.calendar), function (calendarOpt) { + convertNormalEmphasis(calendarOpt, 'itemStyle'); + compatTextStyle(calendarOpt, 'dayLabel'); + compatTextStyle(calendarOpt, 'monthLabel'); + compatTextStyle(calendarOpt, 'yearLabel'); + }); + + // radar.name.textStyle + each$5(toArr(option.radar), function (radarOpt) { + compatTextStyle(radarOpt, 'name'); + }); + + each$5(toArr(option.geo), function (geoOpt) { + if (isObject$3(geoOpt)) { + compatEC3CommonStyles(geoOpt); + each$5(toArr(geoOpt.regions), function (regionObj) { + compatEC3CommonStyles(regionObj); + }); + } + }); + + each$5(toArr(option.timeline), function (timelineOpt) { + compatEC3CommonStyles(timelineOpt); + convertNormalEmphasis(timelineOpt, 'label'); + convertNormalEmphasis(timelineOpt, 'itemStyle'); + convertNormalEmphasis(timelineOpt, 'controlStyle', true); + + var data = timelineOpt.data; + isArray(data) && each$1(data, function (item) { + if (isObject$1(item)) { + convertNormalEmphasis(item, 'label'); + convertNormalEmphasis(item, 'itemStyle'); + } + }); + }); + + each$5(toArr(option.toolbox), function (toolboxOpt) { + convertNormalEmphasis(toolboxOpt, 'iconStyle'); + each$5(toolboxOpt.feature, function (featureOpt) { + convertNormalEmphasis(featureOpt, 'iconStyle'); + }); + }); + + compatTextStyle(toObj(option.axisPointer), 'label'); + compatTextStyle(toObj(option.tooltip).axisPointer, 'label'); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Compatitable with 2.0 + +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$1(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$1(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 backwardCompat = function (option, isTheme) { + compatStyle(option, isTheme); + + // Make sure series array for model initialization. + option.series = normalizeToArray(option.series); + + each$1(option.series, function (seriesOpt) { + if (!isObject$1(seriesOpt)) { + return; + } + + var seriesType = seriesOpt.type; + + 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$1(seriesOpt, 'itemStyle.normal.color', pointerColor); + } + + compatLayoutProperties(seriesOpt); + }); + + // dataRange has changed to visualMap + if (option.dataRange) { + option.visualMap = option.dataRange; + } + + each$1(COMPATITABLE_COMPONENTS, function (componentName) { + var options = option[componentName]; + if (options) { + if (!isArray(options)) { + options = [options]; + } + each$1(options, function (option) { + compatLayoutProperties(option); + }); + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// (1) [Caution]: the logic is correct based on the premises: +// data processing stage is blocked in stream. +// See +// (2) Only register once when import repeatly. +// Should be executed before after series filtered and before stack calculation. +var dataStack = function (ecModel) { + var stackInfoMap = createHashMap(); + ecModel.eachSeries(function (seriesModel) { + var stack = seriesModel.get('stack'); + // Compatibal: when `stack` is set as '', do not stack. + if (stack) { + var stackInfoList = stackInfoMap.get(stack) || stackInfoMap.set(stack, []); + var data = seriesModel.getData(); + + var stackInfo = { + // Used for calculate axis extent automatically. + stackResultDimension: data.getCalculationInfo('stackResultDimension'), + stackedOverDimension: data.getCalculationInfo('stackedOverDimension'), + stackedDimension: data.getCalculationInfo('stackedDimension'), + stackedByDimension: data.getCalculationInfo('stackedByDimension'), + isStackedByIndex: data.getCalculationInfo('isStackedByIndex'), + data: data, + seriesModel: seriesModel + }; + + // If stacked on axis that do not support data stack. + if (!stackInfo.stackedDimension + || !(stackInfo.isStackedByIndex || stackInfo.stackedByDimension) + ) { + return; + } + + stackInfoList.length && data.setCalculationInfo( + 'stackedOnSeries', stackInfoList[stackInfoList.length - 1].seriesModel + ); + + stackInfoList.push(stackInfo); + } + }); + + stackInfoMap.each(calculateStack); +}; + +function calculateStack(stackInfoList) { + each$1(stackInfoList, function (targetStackInfo, idxInStack) { + var resultVal = []; + var resultNaN = [NaN, NaN]; + var dims = [targetStackInfo.stackResultDimension, targetStackInfo.stackedOverDimension]; + var targetData = targetStackInfo.data; + var isStackedByIndex = targetStackInfo.isStackedByIndex; + + // Should not write on raw data, because stack series model list changes + // depending on legend selection. + var newData = targetData.map(dims, function (v0, v1, dataIndex) { + var sum = targetData.get(targetStackInfo.stackedDimension, dataIndex); + + // Consider `connectNulls` of line area, if value is NaN, stackedOver + // should also be NaN, to draw a appropriate belt area. + if (isNaN(sum)) { + return resultNaN; + } + + var byValue; + var stackedDataRawIndex; + + if (isStackedByIndex) { + stackedDataRawIndex = targetData.getRawIndex(dataIndex); + } + else { + byValue = targetData.get(targetStackInfo.stackedByDimension, dataIndex); + } + + // If stackOver is NaN, chart view will render point on value start. + var stackedOver = NaN; + + for (var j = idxInStack - 1; j >= 0; j--) { + var stackInfo = stackInfoList[j]; + + // Has been optimized by inverted indices on `stackedByDimension`. + if (!isStackedByIndex) { + stackedDataRawIndex = stackInfo.data.rawIndexOf(stackInfo.stackedByDimension, byValue); + } + + if (stackedDataRawIndex >= 0) { + var val = stackInfo.data.getByRawIndex(stackInfo.stackResultDimension, stackedDataRawIndex); + + // Considering positive stack, negative stack and empty data + if ((sum >= 0 && val > 0) // Positive stack + || (sum <= 0 && val < 0) // Negative stack + ) { + sum += val; + stackedOver = val; + break; + } + } + } + + resultVal[0] = sum; + resultVal[1] = stackedOver; + + return resultVal; + }); + + targetData.hostModel.setData(newData); + // Update for consequent calculation + targetStackInfo.data = newData; + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// TODO +// ??? refactor? check the outer usage of data provider. +// merge with defaultDimValueGetter? + +/** + * If normal array used, mutable chunk size is supported. + * If typed array used, chunk size must be fixed. + */ +function DefaultDataProvider(source, dimSize) { + if (!Source.isInstance(source)) { + source = Source.seriesDataToSource(source); + } + this._source = source; + + var data = this._data = source.data; + var sourceFormat = source.sourceFormat; + + // Typed array. TODO IE10+? + if (sourceFormat === SOURCE_FORMAT_TYPED_ARRAY) { + if (__DEV__) { + if (dimSize == null) { + throw new Error('Typed array data must specify dimension size'); + } + } + this._offset = 0; + this._dimSize = dimSize; + this._data = data; + } + + var methods = providerMethods[ + sourceFormat === SOURCE_FORMAT_ARRAY_ROWS + ? sourceFormat + '_' + source.seriesLayoutBy + : sourceFormat + ]; + + if (__DEV__) { + assert$1(methods, 'Invalide sourceFormat: ' + sourceFormat); + } + + extend(this, methods); +} + +var providerProto = DefaultDataProvider.prototype; +// If data is pure without style configuration +providerProto.pure = false; +// If data is persistent and will not be released after use. +providerProto.persistent = true; + +// ???! FIXME legacy data provider do not has method getSource +providerProto.getSource = function () { + return this._source; +}; + +var providerMethods = { + + 'arrayRows_column': { + pure: true, + count: function () { + return Math.max(0, this._data.length - this._source.startIndex); + }, + getItem: function (idx) { + return this._data[idx + this._source.startIndex]; + }, + appendData: appendDataSimply + }, + + 'arrayRows_row': { + pure: true, + count: function () { + var row = this._data[0]; + return row ? Math.max(0, row.length - this._source.startIndex) : 0; + }, + getItem: function (idx) { + idx += this._source.startIndex; + var item = []; + var data = this._data; + for (var i = 0; i < data.length; i++) { + var row = data[i]; + item.push(row ? row[idx] : null); + } + return item; + }, + appendData: function () { + throw new Error('Do not support appendData when set seriesLayoutBy: "row".'); + } + }, + + 'objectRows': { + pure: true, + count: countSimply, + getItem: getItemSimply, + appendData: appendDataSimply + }, + + 'keyedColumns': { + pure: true, + count: function () { + var dimName = this._source.dimensionsDefine[0].name; + var col = this._data[dimName]; + return col ? col.length : 0; + }, + getItem: function (idx) { + var item = []; + var dims = this._source.dimensionsDefine; + for (var i = 0; i < dims.length; i++) { + var col = this._data[dims[i].name]; + item.push(col ? col[idx] : null); + } + return item; + }, + appendData: function (newData) { + var data = this._data; + each$1(newData, function (newCol, key) { + var oldCol = data[key] || (data[key] = []); + for (var i = 0; i < (newCol || []).length; i++) { + oldCol.push(newCol[i]); + } + }); + } + }, + + 'original': { + count: countSimply, + getItem: getItemSimply, + appendData: appendDataSimply + }, + + 'typedArray': { + persistent: false, + pure: true, + count: function () { + return this._data ? (this._data.length / this._dimSize) : 0; + }, + getItem: function (idx, out) { + idx = idx - this._offset; + out = out || []; + var offset = this._dimSize * idx; + for (var i = 0; i < this._dimSize; i++) { + out[i] = this._data[offset + i]; + } + return out; + }, + appendData: function (newData) { + if (__DEV__) { + assert$1( + isTypedArray(newData), + 'Added data must be TypedArray if data in initialization is TypedArray' + ); + } + + this._data = newData; + }, + + // Clean self if data is already used. + clean: function () { + // PENDING + this._offset += this.count(); + this._data = null; + } + } +}; + +function countSimply() { + return this._data.length; +} +function getItemSimply(idx) { + return this._data[idx]; +} +function appendDataSimply(newData) { + for (var i = 0; i < newData.length; i++) { + this._data.push(newData[i]); + } +} + + + +var rawValueGetters = { + + arrayRows: getRawValueSimply, + + objectRows: function (dataItem, dataIndex, dimIndex, dimName) { + return dimIndex != null ? dataItem[dimName] : dataItem; + }, + + keyedColumns: getRawValueSimply, + + original: function (dataItem, dataIndex, dimIndex, dimName) { + // FIXME + // In some case (markpoint in geo (geo-map.html)), dataItem + // is {coord: [...]} + var value = getDataItemValue(dataItem); + return (dimIndex == null || !(value instanceof Array)) + ? value + : value[dimIndex]; + }, + + typedArray: getRawValueSimply +}; + +function getRawValueSimply(dataItem, dataIndex, dimIndex, dimName) { + return dimIndex != null ? dataItem[dimIndex] : dataItem; +} + + +var defaultDimValueGetters = { + + arrayRows: getDimValueSimply, + + objectRows: function (dataItem, dimName, dataIndex, dimIndex) { + return converDataValue(dataItem[dimName], this._dimensionInfos[dimName]); + }, + + keyedColumns: getDimValueSimply, + + original: function (dataItem, dimName, dataIndex, dimIndex) { + // Performance sensitive, do not use modelUtil.getDataItemValue. + // If dataItem is an plain object with no value field, the var `value` + // will be assigned with the object, but it will be tread correctly + // in the `convertDataValue`. + var value = dataItem && (dataItem.value == null ? dataItem : dataItem.value); + + // If any dataItem is like { value: 10 } + if (!this._rawData.pure && isDataItemOption(dataItem)) { + this.hasItemOption = true; + } + return converDataValue( + (value instanceof Array) + ? value[dimIndex] + // If value is a single number or something else not array. + : value, + this._dimensionInfos[dimName] + ); + }, + + typedArray: function (dataItem, dimName, dataIndex, dimIndex) { + return dataItem[dimIndex]; + } + +}; + +function getDimValueSimply(dataItem, dimName, dataIndex, dimIndex) { + return converDataValue(dataItem[dimIndex], this._dimensionInfos[dimName]); +} + +/** + * This helper method convert value in data. + * @param {string|number|Date} value + * @param {Object|string} [dimInfo] If string (like 'x'), dimType defaults 'number'. + * If "dimInfo.ordinalParseAndSave", ordinal value can be parsed. + */ +function converDataValue(value, dimInfo) { + // Performance sensitive. + var dimType = dimInfo && dimInfo.type; + if (dimType === 'ordinal') { + // If given value is a category string + var ordinalMeta = dimInfo && dimInfo.ordinalMeta; + return ordinalMeta + ? ordinalMeta.parseAndCollect(value) + : value; + } + + if (dimType === 'time' + // spead up when using timestamp + && typeof value !== 'number' + && value != null + && value !== '-' + ) { + value = +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 + // If string (like '-'), using '+' parse to NaN + // If object, also parse to NaN + : +value; +} + +// ??? FIXME can these logic be more neat: getRawValue, getRawDataItem, +// Consider persistent. +// Caution: why use raw value to display on label or tooltip? +// A reason is to avoid format. For example time value we do not know +// how to format is expected. More over, if stack is used, calculated +// value may be 0.91000000001, which have brings trouble to display. +// TODO: consider how to treat null/undefined/NaN when display? +/** + * @param {module:echarts/data/List} data + * @param {number} dataIndex + * @param {string|number} [dim] dimName or dimIndex + * @return {Array.|string|number} can be null/undefined. + */ +function retrieveRawValue(data, dataIndex, dim) { + if (!data) { + return; + } + + // Consider data may be not persistent. + var dataItem = data.getRawDataItem(dataIndex); + + if (dataItem == null) { + return; + } + + var sourceFormat = data.getProvider().getSource().sourceFormat; + var dimName; + var dimIndex; + + var dimInfo = data.getDimensionInfo(dim); + if (dimInfo) { + dimName = dimInfo.name; + dimIndex = dimInfo.index; + } + + return rawValueGetters[sourceFormat](dataItem, dataIndex, dimIndex, dimName); +} + +/** + * Compatible with some cases (in pie, map) like: + * data: [{name: 'xx', value: 5, selected: true}, ...] + * where only sourceFormat is 'original' and 'objectRows' supported. + * + * ??? TODO + * Supported detail options in data item when using 'arrayRows'. + * + * @param {module:echarts/data/List} data + * @param {number} dataIndex + * @param {string} attr like 'selected' + */ +function retrieveRawAttr(data, dataIndex, attr) { + if (!data) { + return; + } + + var sourceFormat = data.getProvider().getSource().sourceFormat; + + if (sourceFormat !== SOURCE_FORMAT_ORIGINAL + && sourceFormat !== SOURCE_FORMAT_OBJECT_ROWS + ) { + return; + } + + var dataItem = data.getRawDataItem(dataIndex); + if (sourceFormat === SOURCE_FORMAT_ORIGINAL && !isObject$1(dataItem)) { + dataItem = null; + } + if (dataItem) { + return dataItem[attr]; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 DIMENSION_LABEL_REG = /\{@(.+?)\}/g; + +// PENDING A little ugly +var dataFormatMixin = { + /** + * Get params for formatter + * @param {number} dataIndex + * @param {string} [dataType] + * @return {Object} + */ + getDataParams: function (dataIndex, dataType) { + var data = this.getData(dataType); + var rawValue = this.getRawValue(dataIndex, dataType); + var rawDataIndex = data.getRawIndex(dataIndex); + var name = data.getName(dataIndex); + var itemOpt = data.getRawDataItem(dataIndex); + var color = data.getItemVisual(dataIndex, 'color'); + var tooltipModel = this.ecModel.getComponent('tooltip'); + var renderMode = tooltipModel && tooltipModel.get('renderMode') || 'html'; + + return { + componentType: this.mainType, + componentSubType: this.subType, + seriesType: this.mainType === 'series' ? this.subType : null, + seriesIndex: this.seriesIndex, + seriesId: this.id, + seriesName: this.name, + name: name, + dataIndex: rawDataIndex, + data: itemOpt, + dataType: dataType, + value: rawValue, + color: color, + marker: getTooltipMarker({ + color: color, + renderMode: renderMode + }), + + // 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 {string} [dataType] + * @param {number} [dimIndex] + * @param {string} [labelProp='label'] + * @return {string} If not formatter, return null/undefined + */ + getFormattedLabel: function (dataIndex, status, dataType, dimIndex, labelProp) { + status = status || 'normal'; + var data = this.getData(dataType); + var itemModel = data.getItemModel(dataIndex); + + var params = this.getDataParams(dataIndex, dataType); + if (dimIndex != null && (params.value instanceof Array)) { + params.value = params.value[dimIndex]; + } + + var formatter = itemModel.get( + status === 'normal' + ? [labelProp || 'label', 'formatter'] + : [status, labelProp || 'label', 'formatter'] + ); + + if (typeof formatter === 'function') { + params.status = status; + return formatter(params); + } + else if (typeof formatter === 'string') { + var str = formatTpl(formatter, params); + + // Support 'aaa{@[3]}bbb{@product}ccc'. + // Do not support '}' in dim name util have to. + return str.replace(DIMENSION_LABEL_REG, function (origin, dim) { + var len = dim.length; + if (dim.charAt(0) === '[' && dim.charAt(len - 1) === ']') { + dim = +dim.slice(1, len - 1); // Also: '[]' => 0 + } + return retrieveRawValue(data, dataIndex, dim); + }); + } + }, + + /** + * Get raw value in option + * @param {number} idx + * @param {string} [dataType] + * @return {Array|number|string} + */ + getRawValue: function (idx, dataType) { + return retrieveRawValue(this.getData(dataType), idx); + }, + + /** + * Should be implemented. + * @param {number} dataIndex + * @param {boolean} [multipleSeries=false] + * @param {number} [dataType] + * @return {string} tooltip string + */ + formatTooltip: function () { + // Empty function + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @param {Object} define + * @return See the return of `createTask`. + */ +function createTask(define) { + return new Task(define); +} + +/** + * @constructor + * @param {Object} define + * @param {Function} define.reset Custom reset + * @param {Function} [define.plan] Returns 'reset' indicate reset immediately. + * @param {Function} [define.count] count is used to determin data task. + * @param {Function} [define.onDirty] count is used to determin data task. + */ +function Task(define) { + define = define || {}; + + this._reset = define.reset; + this._plan = define.plan; + this._count = define.count; + this._onDirty = define.onDirty; + + this._dirty = true; + + // Context must be specified implicitly, to + // avoid miss update context when model changed. + this.context; +} + +var taskProto = Task.prototype; + +/** + * @param {Object} performArgs + * @param {number} [performArgs.step] Specified step. + * @param {number} [performArgs.skip] Skip customer perform call. + * @param {number} [performArgs.modBy] Sampling window size. + * @param {number} [performArgs.modDataCount] Sampling count. + */ +taskProto.perform = function (performArgs) { + var upTask = this._upstream; + var skip = performArgs && performArgs.skip; + + // TODO some refactor. + // Pull data. Must pull data each time, because context.data + // may be updated by Series.setData. + if (this._dirty && upTask) { + var context = this.context; + context.data = context.outputData = upTask.context.outputData; + } + + if (this.__pipeline) { + this.__pipeline.currentTask = this; + } + + var planResult; + if (this._plan && !skip) { + planResult = this._plan(this.context); + } + + // Support sharding by mod, which changes the render sequence and makes the rendered graphic + // elements uniformed distributed when progress, especially when moving or zooming. + var lastModBy = normalizeModBy(this._modBy); + var lastModDataCount = this._modDataCount || 0; + var modBy = normalizeModBy(performArgs && performArgs.modBy); + var modDataCount = performArgs && performArgs.modDataCount || 0; + if (lastModBy !== modBy || lastModDataCount !== modDataCount) { + planResult = 'reset'; + } + + function normalizeModBy(val) { + !(val >= 1) && (val = 1); // jshint ignore:line + return val; + } + + var forceFirstProgress; + if (this._dirty || planResult === 'reset') { + this._dirty = false; + forceFirstProgress = reset(this, skip); + } + + this._modBy = modBy; + this._modDataCount = modDataCount; + + var step = performArgs && performArgs.step; + + if (upTask) { + + if (__DEV__) { + assert$1(upTask._outputDueEnd != null); + } + this._dueEnd = upTask._outputDueEnd; + } + // DataTask or overallTask + else { + if (__DEV__) { + assert$1(!this._progress || this._count); + } + this._dueEnd = this._count ? this._count(this.context) : Infinity; + } + + // Note: Stubs, that its host overall task let it has progress, has progress. + // If no progress, pass index from upstream to downstream each time plan called. + if (this._progress) { + var start = this._dueIndex; + var end = Math.min( + step != null ? this._dueIndex + step : Infinity, + this._dueEnd + ); + + if (!skip && (forceFirstProgress || start < end)) { + var progress = this._progress; + if (isArray(progress)) { + for (var i = 0; i < progress.length; i++) { + doProgress(this, progress[i], start, end, modBy, modDataCount); + } + } + else { + doProgress(this, progress, start, end, modBy, modDataCount); + } + } + + this._dueIndex = end; + // If no `outputDueEnd`, assume that output data and + // input data is the same, so use `dueIndex` as `outputDueEnd`. + var outputDueEnd = this._settedOutputEnd != null + ? this._settedOutputEnd : end; + + if (__DEV__) { + // ??? Can not rollback. + assert$1(outputDueEnd >= this._outputDueEnd); + } + + this._outputDueEnd = outputDueEnd; + } + else { + // (1) Some overall task has no progress. + // (2) Stubs, that its host overall task do not let it has progress, has no progress. + // This should always be performed so it can be passed to downstream. + this._dueIndex = this._outputDueEnd = this._settedOutputEnd != null + ? this._settedOutputEnd : this._dueEnd; + } + + return this.unfinished(); +}; + +var iterator = (function () { + + var end; + var current; + var modBy; + var modDataCount; + var winCount; + + var it = { + reset: function (s, e, sStep, sCount) { + current = s; + end = e; + + modBy = sStep; + modDataCount = sCount; + winCount = Math.ceil(modDataCount / modBy); + + it.next = (modBy > 1 && modDataCount > 0) ? modNext : sequentialNext; + } + }; + + return it; + + function sequentialNext() { + return current < end ? current++ : null; + } + + function modNext() { + var dataIndex = (current % winCount) * modBy + Math.ceil(current / winCount); + var result = current >= end + ? null + : dataIndex < modDataCount + ? dataIndex + // If modDataCount is smaller than data.count() (consider `appendData` case), + // Use normal linear rendering mode. + : current; + current++; + return result; + } +})(); + +taskProto.dirty = function () { + this._dirty = true; + this._onDirty && this._onDirty(this.context); +}; + +function doProgress(taskIns, progress, start, end, modBy, modDataCount) { + iterator.reset(start, end, modBy, modDataCount); + taskIns._callingProgress = progress; + taskIns._callingProgress({ + start: start, end: end, count: end - start, next: iterator.next + }, taskIns.context); +} + +function reset(taskIns, skip) { + taskIns._dueIndex = taskIns._outputDueEnd = taskIns._dueEnd = 0; + taskIns._settedOutputEnd = null; + + var progress; + var forceFirstProgress; + + if (!skip && taskIns._reset) { + progress = taskIns._reset(taskIns.context); + if (progress && progress.progress) { + forceFirstProgress = progress.forceFirstProgress; + progress = progress.progress; + } + // To simplify no progress checking, array must has item. + if (isArray(progress) && !progress.length) { + progress = null; + } + } + + taskIns._progress = progress; + taskIns._modBy = taskIns._modDataCount = null; + + var downstream = taskIns._downstream; + downstream && downstream.dirty(); + + return forceFirstProgress; +} + +/** + * @return {boolean} + */ +taskProto.unfinished = function () { + return this._progress && this._dueIndex < this._dueEnd; +}; + +/** + * @param {Object} downTask The downstream task. + * @return {Object} The downstream task. + */ +taskProto.pipe = function (downTask) { + if (__DEV__) { + assert$1(downTask && !downTask._disposed && downTask !== this); + } + + // If already downstream, do not dirty downTask. + if (this._downstream !== downTask || this._dirty) { + this._downstream = downTask; + downTask._upstream = this; + downTask.dirty(); + } +}; + +taskProto.dispose = function () { + if (this._disposed) { + return; + } + + this._upstream && (this._upstream._downstream = null); + this._downstream && (this._downstream._upstream = null); + + this._dirty = false; + this._disposed = true; +}; + +taskProto.getUpstream = function () { + return this._upstream; +}; + +taskProto.getDownstream = function () { + return this._downstream; +}; + +taskProto.setOutputEnd = function (end) { + // This only happend in dataTask, dataZoom, map, currently. + // where dataZoom do not set end each time, but only set + // when reset. So we should record the setted end, in case + // that the stub of dataZoom perform again and earse the + // setted end by upstream. + this._outputDueEnd = this._settedOutputEnd = end; +}; + + +/////////////////////////////////////////////////////////// +// For stream debug (Should be commented out after used!) +// Usage: printTask(this, 'begin'); +// Usage: printTask(this, null, {someExtraProp}); +// function printTask(task, prefix, extra) { +// window.ecTaskUID == null && (window.ecTaskUID = 0); +// task.uidDebug == null && (task.uidDebug = `task_${window.ecTaskUID++}`); +// task.agent && task.agent.uidDebug == null && (task.agent.uidDebug = `task_${window.ecTaskUID++}`); +// var props = []; +// if (task.__pipeline) { +// var val = `${task.__idxInPipeline}/${task.__pipeline.tail.__idxInPipeline} ${task.agent ? '(stub)' : ''}`; +// props.push({text: 'idx', value: val}); +// } else { +// var stubCount = 0; +// task.agentStubMap.each(() => stubCount++); +// props.push({text: 'idx', value: `overall (stubs: ${stubCount})`}); +// } +// props.push({text: 'uid', value: task.uidDebug}); +// if (task.__pipeline) { +// props.push({text: 'pid', value: task.__pipeline.id}); +// task.agent && props.push( +// {text: 'stubFor', value: task.agent.uidDebug} +// ); +// } +// props.push( +// {text: 'dirty', value: task._dirty}, +// {text: 'dueIndex', value: task._dueIndex}, +// {text: 'dueEnd', value: task._dueEnd}, +// {text: 'outputDueEnd', value: task._outputDueEnd} +// ); +// if (extra) { +// Object.keys(extra).forEach(key => { +// props.push({text: key, value: extra[key]}); +// }); +// } +// var args = ['color: blue']; +// var msg = `%c[${prefix || 'T'}] %c` + props.map(item => ( +// args.push('color: black', 'color: red'), +// `${item.text}: %c${item.value}` +// )).join('%c, '); +// console.log.apply(console, [msg].concat(args)); +// // console.log(this); +// } + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 inner$4 = makeInner(); + +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, + + /** + * Access path of color for visual + */ + visualColorAccessPath: 'itemStyle.color', + + /** + * 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) { + + /** + * @type {number} + * @readOnly + */ + this.seriesIndex = this.componentIndex; + + this.dataTask = createTask({ + count: dataTaskCount, + reset: dataTaskReset + }); + this.dataTask.context = {model: this}; + + this.mergeDefaultAndTheme(option, ecModel); + + prepareSource(this); + + + var data = this.getInitialData(option, ecModel); + wrapData(data, this); + this.dataTask.context.data = data; + + if (__DEV__) { + assert$1(data, 'getInitialData returned invalid data.'); + } + + /** + * @type {module:echarts/data/List|module:echarts/data/Tree|module:echarts/data/Graph} + * @private + */ + inner$4(this).dataBeforeProcessed = data; + + // If we reverse the order (make data firstly, and then make + // dataBeforeProcessed by cloneShallow), cloneShallow will + // cause data.graph.data !== data when using + // module:echarts/data/Graph or module:echarts/data/Tree. + // See module:echarts/data/helper/linkList + + // Theoretically, it is unreasonable to call `seriesModel.getData()` in the model + // init or merge stage, because the data can be restored. So we do not `restoreData` + // and `setData` here, which forbids calling `seriesModel.getData()` in this stage. + // Call `seriesModel.getRawData()` instead. + // this.restoreData(); + + autoSeriesName(this); + }, + + /** + * Util for merge default and theme to option + * @param {Object} option + * @param {module:echarts/model/Global} ecModel + */ + mergeDefaultAndTheme: function (option, ecModel) { + var layoutMode = this.layoutMode; + var inputPositionParams = layoutMode + ? getLayoutParams(option) : {}; + + // Backward compat: using subType on theme. + // But if name duplicate between series subType + // (for example: parallel) add component mainType, + // add suffix 'Series'. + var themeSubType = this.subType; + if (ComponentModel.hasClass(themeSubType)) { + themeSubType += 'Series'; + } + merge( + option, + ecModel.getTheme().get(this.subType) + ); + merge(option, this.getDefaultOption()); + + // Default label emphasis `show` + defaultEmphasis(option, 'label', ['show']); + + this.fillDataTextStyle(option.data); + + if (layoutMode) { + mergeLayoutParam(option, inputPositionParams, layoutMode); + } + }, + + mergeOption: function (newSeriesOption, ecModel) { + // this.settingTask.dirty(); + + newSeriesOption = merge(this.option, newSeriesOption, true); + this.fillDataTextStyle(newSeriesOption.data); + + var layoutMode = this.layoutMode; + if (layoutMode) { + mergeLayoutParam(this.option, newSeriesOption, layoutMode); + } + + prepareSource(this); + + var data = this.getInitialData(newSeriesOption, ecModel); + wrapData(data, this); + this.dataTask.dirty(); + this.dataTask.context.data = data; + + inner$4(this).dataBeforeProcessed = data; + + autoSeriesName(this); + }, + + fillDataTextStyle: function (data) { + // Default data label emphasis `show` + // FIXME Tree structure data ? + // FIXME Performance ? + if (data && !isTypedArray(data)) { + var props = ['show']; + for (var i = 0; i < data.length; i++) { + if (data[i] && data[i].label) { + defaultEmphasis(data[i], 'label', props); + } + } + } + }, + + /** + * Init a data structure from data related option in series + * Must be overwritten + */ + getInitialData: function () {}, + + /** + * Append data to list + * @param {Object} params + * @param {Array|TypedArray} params.data + */ + appendData: function (params) { + // FIXME ??? + // (1) If data from dataset, forbidden append. + // (2) support append data of dataset. + var data = this.getRawData(); + data.appendData(params.data); + }, + + /** + * Consider some method like `filter`, `map` need make new data, + * We should make sure that `seriesModel.getData()` get correct + * data in the stream procedure. So we fetch data from upstream + * each time `task.perform` called. + * @param {string} [dataType] + * @return {module:echarts/data/List} + */ + getData: function (dataType) { + var task = getCurrentTask(this); + if (task) { + var data = task.context.data; + return dataType == null ? data : data.getLinkedData(dataType); + } + else { + // When series is not alive (that may happen when click toolbox + // restore or setOption with not merge mode), series data may + // be still need to judge animation or something when graphic + // elements want to know whether fade out. + return inner$4(this).data; + } + }, + + /** + * @param {module:echarts/data/List} data + */ + setData: function (data) { + var task = getCurrentTask(this); + if (task) { + var context = task.context; + // Consider case: filter, data sample. + if (context.data !== data && task.modifyOutputEnd) { + task.setOutputEnd(data.count()); + } + context.outputData = data; + // Caution: setData should update context.data, + // Because getData may be called multiply in a + // single stage and expect to get the data just + // set. (For example, AxisProxy, x y both call + // getData and setDate sequentially). + // So the context.data should be fetched from + // upstream each time when a stage starts to be + // performed. + if (task !== this.dataTask) { + context.data = data; + } + } + inner$4(this).data = data; + }, + + /** + * @see {module:echarts/data/helper/sourceHelper#getSource} + * @return {module:echarts/data/Source} source + */ + getSource: function () { + return getSource(this); + }, + + /** + * Get data before processed + * @return {module:echarts/data/List} + */ + getRawData: function () { + return inner$4(this).dataBeforeProcessed; + }, + + /** + * 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] + * @param {number} [dataType] + * @param {string} [renderMode='html'] valid values: 'html' and 'richText'. + * 'html' is used for rendering tooltip in extra DOM form, and the result + * string is used as DOM HTML content. + * 'richText' is used for rendering tooltip in rich text form, for those where + * DOM operation is not supported. + * @return {Object} formatted tooltip with `html` and `markers` + */ + formatTooltip: function (dataIndex, multipleSeries, dataType, renderMode) { + + var series = this; + renderMode = renderMode || 'html'; + var newLine = renderMode === 'html' ? '
' : '\n'; + var isRichText = renderMode === 'richText'; + var markers = {}; + var markerId = 0; + + function formatArrayValue(value) { + // ??? TODO refactor these logic. + // check: category-no-encode-has-axis-data in dataset.html + var vertially = reduce(value, function (vertially, val, idx) { + var dimItem = data.getDimensionInfo(idx); + return vertially |= dimItem && dimItem.tooltip !== false && dimItem.displayName != null; + }, 0); + + var result = []; + + tooltipDims.length + ? each$1(tooltipDims, function (dim) { + setEachItem(retrieveRawValue(data, dataIndex, dim), dim); + }) + // By default, all dims is used on tooltip. + : each$1(value, setEachItem); + + function setEachItem(val, dim) { + var dimInfo = data.getDimensionInfo(dim); + // If `dimInfo.tooltip` is not set, show tooltip. + if (!dimInfo || dimInfo.otherDims.tooltip === false) { + return; + } + var dimType = dimInfo.type; + var markName = series.seriesIndex + 'at' + markerId; + var dimHead = getTooltipMarker({ + color: color, + type: 'subItem', + renderMode: renderMode, + markerId: markName + }); + + var dimHeadStr = typeof dimHead === 'string' ? dimHead : dimHead.content; + var valStr = (vertially + ? dimHeadStr + encodeHTML(dimInfo.displayName || '-') + ': ' + : '' + ) + // FIXME should not format time for raw data? + + encodeHTML(dimType === 'ordinal' + ? val + '' + : dimType === 'time' + ? (multipleSeries ? '' : formatTime('yyyy/MM/dd hh:mm:ss', val)) + : addCommas(val) + ); + valStr && result.push(valStr); + + if (isRichText) { + markers[markName] = color; + ++markerId; + } + } + + return { + renderMode: renderMode, + content: (vertially ? isRichText : '') + result.join(vertially ? isRichText : ', '), + style: markers + }; + } + + function formatSingleValue(val) { + return encodeHTML(addCommas(val)); + } + + var data = this.getData(); + var tooltipDims = data.mapDimension('defaultedTooltip', true); + var tooltipDimLen = tooltipDims.length; + var value = this.getRawValue(dataIndex); + var isValueArr = isArray(value); + + var color = data.getItemVisual(dataIndex, 'color'); + if (isObject$1(color) && color.colorStops) { + color = (color.colorStops[0] || {}).color; + } + color = color || 'transparent'; + + // Complicated rule for pretty tooltip. + var formattedValue = (tooltipDimLen > 1 || (isValueArr && !tooltipDimLen)) + ? formatArrayValue(value) + : tooltipDimLen + ? formatSingleValue(retrieveRawValue(data, dataIndex, tooltipDims[0])) + : formatSingleValue(isValueArr ? value[0] : value); + + var markName = series.seriesIndex + 'at' + markerId; + var colorEl = getTooltipMarker({ + color: color, + type: 'item', + renderMode: renderMode, + markerId: markName + }); + markers[markName] = color; + ++markerId; + + var name = data.getName(dataIndex); + + var seriesName = this.name; + if (!isNameSpecified(this)) { + seriesName = ''; + } + seriesName = seriesName + ? encodeHTML(seriesName) + (!multipleSeries ? newLine : ': ') + : ''; + + var colorStr = typeof colorEl === 'string' ? colorEl : colorEl.content; + var html = !multipleSeries + ? seriesName + colorStr + + (name + ? encodeHTML(name) + ': ' + formattedValue + : formattedValue + ) + : colorStr + seriesName + formattedValue; + + return { + html: html, + markers: markers + }; + }, + + /** + * @return {boolean} + */ + isAnimationEnabled: function () { + if (env$1.node) { + return false; + } + + var animationEnabled = this.getShallow('animation'); + if (animationEnabled) { + if (this.getData().count() > this.getShallow('animationThreshold')) { + animationEnabled = false; + } + } + return animationEnabled; + }, + + restoreData: function () { + this.dataTask.dirty(); + }, + + getColorFromPalette: function (name, scope, requestColorNum) { + var ecModel = this.ecModel; + // PENDING + var color = colorPaletteMixin.getColorFromPalette.call(this, name, scope, requestColorNum); + if (!color) { + color = ecModel.getColorFromPalette(name, scope, requestColorNum); + } + return color; + }, + + /** + * Use `data.mapDimension(coordDim, true)` instead. + * @deprecated + */ + coordDimToDataDim: function (coordDim) { + return this.getRawData().mapDimension(coordDim, true); + }, + + /** + * Get progressive rendering count each step + * @return {number} + */ + getProgressive: function () { + return this.get('progressive'); + }, + + /** + * Get progressive rendering count each step + * @return {number} + */ + getProgressiveThreshold: function () { + return this.get('progressiveThreshold'); + }, + + /** + * Get data indices for show tooltip content. See tooltip. + * @abstract + * @param {Array.|string} dim + * @param {Array.} value + * @param {module:echarts/coord/single/SingleAxis} baseAxis + * @return {Object} {dataIndices, nestestValue}. + */ + getAxisTooltipData: null, + + /** + * See tooltip. + * @abstract + * @param {number} dataIndex + * @return {Array.} Point of tooltip. null/undefined can be returned. + */ + getTooltipPosition: null, + + /** + * @see {module:echarts/stream/Scheduler} + */ + pipeTask: null, + + /** + * Convinient for override in extended class. + * @protected + * @type {Function} + */ + preventIncremental: null, + + /** + * @public + * @readOnly + * @type {Object} + */ + pipelineContext: null + +}); + + +mixin(SeriesModel, dataFormatMixin); +mixin(SeriesModel, colorPaletteMixin); + +/** + * MUST be called after `prepareSource` called + * Here we need to make auto series, especially for auto legend. But we + * do not modify series.name in option to avoid side effects. + */ +function autoSeriesName(seriesModel) { + // User specified name has higher priority, otherwise it may cause + // series can not be queried unexpectedly. + var name = seriesModel.name; + if (!isNameSpecified(seriesModel)) { + seriesModel.name = getSeriesAutoName(seriesModel) || name; + } +} + +function getSeriesAutoName(seriesModel) { + var data = seriesModel.getRawData(); + var dataDims = data.mapDimension('seriesName', true); + var nameArr = []; + each$1(dataDims, function (dataDim) { + var dimInfo = data.getDimensionInfo(dataDim); + dimInfo.displayName && nameArr.push(dimInfo.displayName); + }); + return nameArr.join(' '); +} + +function dataTaskCount(context) { + return context.model.getRawData().count(); +} + +function dataTaskReset(context) { + var seriesModel = context.model; + seriesModel.setData(seriesModel.getRawData().cloneShallow()); + return dataTaskProgress; +} + +function dataTaskProgress(param, context) { + // Avoid repead cloneShallow when data just created in reset. + if (param.end > context.outputData.count()) { + context.model.getRawData().cloneShallow(context.outputData); + } +} + +// TODO refactor +function wrapData(data, seriesModel) { + each$1(data.CHANGABLE_METHODS, function (methodName) { + data.wrapMethod(methodName, curry(onDataSelfChange, seriesModel)); + }); +} + +function onDataSelfChange(seriesModel) { + var task = getCurrentTask(seriesModel); + if (task) { + // Consider case: filter, selectRange + task.setOutputEnd(this.count()); + } +} + +function getCurrentTask(seriesModel) { + var scheduler = (seriesModel.ecModel || {}).scheduler; + var pipeline = scheduler && scheduler.getPipeline(seriesModel.uid); + + if (pipeline) { + // When pipline finished, the currrentTask keep the last + // task (renderTask). + var task = pipeline.currentTask; + if (task) { + var agentStubMap = task.agentStubMap; + if (agentStubMap) { + task = agentStubMap.get(seriesModel.uid); + } + } + return task; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 Component = function () { + /** + * @type {module:zrender/container/Group} + * @readOnly + */ + this.group = new Group(); + + /** + * @type {string} + * @readOnly + */ + this.uid = getUID('viewComponent'); +}; + +Component.prototype = { + + constructor: Component, + + init: function (ecModel, api) {}, + + render: function (componentModel, ecModel, api, payload) {}, + + dispose: function () {}, + + /** + * @param {string} eventType + * @param {Object} query + * @param {module:zrender/Element} targetEl + * @param {Object} packedEvent + * @return {boolen} Pass only when return `true`. + */ + filterForExposedEvent: null + +}; + +var componentProto = Component.prototype; +componentProto.updateView + = componentProto.updateLayout + = componentProto.updateVisual + = function (seriesModel, ecModel, api, payload) { + // Do nothing; + }; +// Enable Component.extend. +enableClassExtend(Component); + +// Enable capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on. +enableClassManagement(Component, {registerWhenExtend: true}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @return {string} If large mode changed, return string 'reset'; + */ +var createRenderPlanner = function () { + var inner = makeInner(); + + return function (seriesModel) { + var fields = inner(seriesModel); + var pipelineContext = seriesModel.pipelineContext; + + var originalLarge = fields.large; + var originalProgressive = fields.progressiveRender; + + var large = fields.large = pipelineContext.large; + var progressive = fields.progressiveRender = pipelineContext.progressiveRender; + + return !!((originalLarge ^ large) || (originalProgressive ^ progressive)) && 'reset'; + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 inner$5 = makeInner(); +var renderPlanner = createRenderPlanner(); + +function Chart() { + + /** + * @type {module:zrender/container/Group} + * @readOnly + */ + this.group = new Group(); + + /** + * @type {string} + * @readOnly + */ + this.uid = getUID('viewChart'); + + this.renderTask = createTask({ + plan: renderTaskPlan, + reset: renderTaskReset + }); + this.renderTask.context = {view: this}; +} + +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 () {}, + + /** + * Rendering preparation in progressive mode. + * @param {module:echarts/model/Series} seriesModel + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + * @param {Object} payload + */ + incrementalPrepareRender: null, + + /** + * Render in progressive mode. + * @param {Object} params See taskParams in `stream/task.js` + * @param {module:echarts/model/Series} seriesModel + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + * @param {Object} payload + */ + incrementalRender: null, + + /** + * Update transform directly. + * @param {module:echarts/model/Series} seriesModel + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + * @param {Object} payload + * @return {Object} {update: true} + */ + updateTransform: null, + + /** + * The view contains the given point. + * @interface + * @param {Array.} point + * @return {boolean} + */ + // containPoint: function () {} + + /** + * @param {string} eventType + * @param {Object} query + * @param {module:zrender/Element} targetEl + * @param {Object} packedEvent + * @return {boolen} Pass only when return `true`. + */ + filterForExposedEvent: null + +}; + +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' + */ +function toggleHighlight(data, payload, state) { + var dataIndex = queryDataIndex(data, payload); + + if (dataIndex != null) { + each$1(normalizeToArray(dataIndex), function (dataIdx) { + elSetState(data.getItemGraphicEl(dataIdx), state); + }); + } + else { + data.eachItemGraphicEl(function (el) { + elSetState(el, state); + }); + } +} + +// Enable Chart.extend. +enableClassExtend(Chart, ['dispose']); + +// Add capability of registerClass, getClass, hasClass, registerSubTypeDefaulter and so on. +enableClassManagement(Chart, {registerWhenExtend: true}); + +Chart.markUpdateMethod = function (payload, methodName) { + inner$5(payload).updateMethod = methodName; +}; + +function renderTaskPlan(context) { + return renderPlanner(context.model); +} + +function renderTaskReset(context) { + var seriesModel = context.model; + var ecModel = context.ecModel; + var api = context.api; + var payload = context.payload; + // ???! remove updateView updateVisual + var progressiveRender = seriesModel.pipelineContext.progressiveRender; + var view = context.view; + + var updateMethod = payload && inner$5(payload).updateMethod; + var methodName = progressiveRender + ? 'incrementalPrepareRender' + : (updateMethod && view[updateMethod]) + ? updateMethod + // `appendData` is also supported when data amount + // is less than progressive threshold. + : 'render'; + + if (methodName !== 'render') { + view[methodName](seriesModel, ecModel, api, payload); + } + + return progressMethodMap[methodName]; +} + +var progressMethodMap = { + incrementalPrepareRender: { + progress: function (params, context) { + context.view.incrementalRender( + params, context.model, context.ecModel, context.api, context.payload + ); + } + }, + render: { + // Put view.render in `progress` to support appendData. But in this case + // view.render should not be called in reset, otherwise it will be called + // twise. Use `forceFirstProgress` to make sure that view.render is called + // in any cases. + forceFirstProgress: true, + progress: function (params, context) { + context.view.render( + context.model, context.ecModel, context.api, context.payload + ); + } + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 ORIGIN_METHOD = '\0__throttleOriginMethod'; +var RATE = '\0__throttleRate'; +var THROTTLE_TYPE = '\0__throttleType'; + +/** + * @public + * @param {(Function)} fn + * @param {number} [delay=0] Unit: ms. + * @param {boolean} [debounce=false] + * true: If call interval less than `delay`, only the last call works. + * false: If call interval less than `delay, call works on fixed rate. + * @return {(Function)} throttled fn. + */ +function throttle(fn, delay, debounce) { + + var currCall; + var lastCall = 0; + var lastExec = 0; + var timer = null; + var diff; + var scope; + var args; + var debounceNextCall; + + delay = delay || 0; + + function exec() { + lastExec = (new Date()).getTime(); + timer = null; + fn.apply(scope, args || []); + } + + var cb = function () { + currCall = (new Date()).getTime(); + scope = this; + args = arguments; + var thisDelay = debounceNextCall || delay; + var thisDebounce = debounceNextCall || debounce; + debounceNextCall = null; + diff = currCall - (thisDebounce ? lastCall : lastExec) - thisDelay; + + clearTimeout(timer); + + // Here we should make sure that: the `exec` SHOULD NOT be called later + // than a new call of `cb`, that is, preserving the command order. Consider + // calculating "scale rate" when roaming as an example. When a call of `cb` + // happens, either the `exec` is called dierectly, or the call is delayed. + // But the delayed call should never be later than next call of `cb`. Under + // this assurance, we can simply update view state each time `dispatchAction` + // triggered by user roaming, but not need to add extra code to avoid the + // state being "rolled-back". + if (thisDebounce) { + timer = setTimeout(exec, thisDelay); + } + else { + if (diff >= 0) { + exec(); + } + else { + timer = setTimeout(exec, -diff); + } + } + + lastCall = currCall; + }; + + /** + * Clear throttle. + * @public + */ + cb.clear = function () { + if (timer) { + clearTimeout(timer); + timer = null; + } + }; + + /** + * Enable debounce once. + */ + cb.debounceNextCall = function (debounceDelay) { + debounceNextCall = debounceDelay; + }; + + return cb; +} + +/** + * 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'] 'fixRate' or 'debounce' + * @return {Function} throttled function. + */ +function createOrUpdate(obj, fnAttr, rate, throttleType) { + var fn = obj[fnAttr]; + + if (!fn) { + return; + } + + var originFn = fn[ORIGIN_METHOD] || fn; + var lastThrottleType = fn[THROTTLE_TYPE]; + var lastRate = fn[RATE]; + + if (lastRate !== rate || lastThrottleType !== throttleType) { + if (rate == null || !throttleType) { + return (obj[fnAttr] = originFn); + } + + fn = obj[fnAttr] = throttle( + originFn, rate, throttleType === 'debounce' + ); + fn[ORIGIN_METHOD] = originFn; + fn[THROTTLE_TYPE] = throttleType; + fn[RATE] = rate; + } + + return fn; +} + +/** + * Clear throttle. Example see throttle.createOrUpdate. + * + * @public + * @param {Object} obj + * @param {string} fnAttr + */ +function clear(obj, fnAttr) { + var fn = obj[fnAttr]; + if (fn && fn[ORIGIN_METHOD]) { + obj[fnAttr] = fn[ORIGIN_METHOD]; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 seriesColor = { + createOnAllSeries: true, + performRawSeries: true, + reset: function (seriesModel, ecModel) { + var data = seriesModel.getData(); + var colorAccessPath = (seriesModel.visualColorAccessPath || 'itemStyle.color').split('.'); + var color = seriesModel.get(colorAccessPath) // Set in itemStyle + || seriesModel.getColorFromPalette( + // TODO series count changed. + seriesModel.name, null, ecModel.getSeriesCount() + ); // 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)) + ); + }); + } + + // itemStyle in each data item + var dataEach = function (data, idx) { + var itemModel = data.getItemModel(idx); + var color = itemModel.get(colorAccessPath, true); + if (color != null) { + data.setItemVisual(idx, 'color', color); + } + }; + + return { dataEach: data.hasItemOption ? dataEach : null }; + } + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 lang = { + toolbox: { + brush: { + title: { + rect: '矩形选择', + polygon: '圈选', + lineX: '横向选择', + lineY: '纵向选择', + keep: '保持选择', + clear: '清除选择' + } + }, + dataView: { + title: '数据视图', + lang: ['数据视图', '关闭', '刷新'] + }, + dataZoom: { + title: { + zoom: '区域缩放', + back: '区域缩放还原' + } + }, + magicType: { + title: { + line: '切换为折线图', + bar: '切换为柱状图', + stack: '切换为堆叠', + tiled: '切换为平铺' + } + }, + restore: { + title: '还原' + }, + saveAsImage: { + title: '保存为图片', + lang: ['右键另存为图片'] + } + }, + series: { + typeNames: { + pie: '饼图', + bar: '柱状图', + line: '折线图', + scatter: '散点图', + effectScatter: '涟漪散点图', + radar: '雷达图', + tree: '树图', + treemap: '矩形树图', + boxplot: '箱型图', + candlestick: 'K线图', + k: 'K线图', + heatmap: '热力图', + map: '地图', + parallel: '平行坐标图', + lines: '线图', + graph: '关系图', + sankey: '桑基图', + funnel: '漏斗图', + gauge: '仪表盘图', + pictorialBar: '象形柱图', + themeRiver: '主题河流图', + sunburst: '旭日图' + } + }, + aria: { + general: { + withTitle: '这是一个关于“{title}”的图表。', + withoutTitle: '这是一个图表,' + }, + series: { + single: { + prefix: '', + withName: '图表类型是{seriesType},表示{seriesName}。', + withoutName: '图表类型是{seriesType}。' + }, + multiple: { + prefix: '它由{seriesCount}个图表系列组成。', + withName: '第{seriesId}个系列是一个表示{seriesName}的{seriesType},', + withoutName: '第{seriesId}个系列是一个{seriesType},', + separator: { + middle: ';', + end: '。' + } + } + }, + data: { + allData: '其数据是——', + partialData: '其中,前{displayCnt}项是——', + withName: '{name}的数据是{value}', + withoutName: '{value}', + separator: { + middle: ',', + end: '' + } + } + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 aria = function (dom, ecModel) { + var ariaModel = ecModel.getModel('aria'); + if (!ariaModel.get('show')) { + return; + } + else if (ariaModel.get('description')) { + dom.setAttribute('aria-label', ariaModel.get('description')); + return; + } + + var seriesCnt = 0; + ecModel.eachSeries(function (seriesModel, idx) { + ++seriesCnt; + }, this); + + var maxDataCnt = ariaModel.get('data.maxCount') || 10; + var maxSeriesCnt = ariaModel.get('series.maxCount') || 10; + var displaySeriesCnt = Math.min(seriesCnt, maxSeriesCnt); + + var ariaLabel; + if (seriesCnt < 1) { + // No series, no aria label + return; + } + else { + var title = getTitle(); + if (title) { + ariaLabel = replace(getConfig('general.withTitle'), { + title: title + }); + } + else { + ariaLabel = getConfig('general.withoutTitle'); + } + + var seriesLabels = []; + var prefix = seriesCnt > 1 + ? 'series.multiple.prefix' + : 'series.single.prefix'; + ariaLabel += replace(getConfig(prefix), { seriesCount: seriesCnt }); + + ecModel.eachSeries(function (seriesModel, idx) { + if (idx < displaySeriesCnt) { + var seriesLabel; + + var seriesName = seriesModel.get('name'); + var seriesTpl = 'series.' + + (seriesCnt > 1 ? 'multiple' : 'single') + '.'; + seriesLabel = getConfig(seriesName + ? seriesTpl + 'withName' + : seriesTpl + 'withoutName'); + + seriesLabel = replace(seriesLabel, { + seriesId: seriesModel.seriesIndex, + seriesName: seriesModel.get('name'), + seriesType: getSeriesTypeName(seriesModel.subType) + }); + + var data = seriesModel.getData(); + window.data = data; + if (data.count() > maxDataCnt) { + // Show part of data + seriesLabel += replace(getConfig('data.partialData'), { + displayCnt: maxDataCnt + }); + } + else { + seriesLabel += getConfig('data.allData'); + } + + var dataLabels = []; + for (var i = 0; i < data.count(); i++) { + if (i < maxDataCnt) { + var name = data.getName(i); + var value = retrieveRawValue(data, i); + dataLabels.push( + replace( + name + ? getConfig('data.withName') + : getConfig('data.withoutName'), + { + name: name, + value: value + } + ) + ); + } + } + seriesLabel += dataLabels + .join(getConfig('data.separator.middle')) + + getConfig('data.separator.end'); + + seriesLabels.push(seriesLabel); + } + }); + + ariaLabel += seriesLabels + .join(getConfig('series.multiple.separator.middle')) + + getConfig('series.multiple.separator.end'); + + dom.setAttribute('aria-label', ariaLabel); + } + + function replace(str, keyValues) { + if (typeof str !== 'string') { + return str; + } + + var result = str; + each$1(keyValues, function (value, key) { + result = result.replace( + new RegExp('\\{\\s*' + key + '\\s*\\}', 'g'), + value + ); + }); + return result; + } + + function getConfig(path) { + var userConfig = ariaModel.get(path); + if (userConfig == null) { + var pathArr = path.split('.'); + var result = lang.aria; + for (var i = 0; i < pathArr.length; ++i) { + result = result[pathArr[i]]; + } + return result; + } + else { + return userConfig; + } + } + + function getTitle() { + var title = ecModel.getModel('title').option; + if (title && title.length) { + title = title[0]; + } + return title && title.text; + } + + function getSeriesTypeName(type) { + return lang.series.typeNames[type] || '自定义图'; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 PI$1 = 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} + */ +var loadingDefault = function (api, opts) { + opts = opts || {}; + defaults(opts, { + text: 'loading', + color: '#c23531', + textColor: '#000', + maskColor: 'rgba(255, 255, 255, 0.8)', + zlevel: 0 + }); + var mask = new Rect({ + style: { + fill: opts.maskColor + }, + zlevel: opts.zlevel, + z: 10000 + }); + var arc = new Arc({ + shape: { + startAngle: -PI$1 / 2, + endAngle: -PI$1 / 2 + 0.1, + r: 10 + }, + style: { + stroke: opts.color, + lineCap: 'round', + lineWidth: 5 + }, + zlevel: opts.zlevel, + z: 10001 + }); + var labelRect = new 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$1 * 3 / 2 + }) + .start('circularInOut'); + arc.animateShape(true) + .when(1000, { + startAngle: PI$1 * 3 / 2 + }) + .delay(300) + .start('circularInOut'); + + var group = new 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; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @module echarts/stream/Scheduler + */ + +/** + * @constructor + */ +function Scheduler(ecInstance, api, dataProcessorHandlers, visualHandlers) { + this.ecInstance = ecInstance; + this.api = api; + this.unfinished; + + // Fix current processors in case that in some rear cases that + // processors might be registered after echarts instance created. + // Register processors incrementally for a echarts instance is + // not supported by this stream architecture. + var dataProcessorHandlers = this._dataProcessorHandlers = dataProcessorHandlers.slice(); + var visualHandlers = this._visualHandlers = visualHandlers.slice(); + this._allHandlers = dataProcessorHandlers.concat(visualHandlers); + + /** + * @private + * @type { + * [handlerUID: string]: { + * seriesTaskMap?: { + * [seriesUID: string]: Task + * }, + * overallTask?: Task + * } + * } + */ + this._stageTaskMap = createHashMap(); +} + +var proto = Scheduler.prototype; + +/** + * @param {module:echarts/model/Global} ecModel + * @param {Object} payload + */ +proto.restoreData = function (ecModel, payload) { + // TODO: Only restroe needed series and components, but not all components. + // Currently `restoreData` of all of the series and component will be called. + // But some independent components like `title`, `legend`, `graphic`, `toolbox`, + // `tooltip`, `axisPointer`, etc, do not need series refresh when `setOption`, + // and some components like coordinate system, axes, dataZoom, visualMap only + // need their target series refresh. + // (1) If we are implementing this feature some day, we should consider these cases: + // if a data processor depends on a component (e.g., dataZoomProcessor depends + // on the settings of `dataZoom`), it should be re-performed if the component + // is modified by `setOption`. + // (2) If a processor depends on sevral series, speicified by its `getTargetSeries`, + // it should be re-performed when the result array of `getTargetSeries` changed. + // We use `dependencies` to cover these issues. + // (3) How to update target series when coordinate system related components modified. + + // TODO: simply the dirty mechanism? Check whether only the case here can set tasks dirty, + // and this case all of the tasks will be set as dirty. + + ecModel.restoreData(payload); + + // Theoretically an overall task not only depends on each of its target series, but also + // depends on all of the series. + // The overall task is not in pipeline, and `ecModel.restoreData` only set pipeline tasks + // dirty. If `getTargetSeries` of an overall task returns nothing, we should also ensure + // that the overall task is set as dirty and to be performed, otherwise it probably cause + // state chaos. So we have to set dirty of all of the overall tasks manually, otherwise it + // probably cause state chaos (consider `dataZoomProcessor`). + this._stageTaskMap.each(function (taskRecord) { + var overallTask = taskRecord.overallTask; + overallTask && overallTask.dirty(); + }); +}; + +// If seriesModel provided, incremental threshold is check by series data. +proto.getPerformArgs = function (task, isBlock) { + // For overall task + if (!task.__pipeline) { + return; + } + + var pipeline = this._pipelineMap.get(task.__pipeline.id); + var pCtx = pipeline.context; + var incremental = !isBlock + && pipeline.progressiveEnabled + && (!pCtx || pCtx.progressiveRender) + && task.__idxInPipeline > pipeline.blockIndex; + + var step = incremental ? pipeline.step : null; + var modDataCount = pCtx && pCtx.modDataCount; + var modBy = modDataCount != null ? Math.ceil(modDataCount / step): null; + + return {step: step, modBy: modBy, modDataCount: modDataCount}; +}; + +proto.getPipeline = function (pipelineId) { + return this._pipelineMap.get(pipelineId); +}; + +/** + * Current, progressive rendering starts from visual and layout. + * Always detect render mode in the same stage, avoiding that incorrect + * detection caused by data filtering. + * Caution: + * `updateStreamModes` use `seriesModel.getData()`. + */ +proto.updateStreamModes = function (seriesModel, view) { + var pipeline = this._pipelineMap.get(seriesModel.uid); + var data = seriesModel.getData(); + var dataLen = data.count(); + + // `progressiveRender` means that can render progressively in each + // animation frame. Note that some types of series do not provide + // `view.incrementalPrepareRender` but support `chart.appendData`. We + // use the term `incremental` but not `progressive` to describe the + // case that `chart.appendData`. + var progressiveRender = pipeline.progressiveEnabled + && view.incrementalPrepareRender + && dataLen >= pipeline.threshold; + + var large = seriesModel.get('large') && dataLen >= seriesModel.get('largeThreshold'); + + // TODO: modDataCount should not updated if `appendData`, otherwise cause whole repaint. + // see `test/candlestick-large3.html` + var modDataCount = seriesModel.get('progressiveChunkMode') === 'mod' ? dataLen : null; + + seriesModel.pipelineContext = pipeline.context = { + progressiveRender: progressiveRender, + modDataCount: modDataCount, + large: large + }; +}; + +proto.restorePipelines = function (ecModel) { + var scheduler = this; + var pipelineMap = scheduler._pipelineMap = createHashMap(); + + ecModel.eachSeries(function (seriesModel) { + var progressive = seriesModel.getProgressive(); + var pipelineId = seriesModel.uid; + + pipelineMap.set(pipelineId, { + id: pipelineId, + head: null, + tail: null, + threshold: seriesModel.getProgressiveThreshold(), + progressiveEnabled: progressive + && !(seriesModel.preventIncremental && seriesModel.preventIncremental()), + blockIndex: -1, + step: Math.round(progressive || 700), + count: 0 + }); + + pipe(scheduler, seriesModel, seriesModel.dataTask); + }); +}; + +proto.prepareStageTasks = function () { + var stageTaskMap = this._stageTaskMap; + var ecModel = this.ecInstance.getModel(); + var api = this.api; + + each$1(this._allHandlers, function (handler) { + var record = stageTaskMap.get(handler.uid) || stageTaskMap.set(handler.uid, []); + + handler.reset && createSeriesStageTask(this, handler, record, ecModel, api); + handler.overallReset && createOverallStageTask(this, handler, record, ecModel, api); + }, this); +}; + +proto.prepareView = function (view, model, ecModel, api) { + var renderTask = view.renderTask; + var context = renderTask.context; + + context.model = model; + context.ecModel = ecModel; + context.api = api; + + renderTask.__block = !view.incrementalPrepareRender; + + pipe(this, model, renderTask); +}; + + +proto.performDataProcessorTasks = function (ecModel, payload) { + // If we do not use `block` here, it should be considered when to update modes. + performStageTasks(this, this._dataProcessorHandlers, ecModel, payload, {block: true}); +}; + +// opt +// opt.visualType: 'visual' or 'layout' +// opt.setDirty +proto.performVisualTasks = function (ecModel, payload, opt) { + performStageTasks(this, this._visualHandlers, ecModel, payload, opt); +}; + +function performStageTasks(scheduler, stageHandlers, ecModel, payload, opt) { + opt = opt || {}; + var unfinished; + + each$1(stageHandlers, function (stageHandler, idx) { + if (opt.visualType && opt.visualType !== stageHandler.visualType) { + return; + } + + var stageHandlerRecord = scheduler._stageTaskMap.get(stageHandler.uid); + var seriesTaskMap = stageHandlerRecord.seriesTaskMap; + var overallTask = stageHandlerRecord.overallTask; + + if (overallTask) { + var overallNeedDirty; + var agentStubMap = overallTask.agentStubMap; + agentStubMap.each(function (stub) { + if (needSetDirty(opt, stub)) { + stub.dirty(); + overallNeedDirty = true; + } + }); + overallNeedDirty && overallTask.dirty(); + updatePayload(overallTask, payload); + var performArgs = scheduler.getPerformArgs(overallTask, opt.block); + // Execute stubs firstly, which may set the overall task dirty, + // then execute the overall task. And stub will call seriesModel.setData, + // which ensures that in the overallTask seriesModel.getData() will not + // return incorrect data. + agentStubMap.each(function (stub) { + stub.perform(performArgs); + }); + unfinished |= overallTask.perform(performArgs); + } + else if (seriesTaskMap) { + seriesTaskMap.each(function (task, pipelineId) { + if (needSetDirty(opt, task)) { + task.dirty(); + } + var performArgs = scheduler.getPerformArgs(task, opt.block); + performArgs.skip = !stageHandler.performRawSeries + && ecModel.isSeriesFiltered(task.context.model); + updatePayload(task, payload); + unfinished |= task.perform(performArgs); + }); + } + }); + + function needSetDirty(opt, task) { + return opt.setDirty && (!opt.dirtyMap || opt.dirtyMap.get(task.__pipeline.id)); + } + + scheduler.unfinished |= unfinished; +} + +proto.performSeriesTasks = function (ecModel) { + var unfinished; + + ecModel.eachSeries(function (seriesModel) { + // Progress to the end for dataInit and dataRestore. + unfinished |= seriesModel.dataTask.perform(); + }); + + this.unfinished |= unfinished; +}; + +proto.plan = function () { + // Travel pipelines, check block. + this._pipelineMap.each(function (pipeline) { + var task = pipeline.tail; + do { + if (task.__block) { + pipeline.blockIndex = task.__idxInPipeline; + break; + } + task = task.getUpstream(); + } + while (task); + }); +}; + +var updatePayload = proto.updatePayload = function (task, payload) { + payload !== 'remain' && (task.context.payload = payload); +}; + +function createSeriesStageTask(scheduler, stageHandler, stageHandlerRecord, ecModel, api) { + var seriesTaskMap = stageHandlerRecord.seriesTaskMap + || (stageHandlerRecord.seriesTaskMap = createHashMap()); + var seriesType = stageHandler.seriesType; + var getTargetSeries = stageHandler.getTargetSeries; + + // If a stageHandler should cover all series, `createOnAllSeries` should be declared mandatorily, + // to avoid some typo or abuse. Otherwise if an extension do not specify a `seriesType`, + // it works but it may cause other irrelevant charts blocked. + if (stageHandler.createOnAllSeries) { + ecModel.eachRawSeries(create); + } + else if (seriesType) { + ecModel.eachRawSeriesByType(seriesType, create); + } + else if (getTargetSeries) { + getTargetSeries(ecModel, api).each(create); + } + + function create(seriesModel) { + var pipelineId = seriesModel.uid; + + // Init tasks for each seriesModel only once. + // Reuse original task instance. + var task = seriesTaskMap.get(pipelineId) + || seriesTaskMap.set(pipelineId, createTask({ + plan: seriesTaskPlan, + reset: seriesTaskReset, + count: seriesTaskCount + })); + task.context = { + model: seriesModel, + ecModel: ecModel, + api: api, + useClearVisual: stageHandler.isVisual && !stageHandler.isLayout, + plan: stageHandler.plan, + reset: stageHandler.reset, + scheduler: scheduler + }; + pipe(scheduler, seriesModel, task); + } + + // Clear unused series tasks. + var pipelineMap = scheduler._pipelineMap; + seriesTaskMap.each(function (task, pipelineId) { + if (!pipelineMap.get(pipelineId)) { + task.dispose(); + seriesTaskMap.removeKey(pipelineId); + } + }); +} + +function createOverallStageTask(scheduler, stageHandler, stageHandlerRecord, ecModel, api) { + var overallTask = stageHandlerRecord.overallTask = stageHandlerRecord.overallTask + // For overall task, the function only be called on reset stage. + || createTask({reset: overallTaskReset}); + + overallTask.context = { + ecModel: ecModel, + api: api, + overallReset: stageHandler.overallReset, + scheduler: scheduler + }; + + // Reuse orignal stubs. + var agentStubMap = overallTask.agentStubMap = overallTask.agentStubMap || createHashMap(); + + var seriesType = stageHandler.seriesType; + var getTargetSeries = stageHandler.getTargetSeries; + var overallProgress = true; + var modifyOutputEnd = stageHandler.modifyOutputEnd; + + // An overall task with seriesType detected or has `getTargetSeries`, we add + // stub in each pipelines, it will set the overall task dirty when the pipeline + // progress. Moreover, to avoid call the overall task each frame (too frequent), + // we set the pipeline block. + if (seriesType) { + ecModel.eachRawSeriesByType(seriesType, createStub); + } + else if (getTargetSeries) { + getTargetSeries(ecModel, api).each(createStub); + } + // Otherwise, (usually it is legancy case), the overall task will only be + // executed when upstream dirty. Otherwise the progressive rendering of all + // pipelines will be disabled unexpectedly. But it still needs stubs to receive + // dirty info from upsteam. + else { + overallProgress = false; + each$1(ecModel.getSeries(), createStub); + } + + function createStub(seriesModel) { + var pipelineId = seriesModel.uid; + var stub = agentStubMap.get(pipelineId); + if (!stub) { + stub = agentStubMap.set(pipelineId, createTask( + {reset: stubReset, onDirty: stubOnDirty} + )); + // When the result of `getTargetSeries` changed, the overallTask + // should be set as dirty and re-performed. + overallTask.dirty(); + } + stub.context = { + model: seriesModel, + overallProgress: overallProgress, + modifyOutputEnd: modifyOutputEnd + }; + stub.agent = overallTask; + stub.__block = overallProgress; + + pipe(scheduler, seriesModel, stub); + } + + // Clear unused stubs. + var pipelineMap = scheduler._pipelineMap; + agentStubMap.each(function (stub, pipelineId) { + if (!pipelineMap.get(pipelineId)) { + stub.dispose(); + // When the result of `getTargetSeries` changed, the overallTask + // should be set as dirty and re-performed. + overallTask.dirty(); + agentStubMap.removeKey(pipelineId); + } + }); +} + +function overallTaskReset(context) { + context.overallReset( + context.ecModel, context.api, context.payload + ); +} + +function stubReset(context, upstreamContext) { + return context.overallProgress && stubProgress; +} + +function stubProgress() { + this.agent.dirty(); + this.getDownstream().dirty(); +} + +function stubOnDirty() { + this.agent && this.agent.dirty(); +} + +function seriesTaskPlan(context) { + return context.plan && context.plan( + context.model, context.ecModel, context.api, context.payload + ); +} + +function seriesTaskReset(context) { + if (context.useClearVisual) { + context.data.clearAllVisual(); + } + var resetDefines = context.resetDefines = normalizeToArray(context.reset( + context.model, context.ecModel, context.api, context.payload + )); + return resetDefines.length > 1 + ? map(resetDefines, function (v, idx) { + return makeSeriesTaskProgress(idx); + }) + : singleSeriesTaskProgress; +} + +var singleSeriesTaskProgress = makeSeriesTaskProgress(0); + +function makeSeriesTaskProgress(resetDefineIdx) { + return function (params, context) { + var data = context.data; + var resetDefine = context.resetDefines[resetDefineIdx]; + + if (resetDefine && resetDefine.dataEach) { + for (var i = params.start; i < params.end; i++) { + resetDefine.dataEach(data, i); + } + } + else if (resetDefine && resetDefine.progress) { + resetDefine.progress(params, data); + } + }; +} + +function seriesTaskCount(context) { + return context.data.count(); +} + +function pipe(scheduler, seriesModel, task) { + var pipelineId = seriesModel.uid; + var pipeline = scheduler._pipelineMap.get(pipelineId); + !pipeline.head && (pipeline.head = task); + pipeline.tail && pipeline.tail.pipe(task); + pipeline.tail = task; + task.__idxInPipeline = pipeline.count++; + task.__pipeline = pipeline; +} + +Scheduler.wrapStageHandler = function (stageHandler, visualType) { + if (isFunction$1(stageHandler)) { + stageHandler = { + overallReset: stageHandler, + seriesType: detectSeriseType(stageHandler) + }; + } + + stageHandler.uid = getUID('stageHandler'); + visualType && (stageHandler.visualType = visualType); + + return stageHandler; +}; + + + +/** + * Only some legacy stage handlers (usually in echarts extensions) are pure function. + * To ensure that they can work normally, they should work in block mode, that is, + * they should not be started util the previous tasks finished. So they cause the + * progressive rendering disabled. We try to detect the series type, to narrow down + * the block range to only the series type they concern, but not all series. + */ +function detectSeriseType(legacyFunc) { + seriesType = null; + try { + // Assume there is no async when calling `eachSeriesByType`. + legacyFunc(ecModelMock, apiMock); + } + catch (e) { + } + return seriesType; +} + +var ecModelMock = {}; +var apiMock = {}; +var seriesType; + +mockMethods(ecModelMock, GlobalModel); +mockMethods(apiMock, ExtensionAPI); +ecModelMock.eachSeriesByType = ecModelMock.eachRawSeriesByType = function (type) { + seriesType = type; +}; +ecModelMock.eachComponent = function (cond) { + if (cond.mainType === 'series' && cond.subType) { + seriesType = cond.subType; + } +}; + +function mockMethods(target, Clz) { + for (var name in Clz.prototype) { + // Do not use hasOwnProperty + target[name] = noop; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 colorAll = ['#37A2DA', '#32C5E9', '#67E0E3', '#9FE6B8', '#FFDB5C','#ff9f7f', '#fb7293', '#E062AE', '#E690D1', '#e7bcf3', '#9d96f5', '#8378EA', '#96BFFF']; + +var lightTheme = { + + color: colorAll, + + colorLayer: [ + ['#37A2DA', '#ffd85c', '#fd7b5f'], + ['#37A2DA', '#67E0E3', '#FFDB5C', '#ff9f7f', '#E062AE', '#9d96f5'], + ['#37A2DA', '#32C5E9', '#9FE6B8', '#FFDB5C', '#ff9f7f', '#fb7293', '#e7bcf3', '#8378EA', '#96BFFF'], + colorAll + ] +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 contrastColor = '#eee'; +var axisCommon = function () { + return { + axisLine: { + lineStyle: { + color: contrastColor + } + }, + axisTick: { + lineStyle: { + color: contrastColor + } + }, + axisLabel: { + textStyle: { + color: contrastColor + } + }, + splitLine: { + lineStyle: { + type: 'dashed', + color: '#aaa' + } + }, + splitArea: { + areaStyle: { + color: contrastColor + } + } + }; +}; + +var colorPalette = ['#dd6b66','#759aa0','#e69d87','#8dc1a9','#ea7e53','#eedd78','#73a373','#73b9bc','#7289ab', '#91ca8c','#f49f42']; +var theme = { + color: colorPalette, + backgroundColor: '#333', + tooltip: { + axisPointer: { + lineStyle: { + color: contrastColor + }, + crossStyle: { + color: contrastColor + } + } + }, + legend: { + textStyle: { + color: contrastColor + } + }, + textStyle: { + color: contrastColor + }, + title: { + textStyle: { + color: contrastColor + } + }, + toolbox: { + iconStyle: { + normal: { + borderColor: contrastColor + } + } + }, + dataZoom: { + textStyle: { + color: contrastColor + } + }, + visualMap: { + textStyle: { + color: contrastColor + } + }, + timeline: { + lineStyle: { + color: contrastColor + }, + itemStyle: { + normal: { + color: colorPalette[1] + } + }, + label: { + normal: { + textStyle: { + color: contrastColor + } + } + }, + controlStyle: { + normal: { + color: contrastColor, + borderColor: contrastColor + } + } + }, + timeAxis: axisCommon(), + logAxis: axisCommon(), + valueAxis: axisCommon(), + categoryAxis: axisCommon(), + + line: { + symbol: 'circle' + }, + graph: { + color: colorPalette + }, + gauge: { + title: { + textStyle: { + color: contrastColor + } + } + }, + candlestick: { + itemStyle: { + normal: { + color: '#FD1050', + color0: '#0CF49B', + borderColor: '#FD1050', + borderColor0: '#0CF49B' + } + } + } +}; +theme.categoryAxis.splitLine.show = false; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * This module is imported by echarts directly. + * + * Notice: + * Always keep this file exists for backward compatibility. + * Because before 4.1.0, dataset is an optional component, + * some users may import this module manually. + */ + +ComponentModel.extend({ + + type: 'dataset', + + /** + * @protected + */ + defaultOption: { + + // 'row', 'column' + seriesLayoutBy: SERIES_LAYOUT_BY_COLUMN, + + // null/'auto': auto detect header, see "module:echarts/data/helper/sourceHelper" + sourceHeader: null, + + dimensions: null, + + source: null + }, + + optionUpdated: function () { + detectSourceFormat(this); + } + +}); + +Component.extend({ + + type: 'dataset' + +}); + +/** + * 椭圆形状 + * @module zrender/graphic/shape/Ellipse + */ + +var Ellipse = Path.extend({ + + type: 'ellipse', + + shape: { + cx: 0, cy: 0, + rx: 0, ry: 0 + }, + + buildPath: function (ctx, shape) { + var k = 0.5522848; + var x = shape.cx; + var y = shape.cy; + var a = shape.rx; + var b = shape.ry; + var ox = a * k; // 水平控制点偏移量 + var oy = b * k; // 垂直控制点偏移量 + // 从椭圆的左端点开始顺时针绘制四条三次贝塞尔曲线 + ctx.moveTo(x - a, y); + ctx.bezierCurveTo(x - a, y - oy, x - ox, y - b, x, y - b); + ctx.bezierCurveTo(x + ox, y - b, x + a, y - oy, x + a, y); + ctx.bezierCurveTo(x + a, y + oy, x + ox, y + b, x, y + b); + ctx.bezierCurveTo(x - ox, y + b, x - a, y + oy, x - a, y); + ctx.closePath(); + } +}); + +// import RadialGradient from '../graphic/RadialGradient'; +// import Pattern from '../graphic/Pattern'; +// import * as vector from '../core/vector'; +// Most of the values can be separated by comma and/or white space. +var DILIMITER_REG = /[\s,]+/; + +/** + * For big svg string, this method might be time consuming. + * + * @param {string} svg xml string + * @return {Object} xml root. + */ +function parseXML(svg) { + if (isString(svg)) { + var parser = new DOMParser(); + svg = parser.parseFromString(svg, 'text/xml'); + } + + // Document node. If using $.get, doc node may be input. + if (svg.nodeType === 9) { + svg = svg.firstChild; + } + // nodeName of is also 'svg'. + while (svg.nodeName.toLowerCase() !== 'svg' || svg.nodeType !== 1) { + svg = svg.nextSibling; + } + + return svg; +} + +function SVGParser() { + this._defs = {}; + this._root = null; + + this._isDefine = false; + this._isText = false; +} + +SVGParser.prototype.parse = function (xml, opt) { + opt = opt || {}; + + var svg = parseXML(xml); + + if (!svg) { + throw new Error('Illegal svg'); + } + + var root = new Group(); + this._root = root; + // parse view port + var viewBox = svg.getAttribute('viewBox') || ''; + + // If width/height not specified, means "100%" of `opt.width/height`. + // TODO: Other percent value not supported yet. + var width = parseFloat(svg.getAttribute('width') || opt.width); + var height = parseFloat(svg.getAttribute('height') || opt.height); + // If width/height not specified, set as null for output. + isNaN(width) && (width = null); + isNaN(height) && (height = null); + + // Apply inline style on svg element. + parseAttributes(svg, root, null, true); + + var child = svg.firstChild; + while (child) { + this._parseNode(child, root); + child = child.nextSibling; + } + + var viewBoxRect; + var viewBoxTransform; + + if (viewBox) { + var viewBoxArr = trim(viewBox).split(DILIMITER_REG); + // Some invalid case like viewBox: 'none'. + if (viewBoxArr.length >= 4) { + viewBoxRect = { + x: parseFloat(viewBoxArr[0] || 0), + y: parseFloat(viewBoxArr[1] || 0), + width: parseFloat(viewBoxArr[2]), + height: parseFloat(viewBoxArr[3]) + }; + } + } + + if (viewBoxRect && width != null && height != null) { + viewBoxTransform = makeViewBoxTransform(viewBoxRect, width, height); + + if (!opt.ignoreViewBox) { + // If set transform on the output group, it probably bring trouble when + // some users only intend to show the clipped content inside the viewBox, + // but not intend to transform the output group. So we keep the output + // group no transform. If the user intend to use the viewBox as a + // camera, just set `opt.ignoreViewBox` as `true` and set transfrom + // manually according to the viewBox info in the output of this method. + var elRoot = root; + root = new Group(); + root.add(elRoot); + elRoot.scale = viewBoxTransform.scale.slice(); + elRoot.position = viewBoxTransform.position.slice(); + } + } + + // Some shapes might be overflow the viewport, which should be + // clipped despite whether the viewBox is used, as the SVG does. + if (!opt.ignoreRootClip && width != null && height != null) { + root.setClipPath(new Rect({ + shape: {x: 0, y: 0, width: width, height: height} + })); + } + + // Set width/height on group just for output the viewport size. + return { + root: root, + width: width, + height: height, + viewBoxRect: viewBoxRect, + viewBoxTransform: viewBoxTransform + }; +}; + +SVGParser.prototype._parseNode = function (xmlNode, parentGroup) { + + var nodeName = xmlNode.nodeName.toLowerCase(); + + // TODO + // support in svg, where nodeName is 'style', + // CSS classes is defined globally wherever the style tags are declared. + + if (nodeName === 'defs') { + // define flag + this._isDefine = true; + } + else if (nodeName === 'text') { + this._isText = true; + } + + var el; + if (this._isDefine) { + var parser = defineParsers[nodeName]; + if (parser) { + var def = parser.call(this, xmlNode); + var id = xmlNode.getAttribute('id'); + if (id) { + this._defs[id] = def; + } + } + } + else { + var parser = nodeParsers[nodeName]; + if (parser) { + el = parser.call(this, xmlNode, parentGroup); + parentGroup.add(el); + } + } + + var child = xmlNode.firstChild; + while (child) { + if (child.nodeType === 1) { + this._parseNode(child, el); + } + // Is text + if (child.nodeType === 3 && this._isText) { + this._parseText(child, el); + } + child = child.nextSibling; + } + + // Quit define + if (nodeName === 'defs') { + this._isDefine = false; + } + else if (nodeName === 'text') { + this._isText = false; + } +}; + +SVGParser.prototype._parseText = function (xmlNode, parentGroup) { + if (xmlNode.nodeType === 1) { + var dx = xmlNode.getAttribute('dx') || 0; + var dy = xmlNode.getAttribute('dy') || 0; + this._textX += parseFloat(dx); + this._textY += parseFloat(dy); + } + + var text = new Text({ + style: { + text: xmlNode.textContent, + transformText: true + }, + position: [this._textX || 0, this._textY || 0] + }); + + inheritStyle(parentGroup, text); + parseAttributes(xmlNode, text, this._defs); + + var fontSize = text.style.fontSize; + if (fontSize && fontSize < 9) { + // PENDING + text.style.fontSize = 9; + text.scale = text.scale || [1, 1]; + text.scale[0] *= fontSize / 9; + text.scale[1] *= fontSize / 9; + } + + var rect = text.getBoundingRect(); + this._textX += rect.width; + + parentGroup.add(text); + + return text; +}; + +var nodeParsers = { + 'g': function(xmlNode, parentGroup) { + var g = new Group(); + inheritStyle(parentGroup, g); + parseAttributes(xmlNode, g, this._defs); + + return g; + }, + 'rect': function(xmlNode, parentGroup) { + var rect = new Rect(); + inheritStyle(parentGroup, rect); + parseAttributes(xmlNode, rect, this._defs); + + rect.setShape({ + x: parseFloat(xmlNode.getAttribute('x') || 0), + y: parseFloat(xmlNode.getAttribute('y') || 0), + width: parseFloat(xmlNode.getAttribute('width') || 0), + height: parseFloat(xmlNode.getAttribute('height') || 0) + }); + + // console.log(xmlNode.getAttribute('transform')); + // console.log(rect.transform); + + return rect; + }, + 'circle': function(xmlNode, parentGroup) { + var circle = new Circle(); + inheritStyle(parentGroup, circle); + parseAttributes(xmlNode, circle, this._defs); + + circle.setShape({ + cx: parseFloat(xmlNode.getAttribute('cx') || 0), + cy: parseFloat(xmlNode.getAttribute('cy') || 0), + r: parseFloat(xmlNode.getAttribute('r') || 0) + }); + + return circle; + }, + 'line': function(xmlNode, parentGroup) { + var line = new Line(); + inheritStyle(parentGroup, line); + parseAttributes(xmlNode, line, this._defs); + + line.setShape({ + x1: parseFloat(xmlNode.getAttribute('x1') || 0), + y1: parseFloat(xmlNode.getAttribute('y1') || 0), + x2: parseFloat(xmlNode.getAttribute('x2') || 0), + y2: parseFloat(xmlNode.getAttribute('y2') || 0) + }); + + return line; + }, + 'ellipse': function(xmlNode, parentGroup) { + var ellipse = new Ellipse(); + inheritStyle(parentGroup, ellipse); + parseAttributes(xmlNode, ellipse, this._defs); + + ellipse.setShape({ + cx: parseFloat(xmlNode.getAttribute('cx') || 0), + cy: parseFloat(xmlNode.getAttribute('cy') || 0), + rx: parseFloat(xmlNode.getAttribute('rx') || 0), + ry: parseFloat(xmlNode.getAttribute('ry') || 0) + }); + return ellipse; + }, + 'polygon': function(xmlNode, parentGroup) { + var points = xmlNode.getAttribute('points'); + if (points) { + points = parsePoints(points); + } + var polygon = new Polygon({ + shape: { + points: points || [] + } + }); + + inheritStyle(parentGroup, polygon); + parseAttributes(xmlNode, polygon, this._defs); + + return polygon; + }, + 'polyline': function(xmlNode, parentGroup) { + var path = new Path(); + inheritStyle(parentGroup, path); + parseAttributes(xmlNode, path, this._defs); + + var points = xmlNode.getAttribute('points'); + if (points) { + points = parsePoints(points); + } + var polyline = new Polyline({ + shape: { + points: points || [] + } + }); + + return polyline; + }, + 'image': function(xmlNode, parentGroup) { + var img = new ZImage(); + inheritStyle(parentGroup, img); + parseAttributes(xmlNode, img, this._defs); + + img.setStyle({ + image: xmlNode.getAttribute('xlink:href'), + x: xmlNode.getAttribute('x'), + y: xmlNode.getAttribute('y'), + width: xmlNode.getAttribute('width'), + height: xmlNode.getAttribute('height') + }); + + return img; + }, + 'text': function(xmlNode, parentGroup) { + var x = xmlNode.getAttribute('x') || 0; + var y = xmlNode.getAttribute('y') || 0; + var dx = xmlNode.getAttribute('dx') || 0; + var dy = xmlNode.getAttribute('dy') || 0; + + this._textX = parseFloat(x) + parseFloat(dx); + this._textY = parseFloat(y) + parseFloat(dy); + + var g = new Group(); + inheritStyle(parentGroup, g); + parseAttributes(xmlNode, g, this._defs); + + return g; + }, + 'tspan': function (xmlNode, parentGroup) { + var x = xmlNode.getAttribute('x'); + var y = xmlNode.getAttribute('y'); + if (x != null) { + // new offset x + this._textX = parseFloat(x); + } + if (y != null) { + // new offset y + this._textY = parseFloat(y); + } + var dx = xmlNode.getAttribute('dx') || 0; + var dy = xmlNode.getAttribute('dy') || 0; + + var g = new Group(); + + inheritStyle(parentGroup, g); + parseAttributes(xmlNode, g, this._defs); + + + this._textX += dx; + this._textY += dy; + + return g; + }, + 'path': function(xmlNode, parentGroup) { + // TODO svg fill rule + // https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill-rule + // path.style.globalCompositeOperation = 'xor'; + var d = xmlNode.getAttribute('d') || ''; + + // Performance sensitive. + + var path = createFromString(d); + + inheritStyle(parentGroup, path); + parseAttributes(xmlNode, path, this._defs); + + return path; + } +}; + +var defineParsers = { + + 'lineargradient': function(xmlNode) { + var x1 = parseInt(xmlNode.getAttribute('x1') || 0); + var y1 = parseInt(xmlNode.getAttribute('y1') || 0); + var x2 = parseInt(xmlNode.getAttribute('x2') || 10); + var y2 = parseInt(xmlNode.getAttribute('y2') || 0); + + var gradient = new LinearGradient(x1, y1, x2, y2); + + _parseGradientColorStops(xmlNode, gradient); + + return gradient; + }, + + 'radialgradient': function(xmlNode) { + + } +}; + +function _parseGradientColorStops(xmlNode, gradient) { + + var stop = xmlNode.firstChild; + + while (stop) { + if (stop.nodeType === 1) { + var offset = stop.getAttribute('offset'); + if (offset.indexOf('%') > 0) { // percentage + offset = parseInt(offset) / 100; + } + else if(offset) { // number from 0 to 1 + offset = parseFloat(offset); + } + else { + offset = 0; + } + + var stopColor = stop.getAttribute('stop-color') || '#000000'; + + gradient.addColorStop(offset, stopColor); + } + stop = stop.nextSibling; + } +} + +function inheritStyle(parent, child) { + if (parent && parent.__inheritedStyle) { + if (!child.__inheritedStyle) { + child.__inheritedStyle = {}; + } + defaults(child.__inheritedStyle, parent.__inheritedStyle); + } +} + +function parsePoints(pointsString) { + var list = trim(pointsString).split(DILIMITER_REG); + var points = []; + + for (var i = 0; i < list.length; i+=2) { + var x = parseFloat(list[i]); + var y = parseFloat(list[i+1]); + points.push([x, y]); + } + return points; +} + +var attributesMap = { + 'fill': 'fill', + 'stroke': 'stroke', + 'stroke-width': 'lineWidth', + 'opacity': 'opacity', + 'fill-opacity': 'fillOpacity', + 'stroke-opacity': 'strokeOpacity', + 'stroke-dasharray': 'lineDash', + 'stroke-dashoffset': 'lineDashOffset', + 'stroke-linecap': 'lineCap', + 'stroke-linejoin': 'lineJoin', + 'stroke-miterlimit': 'miterLimit', + 'font-family': 'fontFamily', + 'font-size': 'fontSize', + 'font-style': 'fontStyle', + 'font-weight': 'fontWeight', + + 'text-align': 'textAlign', + 'alignment-baseline': 'textBaseline' +}; + +function parseAttributes(xmlNode, el, defs, onlyInlineStyle) { + var zrStyle = el.__inheritedStyle || {}; + var isTextEl = el.type === 'text'; + + // TODO Shadow + if (xmlNode.nodeType === 1) { + parseTransformAttribute(xmlNode, el); + + extend(zrStyle, parseStyleAttribute(xmlNode)); + + if (!onlyInlineStyle) { + for (var svgAttrName in attributesMap) { + if (attributesMap.hasOwnProperty(svgAttrName)) { + var attrValue = xmlNode.getAttribute(svgAttrName); + if (attrValue != null) { + zrStyle[attributesMap[svgAttrName]] = attrValue; + } + } + } + } + } + + var elFillProp = isTextEl ? 'textFill' : 'fill'; + var elStrokeProp = isTextEl ? 'textStroke' : 'stroke'; + + el.style = el.style || new Style(); + var elStyle = el.style; + + zrStyle.fill != null && elStyle.set(elFillProp, getPaint(zrStyle.fill, defs)); + zrStyle.stroke != null && elStyle.set(elStrokeProp, getPaint(zrStyle.stroke, defs)); + + each$1([ + 'lineWidth', 'opacity', 'fillOpacity', 'strokeOpacity', 'miterLimit', 'fontSize' + ], function (propName) { + var elPropName = (propName === 'lineWidth' && isTextEl) ? 'textStrokeWidth' : propName; + zrStyle[propName] != null && elStyle.set(elPropName, parseFloat(zrStyle[propName])); + }); + + if (!zrStyle.textBaseline || zrStyle.textBaseline === 'auto') { + zrStyle.textBaseline = 'alphabetic'; + } + if (zrStyle.textBaseline === 'alphabetic') { + zrStyle.textBaseline = 'bottom'; + } + if (zrStyle.textAlign === 'start') { + zrStyle.textAlign = 'left'; + } + if (zrStyle.textAlign === 'end') { + zrStyle.textAlign = 'right'; + } + + each$1(['lineDashOffset', 'lineCap', 'lineJoin', + 'fontWeight', 'fontFamily', 'fontStyle', 'textAlign', 'textBaseline' + ], function (propName) { + zrStyle[propName] != null && elStyle.set(propName, zrStyle[propName]); + }); + + if (zrStyle.lineDash) { + el.style.lineDash = trim(zrStyle.lineDash).split(DILIMITER_REG); + } + + if (elStyle[elStrokeProp] && elStyle[elStrokeProp] !== 'none') { + // enable stroke + el[elStrokeProp] = true; + } + + el.__inheritedStyle = zrStyle; +} + + +var urlRegex = /url\(\s*#(.*?)\)/; +function getPaint(str, defs) { + // if (str === 'none') { + // return; + // } + var urlMatch = defs && str && str.match(urlRegex); + if (urlMatch) { + var url = trim(urlMatch[1]); + var def = defs[url]; + return def; + } + return str; +} + +var transformRegex = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g; + +function parseTransformAttribute(xmlNode, node) { + var transform = xmlNode.getAttribute('transform'); + if (transform) { + transform = transform.replace(/,/g, ' '); + var m = null; + var transformOps = []; + transform.replace(transformRegex, function(str, type, value) { + transformOps.push(type, value); + }); + for(var i = transformOps.length - 1; i > 0; i-=2) { + var value = transformOps[i]; + var type = transformOps[i-1]; + m = m || create$1(); + switch(type) { + case 'translate': + value = trim(value).split(DILIMITER_REG); + translate(m, m, [parseFloat(value[0]), parseFloat(value[1] || 0)]); + break; + case 'scale': + value = trim(value).split(DILIMITER_REG); + scale$1(m, m, [parseFloat(value[0]), parseFloat(value[1] || value[0])]); + break; + case 'rotate': + value = trim(value).split(DILIMITER_REG); + rotate(m, m, parseFloat(value[0])); + break; + case 'skew': + value = trim(value).split(DILIMITER_REG); + console.warn('Skew transform is not supported yet'); + break; + case 'matrix': + var value = trim(value).split(DILIMITER_REG); + m[0] = parseFloat(value[0]); + m[1] = parseFloat(value[1]); + m[2] = parseFloat(value[2]); + m[3] = parseFloat(value[3]); + m[4] = parseFloat(value[4]); + m[5] = parseFloat(value[5]); + break; + } + } + } + node.setLocalTransform(m); + +} + +// Value may contain space. +var styleRegex = /([^\s:;]+)\s*:\s*([^:;]+)/g; +function parseStyleAttribute(xmlNode) { + var style = xmlNode.getAttribute('style'); + var result = {}; + + if (!style) { + return result; + } + + var styleList = {}; + styleRegex.lastIndex = 0; + var styleRegResult; + while ((styleRegResult = styleRegex.exec(style)) != null) { + styleList[styleRegResult[1]] = styleRegResult[2]; + } + + for (var svgAttrName in attributesMap) { + if (attributesMap.hasOwnProperty(svgAttrName) && styleList[svgAttrName] != null) { + result[attributesMap[svgAttrName]] = styleList[svgAttrName]; + } + } + + return result; +} + +/** + * @param {Array.} viewBoxRect + * @param {number} width + * @param {number} height + * @return {Object} {scale, position} + */ +function makeViewBoxTransform(viewBoxRect, width, height) { + var scaleX = width / viewBoxRect.width; + var scaleY = height / viewBoxRect.height; + var scale = Math.min(scaleX, scaleY); + // preserveAspectRatio 'xMidYMid' + var viewBoxScale = [scale, scale]; + var viewBoxPosition = [ + -(viewBoxRect.x + viewBoxRect.width / 2) * scale + width / 2, + -(viewBoxRect.y + viewBoxRect.height / 2) * scale + height / 2 + ]; + + return { + scale: viewBoxScale, + position: viewBoxPosition + }; +} + +/** + * @param {string|XMLElement} xml + * @param {Object} [opt] + * @param {number} [opt.width] Default width if svg width not specified or is a percent value. + * @param {number} [opt.height] Default height if svg height not specified or is a percent value. + * @param {boolean} [opt.ignoreViewBox] + * @param {boolean} [opt.ignoreRootClip] + * @return {Object} result: + * { + * root: Group, The root of the the result tree of zrender shapes, + * width: number, the viewport width of the SVG, + * height: number, the viewport height of the SVG, + * viewBoxRect: {x, y, width, height}, the declared viewBox rect of the SVG, if exists, + * viewBoxTransform: the {scale, position} calculated by viewBox and viewport, is exists. + * } + */ +function parseSVG(xml, opt) { + var parser = new SVGParser(); + return parser.parse(xml, opt); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 storage = createHashMap(); + +// For minimize the code size of common echarts package, +// do not put too much logic in this module. + +var mapDataStorage = { + + // The format of record: see `echarts.registerMap`. + // Compatible with previous `echarts.registerMap`. + registerMap: function (mapName, rawGeoJson, rawSpecialAreas) { + + var records; + + if (isArray(rawGeoJson)) { + records = rawGeoJson; + } + else if (rawGeoJson.svg) { + records = [{ + type: 'svg', + source: rawGeoJson.svg, + specialAreas: rawGeoJson.specialAreas + }]; + } + else { + // Backward compatibility. + if (rawGeoJson.geoJson && !rawGeoJson.features) { + rawSpecialAreas = rawGeoJson.specialAreas; + rawGeoJson = rawGeoJson.geoJson; + } + records = [{ + type: 'geoJSON', + source: rawGeoJson, + specialAreas: rawSpecialAreas + }]; + } + + each$1(records, function (record) { + var type = record.type; + type === 'geoJson' && (type = record.type = 'geoJSON'); + + var parse = parsers[type]; + + if (__DEV__) { + assert$1(parse, 'Illegal map type: ' + type); + } + + parse(record); + }); + + return storage.set(mapName, records); + }, + + retrieveMap: function (mapName) { + return storage.get(mapName); + } + +}; + +var parsers = { + + geoJSON: function (record) { + var source = record.source; + record.geoJSON = !isString(source) + ? source + : (typeof JSON !== 'undefined' && JSON.parse) + ? JSON.parse(source) + : (new Function('return (' + source + ');'))(); + }, + + // Only perform parse to XML object here, which might be time + // consiming for large SVG. + // Although convert XML to zrender element is also time consiming, + // if we do it here, the clone of zrender elements has to be + // required. So we do it once for each geo instance, util real + // performance issues call for optimizing it. + svg: function (record) { + record.svgXML = parseXML(record.source); + } + +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 assert = assert$1; +var each = each$1; +var isFunction = isFunction$1; +var isObject = isObject$1; +var parseClassType = ComponentModel.parseClassType; + +var version = '4.1.0'; + +var dependencies = { + zrender: '4.0.4' +}; + +var TEST_FRAME_REMAIN_TIME = 1; + +var PRIORITY_PROCESSOR_FILTER = 1000; +var PRIORITY_PROCESSOR_STATISTIC = 5000; + +var PRIORITY_VISUAL_LAYOUT = 1000; +var PRIORITY_VISUAL_GLOBAL = 2000; +var PRIORITY_VISUAL_CHART = 3000; +var PRIORITY_VISUAL_COMPONENT = 4000; +// FIXME +// necessary? +var PRIORITY_VISUAL_BRUSH = 5000; + +var PRIORITY = { + PROCESSOR: { + FILTER: PRIORITY_PROCESSOR_FILTER, + STATISTIC: PRIORITY_PROCESSOR_STATISTIC + }, + VISUAL: { + LAYOUT: PRIORITY_VISUAL_LAYOUT, + GLOBAL: PRIORITY_VISUAL_GLOBAL, + CHART: PRIORITY_VISUAL_CHART, + COMPONENT: PRIORITY_VISUAL_COMPONENT, + BRUSH: PRIORITY_VISUAL_BRUSH + } +}; + +// Main process have three entries: `setOption`, `dispatchAction` and `resize`, +// where they must not be invoked nestedly, except the only case: invoke +// dispatchAction with updateMethod "none" in main process. +// This flag is used to carry out this rule. +// All events will be triggered out side main process (i.e. when !this[IN_MAIN_PROCESS]). +var IN_MAIN_PROCESS = '__flagInMainProcess'; +var OPTION_UPDATED = '__optionUpdated'; +var ACTION_REG = /^[a-zA-Z0-9_]+$/; + + +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'); +mixin(MessageCenter, Eventful); + +/** + * @module echarts~ECharts + */ +function ECharts(dom, theme$$1, opts) { + opts = opts || {}; + + // Get theme by name + if (typeof theme$$1 === 'string') { + theme$$1 = themeStorage[theme$$1]; + } + + /** + * @type {string} + */ + this.id; + + /** + * Group id + * @type {string} + */ + this.group; + + /** + * @type {HTMLElement} + * @private + */ + this._dom = dom; + + var defaultRenderer = 'canvas'; + if (__DEV__) { + defaultRenderer = ( + typeof window === 'undefined' ? global : window + ).__ECHARTS__DEFAULT__RENDERER__ || defaultRenderer; + } + + /** + * @type {module:zrender/ZRender} + * @private + */ + var zr = this._zr = init$1(dom, { + renderer: opts.renderer || defaultRenderer, + devicePixelRatio: opts.devicePixelRatio, + width: opts.width, + height: opts.height + }); + + /** + * Expect 60 pfs. + * @type {Function} + * @private + */ + this._throttledZrFlush = throttle(bind(zr.flush, zr), 17); + + var theme$$1 = clone(theme$$1); + theme$$1 && backwardCompat(theme$$1, true); + /** + * @type {Object} + * @private + */ + this._theme = theme$$1; + + /** + * @type {Array.} + * @private + */ + this._chartsViews = []; + + /** + * @type {Object.} + * @private + */ + this._chartsMap = {}; + + /** + * @type {Array.} + * @private + */ + this._componentsViews = []; + + /** + * @type {Object.} + * @private + */ + this._componentsMap = {}; + + /** + * @type {module:echarts/CoordinateSystem} + * @private + */ + this._coordSysMgr = new CoordinateSystemManager(); + + /** + * @type {module:echarts/ExtensionAPI} + * @private + */ + var api = this._api = createExtensionAPI(this); + + // Sort on demand + function prioritySortFunc(a, b) { + return a.__prio - b.__prio; + } + sort(visualFuncs, prioritySortFunc); + sort(dataProcessorFuncs, prioritySortFunc); + + /** + * @type {module:echarts/stream/Scheduler} + */ + this._scheduler = new Scheduler(this, api, dataProcessorFuncs, visualFuncs); + + Eventful.call(this, this._ecEventProcessor = makeEventProcessor(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 = bind(this.resize, this); + + // Can't dispatch action during rendering procedure + this._pendingActions = []; + + zr.animation.on('frame', this._onframe, this); + + bindRenderedEvent(zr, this); + + // ECharts instance can be used as value. + setAsPrimitive(this); +} + +var echartsProto = ECharts.prototype; + +echartsProto._onframe = function () { + if (this._disposed) { + return; + } + + var scheduler = this._scheduler; + + // Lazy update + if (this[OPTION_UPDATED]) { + var silent = this[OPTION_UPDATED].silent; + + this[IN_MAIN_PROCESS] = true; + + prepare(this); + updateMethods.update.call(this); + + this[IN_MAIN_PROCESS] = false; + + this[OPTION_UPDATED] = false; + + flushPendingActions.call(this, silent); + + triggerUpdatedEvent.call(this, silent); + } + // Avoid do both lazy update and progress in one frame. + else if (scheduler.unfinished) { + // Stream progress. + var remainTime = TEST_FRAME_REMAIN_TIME; + var ecModel = this._model; + var api = this._api; + scheduler.unfinished = false; + do { + var startTime = +new Date(); + + scheduler.performSeriesTasks(ecModel); + + // Currently dataProcessorFuncs do not check threshold. + scheduler.performDataProcessorTasks(ecModel); + + updateStreamModes(this, ecModel); + + // Do not update coordinate system here. Because that coord system update in + // each frame is not a good user experience. So we follow the rule that + // the extent of the coordinate system is determin in the first frame (the + // frame is executed immedietely after task reset. + // this._coordSysMgr.update(ecModel, api); + + // console.log('--- ec frame visual ---', remainTime); + scheduler.performVisualTasks(ecModel); + + renderSeries(this, this._model, api, 'remain'); + + remainTime -= (+new Date() - startTime); + } + while (remainTime > 0 && scheduler.unfinished); + + // Call flush explicitly for trigger finished event. + if (!scheduler.unfinished) { + this._zr.flush(); + } + // Else, zr flushing be ensue within the same frame, + // because zr flushing is after onframe event. + } +}; + +/** + * @return {HTMLElement} + */ +echartsProto.getDom = function () { + return this._dom; +}; + +/** + * @return {module:zrender~ZRender} + */ +echartsProto.getZr = function () { + return this._zr; +}; + +/** + * Usage: + * chart.setOption(option, notMerge, lazyUpdate); + * chart.setOption(option, { + * notMerge: ..., + * lazyUpdate: ..., + * silent: ... + * }); + * + * @param {Object} option + * @param {Object|boolean} [opts] opts or notMerge. + * @param {boolean} [opts.notMerge=false] + * @param {boolean} [opts.lazyUpdate=false] Useful when setOption frequently. + */ +echartsProto.setOption = function (option, notMerge, lazyUpdate) { + if (__DEV__) { + assert(!this[IN_MAIN_PROCESS], '`setOption` should not be called during main process.'); + } + + var silent; + if (isObject(notMerge)) { + lazyUpdate = notMerge.lazyUpdate; + silent = notMerge.silent; + notMerge = notMerge.notMerge; + } + + this[IN_MAIN_PROCESS] = true; + + if (!this._model || notMerge) { + var optionManager = new OptionManager(this._api); + var theme$$1 = this._theme; + var ecModel = this._model = new GlobalModel(null, null, theme$$1, optionManager); + ecModel.scheduler = this._scheduler; + ecModel.init(null, null, theme$$1, optionManager); + } + + this._model.setOption(option, optionPreprocessorFuncs); + + if (lazyUpdate) { + this[OPTION_UPDATED] = {silent: silent}; + this[IN_MAIN_PROCESS] = false; + } + else { + prepare(this); + + updateMethods.update.call(this); + + // Ensure zr refresh sychronously, and then pixel in canvas can be + // fetched after `setOption`. + this._zr.flush(); + + this[OPTION_UPDATED] = false; + this[IN_MAIN_PROCESS] = false; + + flushPendingActions.call(this, silent); + triggerUpdatedEvent.call(this, silent); + } +}; + +/** + * @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 && this._model.getOption(); +}; + +/** + * @return {number} + */ +echartsProto.getWidth = function () { + return this._zr.getWidth(); +}; + +/** + * @return {number} + */ +echartsProto.getHeight = function () { + return this._zr.getHeight(); +}; + +/** + * @return {number} + */ +echartsProto.getDevicePixelRatio = function () { + return this._zr.painter.dpr || window.devicePixelRatio || 1; +}; + +/** + * Get canvas which has all thing rendered + * @param {Object} opts + * @param {string} [opts.backgroundColor] + * @return {string} + */ +echartsProto.getRenderedCanvas = function (opts) { + if (!env$1.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 + // Never works before in init animation, so remove it. + // zrUtil.each(list, function (el) { + // el.stopAnimation(true); + // }); + return zr.painter.getRenderedCanvas(opts); +}; + +/** + * Get svg data url + * @return {string} + */ +echartsProto.getSvgDataUrl = function () { + if (!env$1.svgSupported) { + return; + } + + var zr = this._zr; + var list = zr.storage.getDisplayList(); + // Stop animations + each$1(list, function (el) { + el.stopAnimation(true); + }); + + return zr.painter.pathToDataUrl(); +}; + +/** + * @return {string} + * @param {Object} opts + * @param {string} [opts.type='png'] + * @param {string} [opts.pixelRatio=1] + * @param {string} [opts.backgroundColor] + * @param {string} [opts.excludeComponents] + */ +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._zr.painter.getType() === 'svg' + ? this.getSvgDataUrl() + : 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$1.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; + + each$1(instances, function (chart, id) { + if (chart.group === groupId) { + var canvas = chart.getRenderedCanvas( + 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 = createCanvas(); + targetCanvas.width = width; + targetCanvas.height = height; + var zr = init$1(targetCanvas); + + each(canvasList, function (item) { + var img = new ZImage({ + 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); + } +}; + +/** + * Convert from logical coordinate system to pixel coordinate system. + * See CoordinateSystem#convertToPixel. + * @param {string|Object} finder + * If string, e.g., 'geo', means {geoIndex: 0}. + * If Object, could contain some of these properties below: + * { + * seriesIndex / seriesId / seriesName, + * geoIndex / geoId, geoName, + * bmapIndex / bmapId / bmapName, + * xAxisIndex / xAxisId / xAxisName, + * yAxisIndex / yAxisId / yAxisName, + * gridIndex / gridId / gridName, + * ... (can be extended) + * } + * @param {Array|number} value + * @return {Array|number} result + */ +echartsProto.convertToPixel = curry(doConvertPixel, 'convertToPixel'); + +/** + * Convert from pixel coordinate system to logical coordinate system. + * See CoordinateSystem#convertFromPixel. + * @param {string|Object} finder + * If string, e.g., 'geo', means {geoIndex: 0}. + * If Object, could contain some of these properties below: + * { + * seriesIndex / seriesId / seriesName, + * geoIndex / geoId / geoName, + * bmapIndex / bmapId / bmapName, + * xAxisIndex / xAxisId / xAxisName, + * yAxisIndex / yAxisId / yAxisName + * gridIndex / gridId / gridName, + * ... (can be extended) + * } + * @param {Array|number} value + * @return {Array|number} result + */ +echartsProto.convertFromPixel = curry(doConvertPixel, 'convertFromPixel'); + +function doConvertPixel(methodName, finder, value) { + var ecModel = this._model; + var coordSysList = this._coordSysMgr.getCoordinateSystems(); + var result; + + finder = parseFinder(ecModel, finder); + + for (var i = 0; i < coordSysList.length; i++) { + var coordSys = coordSysList[i]; + if (coordSys[methodName] + && (result = coordSys[methodName](ecModel, finder, value)) != null + ) { + return result; + } + } + + if (__DEV__) { + console.warn( + 'No coordinate system that supports ' + methodName + ' found by the given finder.' + ); + } +} + +/** + * Is the specified coordinate systems or components contain the given pixel point. + * @param {string|Object} finder + * If string, e.g., 'geo', means {geoIndex: 0}. + * If Object, could contain some of these properties below: + * { + * seriesIndex / seriesId / seriesName, + * geoIndex / geoId / geoName, + * bmapIndex / bmapId / bmapName, + * xAxisIndex / xAxisId / xAxisName, + * yAxisIndex / yAxisId / yAxisName, + * gridIndex / gridId / gridName, + * ... (can be extended) + * } + * @param {Array|number} value + * @return {boolean} result + */ +echartsProto.containPixel = function (finder, value) { + var ecModel = this._model; + var result; + + finder = parseFinder(ecModel, finder); + + each$1(finder, function (models, key) { + key.indexOf('Models') >= 0 && each$1(models, function (model) { + var coordSys = model.coordinateSystem; + if (coordSys && coordSys.containPoint) { + result |= !!coordSys.containPoint(value); + } + else if (key === 'seriesModels') { + var view = this._chartsMap[model.__viewId]; + if (view && view.containPoint) { + result |= view.containPoint(value, model); + } + else { + if (__DEV__) { + console.warn(key + ': ' + (view + ? 'The found component do not support containPoint.' + : 'No view mapping to the found component.' + )); + } + } + } + else { + if (__DEV__) { + console.warn(key + ': containPoint is not supported'); + } + } + }, this); + }, this); + + return !!result; +}; + +/** + * Get visual from series or data. + * @param {string|Object} finder + * If string, e.g., 'series', means {seriesIndex: 0}. + * If Object, could contain some of these properties below: + * { + * seriesIndex / seriesId / seriesName, + * dataIndex / dataIndexInside + * } + * If dataIndex is not specified, series visual will be fetched, + * but not data item visual. + * If all of seriesIndex, seriesId, seriesName are not specified, + * visual will be fetched from first series. + * @param {string} visualType 'color', 'symbol', 'symbolSize' + */ +echartsProto.getVisual = function (finder, visualType) { + var ecModel = this._model; + + finder = parseFinder(ecModel, finder, {defaultMainType: 'series'}); + + var seriesModel = finder.seriesModel; + + if (__DEV__) { + if (!seriesModel) { + console.warn('There is no specified seires model'); + } + } + + var data = seriesModel.getData(); + + var dataIndexInside = finder.hasOwnProperty('dataIndexInside') + ? finder.dataIndexInside + : finder.hasOwnProperty('dataIndex') + ? data.indexOfRawIndex(finder.dataIndex) + : null; + + return dataIndexInside != null + ? data.getItemVisual(dataIndexInside, visualType) + : data.getVisual(visualType); +}; + +/** + * Get view of corresponding component model + * @param {module:echarts/model/Component} componentModel + * @return {module:echarts/view/Component} + */ +echartsProto.getViewOfComponentModel = function (componentModel) { + return this._componentsMap[componentModel.__viewId]; +}; + +/** + * Get view of corresponding series model + * @param {module:echarts/model/Series} seriesModel + * @return {module:echarts/view/Chart} + */ +echartsProto.getViewOfSeriesModel = function (seriesModel) { + return this._chartsMap[seriesModel.__viewId]; +}; + +var updateMethods = { + + prepareAndUpdate: function (payload) { + prepare(this); + updateMethods.update.call(this, payload); + }, + + /** + * @param {Object} payload + * @private + */ + update: function (payload) { + // console.profile && console.profile('update'); + + var ecModel = this._model; + var api = this._api; + var zr = this._zr; + var coordSysMgr = this._coordSysMgr; + var scheduler = this._scheduler; + + // update before setOption + if (!ecModel) { + return; + } + + scheduler.restoreData(ecModel, payload); + + scheduler.performSeriesTasks(ecModel); + + // 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(ecModel, api); + + scheduler.performDataProcessorTasks(ecModel, payload); + + // Current stream render is not supported in data process. So we can update + // stream modes after data processing, where the filtered data is used to + // deteming whether use progressive rendering. + updateStreamModes(this, ecModel); + + // We update stream modes before coordinate system updated, then the modes info + // can be fetched when coord sys updating (consider the barGrid extent fix). But + // the drawback is the full coord info can not be fetched. Fortunately this full + // coord is not requied in stream mode updater currently. + coordSysMgr.update(ecModel, api); + + clearColorPalette(ecModel); + scheduler.performVisualTasks(ecModel, payload); + + render(this, ecModel, api, payload); + + // Set background + var backgroundColor = ecModel.get('backgroundColor') || 'transparent'; + + // In IE8 + if (!env$1.canvasSupported) { + var colorArr = parse(backgroundColor); + backgroundColor = stringify(colorArr, 'rgb'); + if (colorArr[3] === 0) { + backgroundColor = 'transparent'; + } + } + else { + zr.setBackgroundColor(backgroundColor); + } + + performPostUpdateFuncs(ecModel, api); + + // console.profile && console.profileEnd('update'); + }, + + /** + * @param {Object} payload + * @private + */ + updateTransform: function (payload) { + var ecModel = this._model; + var ecIns = this; + var api = this._api; + + // update before setOption + if (!ecModel) { + return; + } + + // ChartView.markUpdateMethod(payload, 'updateTransform'); + + var componentDirtyList = []; + ecModel.eachComponent(function (componentType, componentModel) { + var componentView = ecIns.getViewOfComponentModel(componentModel); + if (componentView && componentView.__alive) { + if (componentView.updateTransform) { + var result = componentView.updateTransform(componentModel, ecModel, api, payload); + result && result.update && componentDirtyList.push(componentView); + } + else { + componentDirtyList.push(componentView); + } + } + }); + + var seriesDirtyMap = createHashMap(); + ecModel.eachSeries(function (seriesModel) { + var chartView = ecIns._chartsMap[seriesModel.__viewId]; + if (chartView.updateTransform) { + var result = chartView.updateTransform(seriesModel, ecModel, api, payload); + result && result.update && seriesDirtyMap.set(seriesModel.uid, 1); + } + else { + seriesDirtyMap.set(seriesModel.uid, 1); + } + }); + + clearColorPalette(ecModel); + // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. + // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true); + this._scheduler.performVisualTasks( + ecModel, payload, {setDirty: true, dirtyMap: seriesDirtyMap} + ); + + // Currently, not call render of components. Geo render cost a lot. + // renderComponents(ecIns, ecModel, api, payload, componentDirtyList); + renderSeries(ecIns, ecModel, api, payload, seriesDirtyMap); + + performPostUpdateFuncs(ecModel, this._api); + }, + + /** + * @param {Object} payload + * @private + */ + updateView: function (payload) { + var ecModel = this._model; + + // update before setOption + if (!ecModel) { + return; + } + + Chart.markUpdateMethod(payload, 'updateView'); + + clearColorPalette(ecModel); + + // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. + this._scheduler.performVisualTasks(ecModel, payload, {setDirty: true}); + + render(this, this._model, this._api, payload); + + performPostUpdateFuncs(ecModel, this._api); + }, + + /** + * @param {Object} payload + * @private + */ + updateVisual: function (payload) { + updateMethods.update.call(this, payload); + + // var ecModel = this._model; + + // // update before setOption + // if (!ecModel) { + // return; + // } + + // ChartView.markUpdateMethod(payload, 'updateVisual'); + + // clearColorPalette(ecModel); + + // // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. + // this._scheduler.performVisualTasks(ecModel, payload, {visualType: 'visual', setDirty: true}); + + // render(this, this._model, this._api, payload); + + // performPostUpdateFuncs(ecModel, this._api); + }, + + /** + * @param {Object} payload + * @private + */ + updateLayout: function (payload) { + updateMethods.update.call(this, payload); + + // var ecModel = this._model; + + // // update before setOption + // if (!ecModel) { + // return; + // } + + // ChartView.markUpdateMethod(payload, 'updateLayout'); + + // // Keep pipe to the exist pipeline because it depends on the render task of the full pipeline. + // // this._scheduler.performVisualTasks(ecModel, payload, 'layout', true); + // this._scheduler.performVisualTasks(ecModel, payload, {setDirty: true}); + + // render(this, this._model, this._api, payload); + + // performPostUpdateFuncs(ecModel, this._api); + } +}; + +function prepare(ecIns) { + var ecModel = ecIns._model; + var scheduler = ecIns._scheduler; + + scheduler.restorePipelines(ecModel); + + scheduler.prepareStageTasks(); + + prepareView(ecIns, 'component', ecModel, scheduler); + + prepareView(ecIns, 'chart', ecModel, scheduler); + + scheduler.plan(); +} + +/** + * @private + */ +function updateDirectly(ecIns, method, payload, mainType, subType) { + var ecModel = ecIns._model; + + // broadcast + if (!mainType) { + // FIXME + // Chart will not be update directly here, except set dirty. + // But there is no such scenario now. + each(ecIns._componentsViews.concat(ecIns._chartsViews), callView); + return; + } + + var query = {}; + query[mainType + 'Id'] = payload[mainType + 'Id']; + query[mainType + 'Index'] = payload[mainType + 'Index']; + query[mainType + 'Name'] = payload[mainType + 'Name']; + + var condition = {mainType: mainType, query: query}; + subType && (condition.subType = subType); // subType may be '' by parseClassType; + + var excludeSeriesId = payload.excludeSeriesId; + if (excludeSeriesId != null) { + excludeSeriesId = createHashMap(normalizeToArray(excludeSeriesId)); + } + + // If dispatchAction before setOption, do nothing. + ecModel && ecModel.eachComponent(condition, function (model) { + if (!excludeSeriesId || excludeSeriesId.get(model.id) == null) { + callView(ecIns[ + mainType === 'series' ? '_chartsMap' : '_componentsMap' + ][model.__viewId]); + } + }, ecIns); + + function callView(view) { + view && view.__alive && view[method] && view[method]( + view.__model, ecModel, ecIns._api, payload + ); + } +} + +/** + * Resize the chart + * @param {Object} opts + * @param {number} [opts.width] Can be 'auto' (the same as null/undefined) + * @param {number} [opts.height] Can be 'auto' (the same as null/undefined) + * @param {boolean} [opts.silent=false] + */ +echartsProto.resize = function (opts) { + if (__DEV__) { + assert(!this[IN_MAIN_PROCESS], '`resize` should not be called during main process.'); + } + + this._zr.resize(opts); + + var ecModel = this._model; + + // Resize loading effect + this._loadingFX && this._loadingFX.resize(); + + if (!ecModel) { + return; + } + + var optionChanged = ecModel.resetOption('media'); + + var silent = opts && opts.silent; + + this[IN_MAIN_PROCESS] = true; + + optionChanged && prepare(this); + updateMethods.update.call(this); + + this[IN_MAIN_PROCESS] = false; + + flushPendingActions.call(this, silent); + + triggerUpdatedEvent.call(this, silent); +}; + +function updateStreamModes(ecIns, ecModel) { + var chartsMap = ecIns._chartsMap; + var scheduler = ecIns._scheduler; + ecModel.eachSeries(function (seriesModel) { + scheduler.updateStreamModes(seriesModel, chartsMap[seriesModel.__viewId]); + }); +} + +/** + * Show loading effect + * @param {string} [name='default'] + * @param {Object} [cfg] + */ +echartsProto.showLoading = function (name, cfg) { + if (isObject(name)) { + cfg = name; + name = ''; + } + name = name || 'default'; + + this.hideLoading(); + if (!loadingEffects[name]) { + if (__DEV__) { + console.warn('Loading effects ' + name + ' not exists.'); + } + return; + } + var el = loadingEffects[name](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 = extend({}, eventObj); + payload.type = eventActionMap[eventObj.type]; + return payload; +}; + +/** + * @pubilc + * @param {Object} payload + * @param {string} [payload.type] Action type + * @param {Object|boolean} [opt] If pass boolean, means opt.silent + * @param {boolean} [opt.silent=false] Whether trigger events. + * @param {boolean} [opt.flush=undefined] + * true: Flush immediately, and then pixel in canvas can be fetched + * immediately. Caution: it might affect performance. + * false: Not not flush. + * undefined: Auto decide whether perform flush. + */ +echartsProto.dispatchAction = function (payload, opt) { + if (!isObject(opt)) { + opt = {silent: !!opt}; + } + + if (!actions[payload.type]) { + return; + } + + // Avoid dispatch action before setOption. Especially in `connect`. + if (!this._model) { + return; + } + + // May dispatchAction in rendering procedure + if (this[IN_MAIN_PROCESS]) { + this._pendingActions.push(payload); + return; + } + + doDispatchAction.call(this, payload, opt.silent); + + if (opt.flush) { + this._zr.flush(true); + } + else if (opt.flush !== false && env$1.browser.weChat) { + // In WeChat embeded browser, `requestAnimationFrame` and `setInterval` + // hang when sliding page (on touch event), which cause that zr does not + // refresh util user interaction finished, which is not expected. + // But `dispatchAction` may be called too frequently when pan on touch + // screen, which impacts performance if do not throttle them. + this._throttledZrFlush(); + } + + flushPendingActions.call(this, opt.silent); + + triggerUpdatedEvent.call(this, opt.silent); +}; + +function doDispatchAction(payload, silent) { + var payloadType = payload.type; + var escapeConnect = payload.escapeConnect; + var actionWrap = actions[payloadType]; + var actionInfo = actionWrap.actionInfo; + + var cptType = (actionInfo.update || 'update').split(':'); + var updateMethod = cptType.pop(); + cptType = cptType[0] != null && parseClassType(cptType[0]); + + this[IN_MAIN_PROCESS] = true; + + var payloads = [payload]; + var batched = false; + // Batch action + if (payload.batch) { + batched = true; + payloads = map(payload.batch, function (item) { + item = defaults(extend({}, item), payload); + item.batch = null; + return item; + }); + } + + var eventObjBatch = []; + var eventObj; + var isHighDown = payloadType === 'highlight' || payloadType === 'downplay'; + + each(payloads, function (batchItem) { + // Action can specify the event by return it. + eventObj = actionWrap.action(batchItem, this._model, this._api); + // Emit event outside + eventObj = eventObj || extend({}, batchItem); + // Convert type to eventType + eventObj.type = actionInfo.event || eventObj.type; + eventObjBatch.push(eventObj); + + // light update does not perform data process, layout and visual. + if (isHighDown) { + // method, payload, mainType, subType + updateDirectly(this, updateMethod, batchItem, 'series'); + } + else if (cptType) { + updateDirectly(this, updateMethod, batchItem, cptType.main, cptType.sub); + } + }, this); + + if (updateMethod !== 'none' && !isHighDown && !cptType) { + // Still dirty + if (this[OPTION_UPDATED]) { + // FIXME Pass payload ? + prepare(this); + updateMethods.update.call(this, payload); + this[OPTION_UPDATED] = false; + } + else { + updateMethods[updateMethod].call(this, payload); + } + } + + // Follow the rule of action batch + if (batched) { + eventObj = { + type: actionInfo.event || payloadType, + escapeConnect: escapeConnect, + batch: eventObjBatch + }; + } + else { + eventObj = eventObjBatch[0]; + } + + this[IN_MAIN_PROCESS] = false; + + !silent && this._messageCenter.trigger(eventObj.type, eventObj); +} + +function flushPendingActions(silent) { + var pendingActions = this._pendingActions; + while (pendingActions.length) { + var payload = pendingActions.shift(); + doDispatchAction.call(this, payload, silent); + } +} + +function triggerUpdatedEvent(silent) { + !silent && this.trigger('updated'); +} + +/** + * Event `rendered` is triggered when zr + * rendered. It is useful for realtime + * snapshot (reflect animation). + * + * Event `finished` is triggered when: + * (1) zrender rendering finished. + * (2) initial animation finished. + * (3) progressive rendering finished. + * (4) no pending action. + * (5) no delayed setOption needs to be processed. + */ +function bindRenderedEvent(zr, ecIns) { + zr.on('rendered', function () { + + ecIns.trigger('rendered'); + + // The `finished` event should not be triggered repeatly, + // so it should only be triggered when rendering indeed happend + // in zrender. (Consider the case that dipatchAction is keep + // triggering when mouse move). + if ( + // Although zr is dirty if initial animation is not finished + // and this checking is called on frame, we also check + // animation finished for robustness. + zr.animation.isFinished() + && !ecIns[OPTION_UPDATED] + && !ecIns._scheduler.unfinished + && !ecIns._pendingActions.length + ) { + ecIns.trigger('finished'); + } + }); +} + +/** + * @param {Object} params + * @param {number} params.seriesIndex + * @param {Array|TypedArray} params.data + */ +echartsProto.appendData = function (params) { + var seriesIndex = params.seriesIndex; + var ecModel = this.getModel(); + var seriesModel = ecModel.getSeriesByIndex(seriesIndex); + + if (__DEV__) { + assert(params.data && seriesModel); + } + + seriesModel.appendData(params); + + // Note: `appendData` does not support that update extent of coordinate + // system, util some scenario require that. In the expected usage of + // `appendData`, the initial extent of coordinate system should better + // be fixed by axis `min`/`max` setting or initial data, otherwise if + // the extent changed while `appendData`, the location of the painted + // graphic elements have to be changed, which make the usage of + // `appendData` meaningless. + + this._scheduler.unfinished = true; +}; + +/** + * Register event + * @method + */ +echartsProto.on = createRegisterEventWithLowercaseName('on'); +echartsProto.off = createRegisterEventWithLowercaseName('off'); +echartsProto.one = createRegisterEventWithLowercaseName('one'); + +/** + * Prepare view instances of charts and components + * @param {module:echarts/model/Global} ecModel + * @private + */ +function prepareView(ecIns, type, ecModel, scheduler) { + var isComponent = type === 'component'; + var viewList = isComponent ? ecIns._componentsViews : ecIns._chartsViews; + var viewMap = isComponent ? ecIns._componentsMap : ecIns._chartsMap; + var zr = ecIns._zr; + var api = ecIns._api; + + for (var i = 0; i < viewList.length; i++) { + viewList[i].__alive = false; + } + + isComponent + ? ecModel.eachComponent(function (componentType, model) { + componentType !== 'series' && doPrepare(model); + }) + : ecModel.eachSeries(doPrepare); + + function doPrepare(model) { + // Consider: id same and type changed. + var viewId = '_ec_' + model.id + '_' + model.type; + var view = viewMap[viewId]; + if (!view) { + var classType = parseClassType(model.type); + var Clazz = isComponent + ? Component.getClass(classType.main, classType.sub) + : Chart.getClass(classType.sub); + + if (__DEV__) { + assert(Clazz, classType.sub + ' does not exist.'); + } + + view = new Clazz(); + view.init(ecModel, api); + viewMap[viewId] = view; + viewList.push(view); + zr.add(view.group); + } + + model.__viewId = view.__id = viewId; + view.__alive = true; + view.__model = model; + view.group.__ecComponentInfo = { + mainType: model.mainType, + index: model.componentIndex + }; + !isComponent && scheduler.prepareView(view, model, ecModel, api); + } + + for (var i = 0; i < viewList.length;) { + var view = viewList[i]; + if (!view.__alive) { + !isComponent && view.renderTask.dispose(); + zr.remove(view.group); + view.dispose(ecModel, api); + viewList.splice(i, 1); + delete viewMap[view.__id]; + view.__id = view.group.__ecComponentInfo = null; + } + else { + i++; + } + } +} + +// /** +// * Encode visual infomation from data after data processing +// * +// * @param {module:echarts/model/Global} ecModel +// * @param {object} layout +// * @param {boolean} [layoutFilter] `true`: only layout, +// * `false`: only not layout, +// * `null`/`undefined`: all. +// * @param {string} taskBaseTag +// * @private +// */ +// function startVisualEncoding(ecIns, ecModel, api, payload, layoutFilter) { +// each(visualFuncs, function (visual, index) { +// var isLayout = visual.isLayout; +// if (layoutFilter == null +// || (layoutFilter === false && !isLayout) +// || (layoutFilter === true && isLayout) +// ) { +// visual.func(ecModel, api, payload); +// } +// }); +// } + +function clearColorPalette(ecModel) { + ecModel.clearColorPalette(); + ecModel.eachSeries(function (seriesModel) { + seriesModel.clearColorPalette(); + }); +} + +function render(ecIns, ecModel, api, payload) { + + renderComponents(ecIns, ecModel, api, payload); + + each(ecIns._chartsViews, function (chart) { + chart.__alive = false; + }); + + renderSeries(ecIns, ecModel, api, payload); + + // Remove groups of unrendered charts + each(ecIns._chartsViews, function (chart) { + if (!chart.__alive) { + chart.remove(ecModel, api); + } + }); +} + +function renderComponents(ecIns, ecModel, api, payload, dirtyList) { + each(dirtyList || ecIns._componentsViews, function (componentView) { + var componentModel = componentView.__model; + componentView.render(componentModel, ecModel, api, payload); + + updateZ(componentModel, componentView); + }); +} + +/** + * Render each chart and component + * @private + */ +function renderSeries(ecIns, ecModel, api, payload, dirtyMap) { + // Render all charts + var scheduler = ecIns._scheduler; + var unfinished; + ecModel.eachSeries(function (seriesModel) { + var chartView = ecIns._chartsMap[seriesModel.__viewId]; + chartView.__alive = true; + + var renderTask = chartView.renderTask; + scheduler.updatePayload(renderTask, payload); + + if (dirtyMap && dirtyMap.get(seriesModel.uid)) { + renderTask.dirty(); + } + + unfinished |= renderTask.perform(scheduler.getPerformArgs(renderTask)); + + chartView.group.silent = !!seriesModel.get('silent'); + + updateZ(seriesModel, chartView); + + updateBlend(seriesModel, chartView); + }); + scheduler.unfinished |= unfinished; + + // If use hover layer + updateHoverLayerStatus(ecIns._zr, ecModel); + + // Add aria + aria(ecIns._zr.dom, ecModel); +} + +function performPostUpdateFuncs(ecModel, api) { + each(postUpdateFuncs, function (func) { + func(ecModel, api); + }); +} + + +var MOUSE_EVENT_NAMES = [ + 'click', 'dblclick', 'mouseover', 'mouseout', 'mousemove', + 'mousedown', 'mouseup', 'globalout', 'contextmenu' +]; + +/** + * @private + */ +echartsProto._initEvents = function () { + each(MOUSE_EVENT_NAMES, function (eveName) { + this._zr.on(eveName, function (e) { + var ecModel = this.getModel(); + var el = e.target; + var params; + var isGlobalOut = eveName === 'globalout'; + + // no e.target when 'globalout'. + if (isGlobalOut) { + params = {}; + } + else if (el && el.dataIndex != null) { + var dataModel = el.dataModel || ecModel.getSeriesByIndex(el.seriesIndex); + params = dataModel && dataModel.getDataParams(el.dataIndex, el.dataType) || {}; + } + // If element has custom eventData of components + else if (el && el.eventData) { + params = extend({}, el.eventData); + } + + if (params) { + var componentType = params.componentType; + var componentIndex = params[componentType + 'Index']; + var model = componentType && componentIndex != null + && ecModel.getComponent(componentType, componentIndex); + var view = model && this[ + model.mainType === 'series' ? '_chartsMap' : '_componentsMap' + ][model.__viewId]; + + if (__DEV__) { + // `event.componentType` and `event[componentTpype + 'Index']` must not + // be missed, otherwise there is no way to distinguish source component. + // See `dataFormat.getDataParams`. + assert$1(isGlobalOut || (model && view)); + } + + params.event = e; + params.type = eveName; + + var ecEventProcessor = this._ecEventProcessor; + ecEventProcessor.targetEl = el; + ecEventProcessor.packedEvent = params; + ecEventProcessor.model = model; + ecEventProcessor.view = view; + + 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({ series: [] }, true); +}; + +/** + * Dispose instance + */ +echartsProto.dispose = function () { + if (this._disposed) { + if (__DEV__) { + console.warn('Instance ' + this.id + ' has been disposed'); + } + return; + } + this._disposed = true; + + setAttribute(this.getDom(), DOM_ATTRIBUTE_KEY, ''); + + 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); + }); + + // Dispose after all views disposed + this._zr.dispose(); + + delete instances[this.id]; +}; + +mixin(ECharts, Eventful); + +function updateHoverLayerStatus(zr, ecModel) { + var storage = zr.storage; + var elCount = 0; + storage.traverse(function (el) { + if (!el.isGroup) { + elCount++; + } + }); + if (elCount > ecModel.get('hoverLayerThreshold') && !env$1.node) { + storage.traverse(function (el) { + if (!el.isGroup) { + // Don't switch back. + el.useHoverLayer = true; + } + }); + } +} + +/** + * Update chart progressive and blend. + * @param {module:echarts/model/Series|module:echarts/model/Component} model + * @param {module:echarts/view/Component|module:echarts/view/Chart} view + */ +function updateBlend(seriesModel, chartView) { + var blendMode = seriesModel.get('blendMode') || null; + if (__DEV__) { + if (!env$1.canvasSupported && blendMode && blendMode !== 'source-over') { + console.warn('Only canvas support blendMode'); + } + } + chartView.group.traverse(function (el) { + // FIXME marker and other components + if (!el.isGroup) { + // Only set if blendMode is changed. In case element is incremental and don't wan't to rerender. + if (el.style.blend !== blendMode) { + el.setStyle('blend', blendMode); + } + } + if (el.eachPendingDisplayable) { + el.eachPendingDisplayable(function (displayable) { + displayable.setStyle('blend', blendMode); + }); + } + }); +} + +/** + * @param {module:echarts/model/Series|module:echarts/model/Component} model + * @param {module:echarts/view/Component|module:echarts/view/Chart} view + */ +function updateZ(model, view) { + var z = model.get('z'); + var zlevel = model.get('zlevel'); + // Set z and zlevel + view.group.traverse(function (el) { + if (el.type !== 'group') { + z != null && (el.z = z); + zlevel != null && (el.zlevel = zlevel); + } + }); +} + +function createExtensionAPI(ecInstance) { + var coordSysMgr = ecInstance._coordSysMgr; + return extend(new ExtensionAPI(ecInstance), { + // Inject methods + getCoordinateSystems: bind( + coordSysMgr.getCoordinateSystems, coordSysMgr + ), + getComponentByElement: function (el) { + while (el) { + var modelInfo = el.__ecComponentInfo; + if (modelInfo != null) { + return ecInstance._model.getComponent(modelInfo.mainType, modelInfo.index); + } + el = el.parent; + } + } + }); +} + +/** + * Usage of query: + * `chart.on('click', query, handler);` + * The `query` can be: + * + The component type query string, only `mainType` or `mainType.subType`, + * like: 'xAxis', 'series', 'xAxis.category' or 'series.line'. + * + The component query object, like: + * `{seriesIndex: 2}`, `{seriesName: 'xx'}`, `{seriesId: 'some'}`, + * `{xAxisIndex: 2}`, `{xAxisName: 'xx'}`, `{xAxisId: 'some'}`. + * + The element query object, like: + * `{targetName: 'some'}` (only available in custom series). + * + * Caveat: If a prop in the `query` object is `null/undefined`, it is the + * same as there is no such prop in the `query` object. + */ +function makeEventProcessor(ecIns) { + return { + + normalizeQuery: function (query) { + var cptQuery = {}; + var dataQuery = {}; + var otherQuery = {}; + + // `query` is `mainType` or `mainType.subType` of component. + if (isString(query)) { + var condCptType = parseClassType(query); + // `.main` and `.sub` may be ''. + cptQuery.mainType = condCptType.main || null; + cptQuery.subType = condCptType.sub || null; + } + // `query` is an object, convert to {mainType, index, name, id}. + else { + // `xxxIndex`, `xxxName`, `xxxId`, `name`, `dataIndex`, `dataType` is reserved, + // can not be used in `compomentModel.filterForExposedEvent`. + var suffixes = ['Index', 'Name', 'Id']; + var dataKeys = {name: 1, dataIndex: 1, dataType: 1}; + each$1(query, function (val, key) { + var reserved; + for (var i = 0; i < suffixes.length; i++) { + var propSuffix = suffixes[i]; + var suffixPos = key.lastIndexOf(propSuffix); + if (suffixPos > 0 && suffixPos === key.length - propSuffix.length) { + var mainType = key.slice(0, suffixPos); + // Consider `dataIndex`. + if (mainType !== 'data') { + cptQuery.mainType = mainType; + cptQuery[propSuffix.toLowerCase()] = val; + reserved = true; + } + } + } + if (dataKeys.hasOwnProperty(key)) { + dataQuery[key] = val; + reserved = true; + } + if (!reserved) { + otherQuery[key] = val; + } + }); + } + + return { + cptQuery: cptQuery, + dataQuery: dataQuery, + otherQuery: otherQuery + }; + }, + + filter: function (eventType, query, args) { + // They should be assigned before each trigger call. + var targetEl = this.targetEl; + var packedEvent = this.packedEvent; + var model = this.model; + var view = this.view; + + // For event like 'globalout'. + if (!model || !view) { + return true; + } + + var cptQuery = query.cptQuery; + var dataQuery = query.dataQuery; + + return check(cptQuery, model, 'mainType') + && check(cptQuery, model, 'subType') + && check(cptQuery, model, 'index', 'componentIndex') + && check(cptQuery, model, 'name') + && check(cptQuery, model, 'id') + && check(dataQuery, packedEvent, 'name') + && check(dataQuery, packedEvent, 'dataIndex') + && check(dataQuery, packedEvent, 'dataType') + && (!view.filterForExposedEvent || view.filterForExposedEvent( + eventType, query.otherQuery, targetEl, packedEvent + )); + } + }; + + function check(query, host, prop, propOnHost) { + return query[prop] == null || host[propOnHost || prop] === query[prop]; + } +} + +/** + * @type {Object} key: actionType. + * @inner + */ +var actions = {}; + +/** + * Map eventType to actionType + * @type {Object} + */ +var eventActionMap = {}; + +/** + * Data processor functions of each stage + * @type {Array.>} + * @inner + */ +var dataProcessorFuncs = []; + +/** + * @type {Array.} + * @inner + */ +var optionPreprocessorFuncs = []; + +/** + * @type {Array.} + * @inner + */ +var postUpdateFuncs = []; + +/** + * Visual encoding functions of each stage + * @type {Array.>} + */ +var visualFuncs = []; + +/** + * Theme storage + * @type {Object.} + */ +var themeStorage = {}; +/** + * Loading effects + */ +var loadingEffects = {}; + +var instances = {}; +var connectedGroups = {}; + +var idBase = new Date() - 0; +var groupIdBase = new Date() - 0; +var DOM_ATTRIBUTE_KEY = '_echarts_instance_'; + +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; + } + } + + each(eventActionMap, function (actionType, eventType) { + chart._messageCenter.on(eventType, function (event) { + if (connectedGroups[chart.group] && chart[STATUS_KEY] !== STATUS_PENDING) { + if (event && event.escapeConnect) { + return; + } + + var action = chart.makeActionFromEvent(event); + var otherCharts = []; + + each(instances, function (otherChart) { + 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 {HTMLElement} dom + * @param {Object} [theme] + * @param {Object} opts + * @param {number} [opts.devicePixelRatio] Use window.devicePixelRatio by default + * @param {string} [opts.renderer] Currently only 'canvas' is supported. + * @param {number} [opts.width] Use clientWidth of the input `dom` by default. + * Can be 'auto' (the same as null/undefined) + * @param {number} [opts.height] Use clientHeight of the input `dom` by default. + * Can be 'auto' (the same as null/undefined) + */ +function init(dom, theme$$1, opts) { + if (__DEV__) { + // Check version + if ((version$1.replace('.', '') - 0) < (dependencies.zrender.replace('.', '') - 0)) { + throw new Error( + 'zrender/src ' + version$1 + + ' is too old for ECharts ' + version + + '. Current version need ZRender ' + + dependencies.zrender + '+' + ); + } + + if (!dom) { + throw new Error('Initialize failed: invalid dom.'); + } + } + + var existInstance = getInstanceByDom(dom); + if (existInstance) { + if (__DEV__) { + console.warn('There is a chart instance already initialized on the dom.'); + } + return existInstance; + } + + if (__DEV__) { + if (isDom(dom) + && dom.nodeName.toUpperCase() !== 'CANVAS' + && ( + (!dom.clientWidth && (!opts || opts.width == null)) + || (!dom.clientHeight && (!opts || opts.height == null)) + ) + ) { + console.warn('Can\'t get dom width or height'); + } + } + + var chart = new ECharts(dom, theme$$1, opts); + chart.id = 'ec_' + idBase++; + instances[chart.id] = chart; + + setAttribute(dom, DOM_ATTRIBUTE_KEY, chart.id); + + enableConnect(chart); + + return chart; +} + +/** + * @return {string|Array.} groupId + */ +function connect(groupId) { + // Is array of charts + if (isArray(groupId)) { + var charts = groupId; + groupId = null; + // If any chart has group + each(charts, function (chart) { + if (chart.group != null) { + groupId = chart.group; + } + }); + groupId = groupId || ('g_' + groupIdBase++); + each(charts, function (chart) { + chart.group = groupId; + }); + } + connectedGroups[groupId] = true; + return groupId; +} + +/** + * @DEPRECATED + * @return {string} groupId + */ +function disConnect(groupId) { + connectedGroups[groupId] = false; +} + +/** + * @return {string} groupId + */ +var disconnect = disConnect; + +/** + * Dispose a chart instance + * @param {module:echarts~ECharts|HTMLDomElement|string} chart + */ +function dispose(chart) { + if (typeof chart === 'string') { + chart = instances[chart]; + } + else if (!(chart instanceof ECharts)){ + // Try to treat as dom + chart = getInstanceByDom(chart); + } + if ((chart instanceof ECharts) && !chart.isDisposed()) { + chart.dispose(); + } +} + +/** + * @param {HTMLElement} dom + * @return {echarts~ECharts} + */ +function getInstanceByDom(dom) { + return instances[getAttribute(dom, DOM_ATTRIBUTE_KEY)]; +} + +/** + * @param {string} key + * @return {echarts~ECharts} + */ +function getInstanceById(key) { + return instances[key]; +} + +/** + * Register theme + */ +function registerTheme(name, theme$$1) { + themeStorage[name] = theme$$1; +} + +/** + * Register option preprocessor + * @param {Function} preprocessorFunc + */ +function registerPreprocessor(preprocessorFunc) { + optionPreprocessorFuncs.push(preprocessorFunc); +} + +/** + * @param {number} [priority=1000] + * @param {Object|Function} processor + */ +function registerProcessor(priority, processor) { + normalizeRegister(dataProcessorFuncs, priority, processor, PRIORITY_PROCESSOR_FILTER); +} + +/** + * Register postUpdater + * @param {Function} postUpdateFunc + */ +function registerPostUpdate(postUpdateFunc) { + postUpdateFuncs.push(postUpdateFunc); +} + +/** + * 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 + */ +function registerAction(actionInfo, eventName, action) { + if (typeof eventName === 'function') { + action = eventName; + eventName = ''; + } + var actionType = isObject(actionInfo) + ? actionInfo.type + : ([actionInfo, actionInfo = { + event: eventName + }][0]); + + // Event name is all lowercase + actionInfo.event = (actionInfo.event || actionType).toLowerCase(); + eventName = actionInfo.event; + + // Validate action type and event name. + assert(ACTION_REG.test(actionType) && ACTION_REG.test(eventName)); + + if (!actions[actionType]) { + actions[actionType] = {action: action, actionInfo: actionInfo}; + } + eventActionMap[eventName] = actionType; +} + +/** + * @param {string} type + * @param {*} CoordinateSystem + */ +function registerCoordinateSystem(type, CoordinateSystem$$1) { + CoordinateSystemManager.register(type, CoordinateSystem$$1); +} + +/** + * Get dimensions of specified coordinate system. + * @param {string} type + * @return {Array.} + */ +function getCoordinateSystemDimensions(type) { + var coordSysCreator = CoordinateSystemManager.get(type); + if (coordSysCreator) { + return coordSysCreator.getDimensionsInfo + ? coordSysCreator.getDimensionsInfo() + : coordSysCreator.dimensions.slice(); + } +} + +/** + * Layout is a special stage of visual encoding + * Most visual encoding like color are common for different chart + * But each chart has it's own layout algorithm + * + * @param {number} [priority=1000] + * @param {Function} layoutTask + */ +function registerLayout(priority, layoutTask) { + normalizeRegister(visualFuncs, priority, layoutTask, PRIORITY_VISUAL_LAYOUT, 'layout'); +} + +/** + * @param {number} [priority=3000] + * @param {module:echarts/stream/Task} visualTask + */ +function registerVisual(priority, visualTask) { + normalizeRegister(visualFuncs, priority, visualTask, PRIORITY_VISUAL_CHART, 'visual'); +} + +/** + * @param {Object|Function} fn: {seriesType, createOnAllSeries, performRawSeries, reset} + */ +function normalizeRegister(targetList, priority, fn, defaultPriority, visualType) { + if (isFunction(priority) || isObject(priority)) { + fn = priority; + priority = defaultPriority; + } + + if (__DEV__) { + if (isNaN(priority) || priority == null) { + throw new Error('Illegal priority'); + } + // Check duplicate + each(targetList, function (wrap) { + assert(wrap.__raw !== fn); + }); + } + + var stageHandler = Scheduler.wrapStageHandler(fn, visualType); + + stageHandler.__prio = priority; + stageHandler.__raw = fn; + targetList.push(stageHandler); + + return stageHandler; +} + +/** + * @param {string} name + */ +function registerLoading(name, loadingFx) { + loadingEffects[name] = loadingFx; +} + +/** + * @param {Object} opts + * @param {string} [superClass] + */ +function extendComponentModel(opts/*, superClass*/) { + // var Clazz = ComponentModel; + // if (superClass) { + // var classType = parseClassType(superClass); + // Clazz = ComponentModel.getClass(classType.main, classType.sub, true); + // } + return ComponentModel.extend(opts); +} + +/** + * @param {Object} opts + * @param {string} [superClass] + */ +function extendComponentView(opts/*, superClass*/) { + // var Clazz = ComponentView; + // if (superClass) { + // var classType = parseClassType(superClass); + // Clazz = ComponentView.getClass(classType.main, classType.sub, true); + // } + return Component.extend(opts); +} + +/** + * @param {Object} opts + * @param {string} [superClass] + */ +function extendSeriesModel(opts/*, superClass*/) { + // var Clazz = SeriesModel; + // if (superClass) { + // superClass = 'series.' + superClass.replace('series.', ''); + // var classType = parseClassType(superClass); + // Clazz = ComponentModel.getClass(classType.main, classType.sub, true); + // } + return SeriesModel.extend(opts); +} + +/** + * @param {Object} opts + * @param {string} [superClass] + */ +function extendChartView(opts/*, superClass*/) { + // var Clazz = ChartView; + // if (superClass) { + // superClass = superClass.replace('series.', ''); + // var classType = parseClassType(superClass); + // Clazz = ChartView.getClass(classType.main, true); + // } + return Chart.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); + * }); + */ +function setCanvasCreator(creator) { + $override('createCanvas', creator); +} + +/** + * @param {string} mapName + * @param {Array.|Object|string} geoJson + * @param {Object} [specialAreas] + * + * @example GeoJSON + * $.get('USA.json', function (geoJson) { + * echarts.registerMap('USA', geoJson); + * // Or + * echarts.registerMap('USA', { + * geoJson: geoJson, + * specialAreas: {} + * }) + * }); + * + * $.get('airport.svg', function (svg) { + * echarts.registerMap('airport', { + * svg: svg + * } + * }); + * + * echarts.registerMap('eu', [ + * {svg: eu-topographic.svg}, + * {geoJSON: eu.json} + * ]) + */ +function registerMap(mapName, geoJson, specialAreas) { + mapDataStorage.registerMap(mapName, geoJson, specialAreas); +} + +/** + * @param {string} mapName + * @return {Object} + */ +function getMap(mapName) { + // For backward compatibility, only return the first one. + var records = mapDataStorage.retrieveMap(mapName); + return records && records[0] && { + geoJson: records[0].geoJSON, + specialAreas: records[0].specialAreas + }; +} + +registerVisual(PRIORITY_VISUAL_GLOBAL, seriesColor); +registerPreprocessor(backwardCompat); +registerProcessor(PRIORITY_PROCESSOR_STATISTIC, dataStack); +registerLoading('default', loadingDefault); + +// Default actions + +registerAction({ + type: 'highlight', + event: 'highlight', + update: 'highlight' +}, noop); + +registerAction({ + type: 'downplay', + event: 'downplay', + update: 'downplay' +}, noop); + +// Default theme +registerTheme('light', lightTheme); +registerTheme('dark', theme); + +// For backward compatibility, where the namespace `dataTool` will +// be mounted on `echarts` is the extension `dataTool` is imported. +var dataTool = {}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 defaultKeyGetter(item) { + return item; +} + +/** + * @param {Array} oldArr + * @param {Array} newArr + * @param {Function} oldKeyGetter + * @param {Function} newKeyGetter + * @param {Object} [context] Can be visited by this.context in callback. + */ +function DataDiffer(oldArr, newArr, oldKeyGetter, newKeyGetter, context) { + this._old = oldArr; + this._new = newArr; + + this._oldKeyGetter = oldKeyGetter || defaultKeyGetter; + this._newKeyGetter = newKeyGetter || defaultKeyGetter; + + this.context = context; +} + +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 oldDataIndexMap = {}; + var newDataIndexMap = {}; + var oldDataKeyArr = []; + var newDataKeyArr = []; + var i; + + initIndexMap(oldArr, oldDataIndexMap, oldDataKeyArr, '_oldKeyGetter', this); + initIndexMap(newArr, newDataIndexMap, newDataKeyArr, '_newKeyGetter', this); + + // 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 = oldDataKeyArr[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 i = 0; i < newDataKeyArr.length; i++) { + var key = newDataKeyArr[i]; + 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 j = 0, len = idx.length; j < len; j++) { + this._add && this._add(idx[j]); + } + } + } + } + } +}; + +function initIndexMap(arr, map, keyArr, keyGetterName, dataDiffer) { + for (var i = 0; i < arr.length; i++) { + // Add prefix to avoid conflict with Object.prototype. + var key = '_ec_' + dataDiffer[keyGetterName](arr[i], i); + var existence = map[key]; + if (existence == null) { + keyArr.push(key); + map[key] = i; + } + else { + if (!existence.length) { + map[key] = existence = [existence]; + } + existence.push(i); + } + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 OTHER_DIMENSIONS = createHashMap([ + 'tooltip', 'label', 'itemName', 'itemId', 'seriesName' +]); + +function summarizeDimensions(data) { + var summary = {}; + var encode = summary.encode = {}; + var notExtraCoordDimMap = createHashMap(); + var defaultedLabel = []; + var defaultedTooltip = []; + + each$1(data.dimensions, function (dimName) { + var dimItem = data.getDimensionInfo(dimName); + + var coordDim = dimItem.coordDim; + if (coordDim) { + if (__DEV__) { + assert$1(OTHER_DIMENSIONS.get(coordDim) == null); + } + var coordDimArr = encode[coordDim]; + if (!encode.hasOwnProperty(coordDim)) { + coordDimArr = encode[coordDim] = []; + } + coordDimArr[dimItem.coordDimIndex] = dimName; + + if (!dimItem.isExtraCoord) { + notExtraCoordDimMap.set(coordDim, 1); + + // Use the last coord dim (and label friendly) as default label, + // because when dataset is used, it is hard to guess which dimension + // can be value dimension. If both show x, y on label is not look good, + // and conventionally y axis is focused more. + if (mayLabelDimType(dimItem.type)) { + defaultedLabel[0] = dimName; + } + } + if (dimItem.defaultTooltip) { + defaultedTooltip.push(dimName); + } + } + + OTHER_DIMENSIONS.each(function (v, otherDim) { + var otherDimArr = encode[otherDim]; + if (!encode.hasOwnProperty(otherDim)) { + otherDimArr = encode[otherDim] = []; + } + + var dimIndex = dimItem.otherDims[otherDim]; + if (dimIndex != null && dimIndex !== false) { + otherDimArr[dimIndex] = dimItem.name; + } + }); + }); + + var dataDimsOnCoord = []; + var encodeFirstDimNotExtra = {}; + + notExtraCoordDimMap.each(function (v, coordDim) { + var dimArr = encode[coordDim]; + // ??? FIXME extra coord should not be set in dataDimsOnCoord. + // But should fix the case that radar axes: simplify the logic + // of `completeDimension`, remove `extraPrefix`. + encodeFirstDimNotExtra[coordDim] = dimArr[0]; + // Not necessary to remove duplicate, because a data + // dim canot on more than one coordDim. + dataDimsOnCoord = dataDimsOnCoord.concat(dimArr); + }); + + summary.dataDimsOnCoord = dataDimsOnCoord; + summary.encodeFirstDimNotExtra = encodeFirstDimNotExtra; + + var encodeLabel = encode.label; + // FIXME `encode.label` is not recommanded, because formatter can not be set + // in this way. Use label.formatter instead. May be remove this approach someday. + if (encodeLabel && encodeLabel.length) { + defaultedLabel = encodeLabel.slice(); + } + + var encodeTooltip = encode.tooltip; + if (encodeTooltip && encodeTooltip.length) { + defaultedTooltip = encodeTooltip.slice(); + } + else if (!defaultedTooltip.length) { + defaultedTooltip = defaultedLabel.slice(); + } + + encode.defaultedLabel = defaultedLabel; + encode.defaultedTooltip = defaultedTooltip; + + return summary; +} + +function getDimensionTypeByAxis(axisType) { + return axisType === 'category' + ? 'ordinal' + : axisType === 'time' + ? 'time' + : 'float'; +} + +function mayLabelDimType(dimType) { + // In most cases, ordinal and time do not suitable for label. + // Ordinal info can be displayed on axis. Time is too long. + return !(dimType === 'ordinal' || dimType === 'time'); +} + +// function findTheLastDimMayLabel(data) { +// // Get last value dim +// var dimensions = data.dimensions.slice(); +// var valueType; +// var valueDim; +// while (dimensions.length && ( +// valueDim = dimensions.pop(), +// valueType = data.getDimensionInfo(valueDim).type, +// valueType === 'ordinal' || valueType === 'time' +// )) {} // jshint ignore:line +// return valueDim; +// } + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * List for data storage + * @module echarts/data/List + */ + +var isObject$4 = isObject$1; + +var UNDEFINED = 'undefined'; + +// Use prefix to avoid index to be the same as otherIdList[idx], +// which will cause weird udpate animation. +var ID_PREFIX = 'e\0\0'; + +var dataCtors = { + 'float': typeof Float64Array === UNDEFINED + ? Array : Float64Array, + 'int': typeof Int32Array === UNDEFINED + ? Array : Int32Array, + // Ordinal data type can be string or int + 'ordinal': Array, + 'number': Array, + 'time': Array +}; + +// Caution: MUST not use `new CtorUint32Array(arr, 0, len)`, because the Ctor of array is +// different from the Ctor of typed array. +var CtorUint32Array = typeof Uint32Array === UNDEFINED ? Array : Uint32Array; +var CtorUint16Array = typeof Uint16Array === UNDEFINED ? Array : Uint16Array; + +function getIndicesCtor(list) { + // The possible max value in this._indicies is always this._rawCount despite of filtering. + return list._rawCount > 65535 ? CtorUint32Array : CtorUint16Array; +} + +function cloneChunk(originalChunk) { + var Ctor = originalChunk.constructor; + // Only shallow clone is enough when Array. + return Ctor === Array ? originalChunk.slice() : new Ctor(originalChunk); +} + +var TRANSFERABLE_PROPERTIES = [ + 'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap', + '_rawData', '_chunkSize', '_chunkCount', '_dimValueGetter', + '_count', '_rawCount', '_nameDimIdx', '_idDimIdx' +]; +var CLONE_PROPERTIES = [ + '_extent', '_approximateExtent', '_rawExtent' +]; + +function transferProperties(target, source) { + each$1(TRANSFERABLE_PROPERTIES.concat(source.__wrappedMethods || []), function (propName) { + if (source.hasOwnProperty(propName)) { + target[propName] = source[propName]; + } + }); + + target.__wrappedMethods = source.__wrappedMethods; + + each$1(CLONE_PROPERTIES, function (propName) { + target[propName] = clone(source[propName]); + }); + + target._calculationInfo = extend(source._calculationInfo); +} + + + + + +/** + * @constructor + * @alias module:echarts/data/List + * + * @param {Array.} dimensions + * For example, ['someDimName', {name: 'someDimName', type: 'someDimType'}, ...]. + * Dimensions should be concrete names like x, y, z, lng, lat, angle, radius + * Spetial fields: { + * ordinalMeta: + * createInvertedIndices: + * } + * @param {module:echarts/model/Model} hostModel + */ +var List = function (dimensions, hostModel) { + + dimensions = dimensions || ['x', 'y']; + + var dimensionInfos = {}; + var dimensionNames = []; + var invertedIndicesMap = {}; + + for (var i = 0; i < dimensions.length; i++) { + // Use the original dimensions[i], where other flag props may exists. + var dimensionInfo = dimensions[i]; + + if (isString(dimensionInfo)) { + dimensionInfo = {name: dimensionInfo}; + } + + var dimensionName = dimensionInfo.name; + dimensionInfo.type = dimensionInfo.type || 'float'; + if (!dimensionInfo.coordDim) { + dimensionInfo.coordDim = dimensionName; + dimensionInfo.coordDimIndex = 0; + } + + dimensionInfo.otherDims = dimensionInfo.otherDims || {}; + dimensionNames.push(dimensionName); + dimensionInfos[dimensionName] = dimensionInfo; + + dimensionInfo.index = i; + + if (dimensionInfo.createInvertedIndices) { + invertedIndicesMap[dimensionName] = []; + } + } + + /** + * @readOnly + * @type {Array.} + */ + this.dimensions = dimensionNames; + + /** + * Infomation of each data dimension, like data type. + * @type {Object} + */ + this._dimensionInfos = dimensionInfos; + + /** + * @type {module:echarts/model/Model} + */ + this.hostModel = hostModel; + + /** + * @type {module:echarts/model/Model} + */ + this.dataType; + + /** + * Indices stores the indices of data subset after filtered. + * This data subset will be used in chart. + * @type {Array.} + * @readOnly + */ + this._indices = null; + + this._count = 0; + this._rawCount = 0; + + /** + * Data storage + * @type {Object.>} + * @private + */ + this._storage = {}; + + /** + * @type {Array.} + */ + this._nameList = []; + /** + * @type {Array.} + */ + this._idList = []; + + /** + * Models of data option is stored sparse for optimizing memory cost + * @type {Array.} + * @private + */ + this._optionModels = []; + + /** + * 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.} + * @private + */ + this._itemVisuals = []; + + /** + * Key: visual type, Value: boolean + * @type {Object} + * @readOnly + */ + this.hasItemVisual = {}; + + /** + * Item layout properties after layout + * @type {Array.} + * @private + */ + this._itemLayouts = []; + + /** + * Graphic elemnents + * @type {Array.} + * @private + */ + this._graphicEls = []; + + /** + * Max size of each chunk. + * @type {number} + * @private + */ + this._chunkSize = 1e5; + + /** + * @type {number} + * @private + */ + this._chunkCount = 0; + + /** + * @type {Array.} + * @private + */ + this._rawData; + + /** + * Raw extent will not be cloned, but only transfered. + * It will not be calculated util needed. + * key: dim, + * value: {end: number, extent: Array.} + * @type {Object} + * @private + */ + this._rawExtent = {}; + + /** + * @type {Object} + * @private + */ + this._extent = {}; + + /** + * key: dim + * value: extent + * @type {Object} + * @private + */ + this._approximateExtent = {}; + + /** + * Cache summary info for fast visit. See "dimensionHelper". + * @type {Object} + * @private + */ + this._dimensionsSummary = summarizeDimensions(this); + + /** + * @type {Object.} + * @private + */ + this._invertedIndicesMap = invertedIndicesMap; + + /** + * @type {Object} + * @private + */ + this._calculationInfo = {}; +}; + +var listProto = List.prototype; + +listProto.type = 'list'; + +/** + * If each data item has it's own option + * @type {boolean} + */ +listProto.hasItemOption = true; + +/** + * 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' + * @return {string} Concrete dim name. + */ +listProto.getDimension = function (dim) { + if (!isNaN(dim)) { + dim = this.dimensions[dim] || dim; + } + return dim; +}; + +/** + * Get type and calculation 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) { + // Do not clone, because there may be categories in dimInfo. + return this._dimensionInfos[this.getDimension(dim)]; +}; + +/** + * @return {Array.} concrete dimension name list on coord. + */ +listProto.getDimensionsOnCoord = function () { + return this._dimensionsSummary.dataDimsOnCoord.slice(); +}; + +/** + * @param {string} coordDim + * @param {number} [idx] A coordDim may map to more than one data dim. + * If idx is `true`, return a array of all mapped dims. + * If idx is not specified, return the first dim not extra. + * @return {string|Array.} concrete data dim. + * If idx is number, and not found, return null/undefined. + * If idx is `true`, and not found, return empty array (always return array). + */ +listProto.mapDimension = function (coordDim, idx) { + var dimensionsSummary = this._dimensionsSummary; + + if (idx == null) { + return dimensionsSummary.encodeFirstDimNotExtra[coordDim]; + } + + var dims = dimensionsSummary.encode[coordDim]; + return idx === true + // always return array if idx is `true` + ? (dims || []).slice() + : (dims && dims[idx]); +}; + +/** + * Initialize from data + * @param {Array.} data source or data or data provider. + * @param {Array.} [nameLIst] The name of a datum is used on data diff and + * defualt label/tooltip. + * A name can be specified in encode.itemName, + * or dataItem.name (only for series option data), + * or provided in nameList from outside. + * @param {Function} [dimValueGetter] (dataItem, dimName, dataIndex, dimIndex) => number + */ +listProto.initData = function (data, nameList, dimValueGetter) { + + var notProvider = Source.isInstance(data) || isArrayLike(data); + if (notProvider) { + data = new DefaultDataProvider(data, this.dimensions.length); + } + + if (__DEV__) { + if (!notProvider && (typeof data.getItem != 'function' || typeof data.count != 'function')) { + throw new Error('Inavlid data provider.'); + } + } + + this._rawData = data; + + // Clear + this._storage = {}; + this._indices = null; + + this._nameList = nameList || []; + + this._idList = []; + + this._nameRepeatCount = {}; + + if (!dimValueGetter) { + this.hasItemOption = false; + } + + /** + * @readOnly + */ + this.defaultDimValueGetter = defaultDimValueGetters[ + this._rawData.getSource().sourceFormat + ]; + + // Default dim value getter + this._dimValueGetter = dimValueGetter = dimValueGetter + || this.defaultDimValueGetter; + + // Reset raw extent. + this._rawExtent = {}; + + this._initDataFromProvider(0, data.count()); + + // If data has no item option. + if (data.pure) { + this.hasItemOption = false; + } +}; + +listProto.getProvider = function () { + return this._rawData; +}; + +listProto.appendData = function (data) { + if (__DEV__) { + assert$1(!this._indices, 'appendData can only be called on raw data.'); + } + + var rawData = this._rawData; + var start = this.count(); + rawData.appendData(data); + var end = rawData.count(); + if (!rawData.persistent) { + end += start; + } + this._initDataFromProvider(start, end); +}; + +listProto._initDataFromProvider = function (start, end) { + // Optimize. + if (start >= end) { + return; + } + + var chunkSize = this._chunkSize; + var rawData = this._rawData; + var storage = this._storage; + var dimensions = this.dimensions; + var dimLen = dimensions.length; + var dimensionInfoMap = this._dimensionInfos; + var nameList = this._nameList; + var idList = this._idList; + var rawExtent = this._rawExtent; + var nameRepeatCount = this._nameRepeatCount = {}; + var nameDimIdx; + + var chunkCount = this._chunkCount; + var lastChunkIndex = chunkCount - 1; + for (var i = 0; i < dimLen; i++) { + var dim = dimensions[i]; + if (!rawExtent[dim]) { + rawExtent[dim] = getInitialExtent(); + } + + var dimInfo = dimensionInfoMap[dim]; + if (dimInfo.otherDims.itemName === 0) { + nameDimIdx = this._nameDimIdx = i; + } + if (dimInfo.otherDims.itemId === 0) { + this._idDimIdx = i; + } + var DataCtor = dataCtors[dimInfo.type]; + + if (!storage[dim]) { + storage[dim] = []; + } + var resizeChunkArray = storage[dim][lastChunkIndex]; + if (resizeChunkArray && resizeChunkArray.length < chunkSize) { + var newStore = new DataCtor(Math.min(end - lastChunkIndex * chunkSize, chunkSize)); + // The cost of the copy is probably inconsiderable + // within the initial chunkSize. + for (var j = 0; j < resizeChunkArray.length; j++) { + newStore[j] = resizeChunkArray[j]; + } + storage[dim][lastChunkIndex] = newStore; + } + + // Create new chunks. + for (var k = chunkCount * chunkSize; k < end; k += chunkSize) { + storage[dim].push(new DataCtor(Math.min(end - k, chunkSize))); + } + this._chunkCount = storage[dim].length; + } + + var dataItem = new Array(dimLen); + for (var idx = start; idx < end; idx++) { + // NOTICE: Try not to write things into dataItem + dataItem = rawData.getItem(idx, dataItem); + // 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 category + // Use a tempValue to normalize the value to be a (x, y) value + var chunkIndex = Math.floor(idx / chunkSize); + var chunkOffset = idx % chunkSize; + + // Store the data by dimensions + for (var k = 0; k < dimLen; k++) { + var dim = dimensions[k]; + var dimStorage = storage[dim][chunkIndex]; + // PENDING NULL is empty or zero + var val = this._dimValueGetter(dataItem, dim, idx, k); + dimStorage[chunkOffset] = val; + + var dimRawExtent = rawExtent[dim]; + if (val < dimRawExtent[0]) { + dimRawExtent[0] = val; + } + if (val > dimRawExtent[1]) { + dimRawExtent[1] = val; + } + } + + // ??? FIXME not check by pure but sourceFormat? + // TODO refactor these logic. + if (!rawData.pure) { + var name = nameList[idx]; + + if (dataItem && name == null) { + // If dataItem is {name: ...}, it has highest priority. + // That is appropriate for many common cases. + if (dataItem.name != null) { + // There is no other place to persistent dataItem.name, + // so save it to nameList. + nameList[idx] = name = dataItem.name; + } + else if (nameDimIdx != null) { + var nameDim = dimensions[nameDimIdx]; + var nameDimChunk = storage[nameDim][chunkIndex]; + if (nameDimChunk) { + name = nameDimChunk[chunkOffset]; + var ordinalMeta = dimensionInfoMap[nameDim].ordinalMeta; + if (ordinalMeta && ordinalMeta.categories.length) { + name = ordinalMeta.categories[name]; + } + } + } + } + + // Try using the id in option + // id or name is used on dynamical data, mapping old and new items. + var id = dataItem == null ? null : dataItem.id; + + if (id == null && name != null) { + // 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 != null && (idList[idx] = id); + } + } + + if (!rawData.persistent && rawData.clean) { + // Clean unused data if data source is typed array. + rawData.clean(); + } + + this._rawCount = this._count = end; + + // Reset data extent + this._extent = {}; + + prepareInvertedIndex(this); +}; + +function prepareInvertedIndex(list) { + var invertedIndicesMap = list._invertedIndicesMap; + each$1(invertedIndicesMap, function (invertedIndices, dim) { + var dimInfo = list._dimensionInfos[dim]; + + // Currently, only dimensions that has ordinalMeta can create inverted indices. + var ordinalMeta = dimInfo.ordinalMeta; + if (ordinalMeta) { + invertedIndices = invertedIndicesMap[dim] = new CtorUint32Array( + ordinalMeta.categories.length + ); + // The default value of TypedArray is 0. To avoid miss + // mapping to 0, we should set it as NaN. + for (var i = 0; i < invertedIndices.length; i++) { + invertedIndices[i] = NaN; + } + for (var i = 0; i < list._count; i++) { + // Only support the case that all values are distinct. + invertedIndices[list.get(dim, i)] = i; + } + } + }); +} + +function getRawValueFromStore(list, dimIndex, rawIndex) { + var val; + if (dimIndex != null) { + var chunkSize = list._chunkSize; + var chunkIndex = Math.floor(rawIndex / chunkSize); + var chunkOffset = rawIndex % chunkSize; + var dim = list.dimensions[dimIndex]; + var chunk = list._storage[dim][chunkIndex]; + if (chunk) { + val = chunk[chunkOffset]; + var ordinalMeta = list._dimensionInfos[dim].ordinalMeta; + if (ordinalMeta && ordinalMeta.categories.length) { + val = ordinalMeta.categories[val]; + } + } + } + return val; +} + +/** + * @return {number} + */ +listProto.count = function () { + return this._count; +}; + +listProto.getIndices = function () { + var newIndices; + + var indices = this._indices; + if (indices) { + var Ctor = indices.constructor; + var thisCount = this._count; + // `new Array(a, b, c)` is different from `new Uint32Array(a, b, c)`. + if (Ctor === Array) { + newIndices = new Ctor(thisCount); + for (var i = 0; i < thisCount; i++) { + newIndices[i] = indices[i]; + } + } + else { + newIndices = new Ctor(indices.buffer, 0, thisCount); + } + } + else { + var Ctor = getIndicesCtor(this); + var newIndices = new Ctor(this.count()); + for (var i = 0; i < newIndices.length; i++) { + newIndices[i] = i; + } + } + + return newIndices; +}; + +/** + * 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 */) { + if (!(idx >= 0 && idx < this._count)) { + return NaN; + } + var storage = this._storage; + if (!storage[dim]) { + // TODO Warn ? + return NaN; + } + + idx = this.getRawIndex(idx); + + var chunkIndex = Math.floor(idx / this._chunkSize); + var chunkOffset = idx % this._chunkSize; + + var chunkStore = storage[dim][chunkIndex]; + var value = chunkStore[chunkOffset]; + // 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; +}; + +/** + * @param {string} dim concrete dim + * @param {number} rawIndex + * @return {number|string} + */ +listProto.getByRawIndex = function (dim, rawIdx) { + if (!(rawIdx >= 0 && rawIdx < this._rawCount)) { + return NaN; + } + var dimStore = this._storage[dim]; + if (!dimStore) { + // TODO Warn ? + return NaN; + } + + var chunkIndex = Math.floor(rawIdx / this._chunkSize); + var chunkOffset = rawIdx % this._chunkSize; + var chunkStore = dimStore[chunkIndex]; + return chunkStore[chunkOffset]; +}; + +/** + * FIXME Use `get` on chrome maybe slow(in filterSelf and selectRange). + * Hack a much simpler _getFast + * @private + */ +listProto._getFast = function (dim, rawIdx) { + var chunkIndex = Math.floor(rawIdx / this._chunkSize); + var chunkOffset = rawIdx % this._chunkSize; + var chunkStore = this._storage[dim][chunkIndex]; + return chunkStore[chunkOffset]; +}; + +/** + * Get value for multi dimensions. + * @param {Array.} [dimensions] If ignored, using all dimensions. + * @param {number} idx + * @return {number} + */ +listProto.getValues = function (dimensions, idx /*, stack */) { + var values = []; + + if (!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 '-' + * Only check the coord dimensions. + * @param {string} dim + * @param {number} idx + * @return {number} + */ +listProto.hasValue = function (idx) { + var dataDimsOnCoord = this._dimensionsSummary.dataDimsOnCoord; + var dimensionInfos = this._dimensionInfos; + for (var i = 0, len = dataDimsOnCoord.length; i < len; i++) { + if ( + // Ordinal type can be string or number + dimensionInfos[dataDimsOnCoord[i]].type !== 'ordinal' + // FIXME check ordinal when using index? + && isNaN(this.get(dataDimsOnCoord[i], idx)) + ) { + return false; + } + } + return true; +}; + +/** + * Get extent of data in one dimension + * @param {string} dim + * @param {boolean} stack + */ +listProto.getDataExtent = function (dim /*, stack */) { + // Make sure use concrete dim as cache name. + dim = this.getDimension(dim); + var dimData = this._storage[dim]; + var initialExtent = getInitialExtent(); + + // stack = !!((stack || false) && this.getCalculationInfo(dim)); + + if (!dimData) { + return initialExtent; + } + + // Make more strict checkings to ensure hitting cache. + var currEnd = this.count(); + // var cacheName = [dim, !!stack].join('_'); + // var cacheName = dim; + + // Consider the most cases when using data zoom, `getDataExtent` + // happened before filtering. We cache raw extent, which is not + // necessary to be cleared and recalculated when restore data. + var useRaw = !this._indices; // && !stack; + var dimExtent; + + if (useRaw) { + return this._rawExtent[dim].slice(); + } + dimExtent = this._extent[dim]; + if (dimExtent) { + return dimExtent.slice(); + } + dimExtent = initialExtent; + + var min = dimExtent[0]; + var max = dimExtent[1]; + + for (var i = 0; i < currEnd; i++) { + // var value = stack ? this.get(dim, i, true) : this._getFast(dim, this.getRawIndex(i)); + var value = this._getFast(dim, this.getRawIndex(i)); + value < min && (min = value); + value > max && (max = value); + } + + dimExtent = [min, max]; + + this._extent[dim] = dimExtent; + + return dimExtent; +}; + +/** + * Optimize for the scenario that data is filtered by a given extent. + * Consider that if data amount is more than hundreds of thousand, + * extent calculation will cost more than 10ms and the cache will + * be erased because of the filtering. + */ +listProto.getApproximateExtent = function (dim /*, stack */) { + dim = this.getDimension(dim); + return this._approximateExtent[dim] || this.getDataExtent(dim /*, stack */); +}; + +listProto.setApproximateExtent = function (extent, dim /*, stack */) { + dim = this.getDimension(dim); + this._approximateExtent[dim] = extent.slice(); +}; + +/** + * @param {string} key + * @return {*} + */ +listProto.getCalculationInfo = function (key) { + return this._calculationInfo[key]; +}; + +/** + * @param {string|Object} key or k-v object + * @param {*} [value] + */ +listProto.setCalculationInfo = function (key, value) { + isObject$4(key) + ? extend(this._calculationInfo, key) + : (this._calculationInfo[key] = value); +}; + +/** + * Get sum of data in one dimension + * @param {string} dim + */ +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; +}; + +/** + * Get median of data in one dimension + * @param {string} dim + */ +listProto.getMedian = function (dim /*, stack */) { + var dimDataArray = []; + // map all data of one dimension + this.each(dim, function (val, idx) { + if (!isNaN(val)) { + dimDataArray.push(val); + } + }); + + // TODO + // Use quick select? + + // immutability & sort + var sortedDimDataArray = [].concat(dimDataArray).sort(function(a, b) { + return a - b; + }); + var len = this.count(); + // calculate median + return len === 0 ? 0 : + len % 2 === 1 ? sortedDimDataArray[(len - 1) / 2] : + (sortedDimDataArray[len / 2] + sortedDimDataArray[len / 2 - 1]) / 2; +}; + +// /** +// * Retreive the index with given value +// * @param {string} dim Concrete dimension. +// * @param {number} value +// * @return {number} +// */ +// Currently incorrect: should return dataIndex but not rawIndex. +// Do not fix it until this method is to be used somewhere. +// FIXME Precision of float value +// listProto.indexOf = function (dim, value) { +// var storage = this._storage; +// var dimData = storage[dim]; +// var chunkSize = this._chunkSize; +// if (dimData) { +// for (var i = 0, len = this.count(); i < len; i++) { +// var chunkIndex = Math.floor(i / chunkSize); +// var chunkOffset = i % chunkSize; +// if (dimData[chunkIndex][chunkOffset] === value) { +// return i; +// } +// } +// } +// return -1; +// }; + +/** + * Only support the dimension which inverted index created. + * Do not support other cases until required. + * @param {string} concrete dim + * @param {number|string} value + * @return {number} rawIndex + */ +listProto.rawIndexOf = function (dim, value) { + var invertedIndices = dim && this._invertedIndicesMap[dim]; + if (__DEV__) { + if (!invertedIndices) { + throw new Error('Do not supported yet'); + } + } + var rawIndex = invertedIndices[value]; + if (rawIndex == null || isNaN(rawIndex)) { + return -1; + } + return rawIndex; +}; + +/** + * Retreive the index with given name + * @param {number} idx + * @param {number} name + * @return {number} + */ +listProto.indexOfName = function (name) { + for (var i = 0, len = this.count(); i < len; i++) { + if (this.getName(i) === name) { + return i; + } + } + + return -1; +}; + +/** + * Retreive the index with given raw data index + * @param {number} idx + * @param {number} name + * @return {number} + */ +listProto.indexOfRawIndex = function (rawIndex) { + if (!this._indices) { + return rawIndex; + } + + if (rawIndex >= this._rawCount || rawIndex < 0) { + return -1; + } + + // Indices are ascending + var indices = this._indices; + + // If rawIndex === dataIndex + var rawDataIndex = indices[rawIndex]; + if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) { + return rawIndex; + } + + var left = 0; + var right = this._count - 1; + while (left <= right) { + var mid = (left + right) / 2 | 0; + if (indices[mid] < rawIndex) { + left = mid + 1; + } + else if (indices[mid] > rawIndex) { + right = mid - 1; + } + else { + return mid; + } + } + return -1; +}; + +/** + * Retreive the index of nearest value + * @param {string} dim + * @param {number} value + * @param {number} [maxDistance=Infinity] + * @return {Array.} Considere multiple points has the same value. + */ +listProto.indicesOfNearest = function (dim, value, maxDistance) { + var storage = this._storage; + var dimData = storage[dim]; + var nearestIndices = []; + + if (!dimData) { + return nearestIndices; + } + + if (maxDistance == null) { + maxDistance = Infinity; + } + + var minDist = Number.MAX_VALUE; + var minDiff = -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 (diff <= maxDistance && 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 + if (dist < minDist || (diff >= 0 && minDiff < 0)) { + minDist = dist; + minDiff = diff; + nearestIndices.length = 0; + } + nearestIndices.push(i); + } + } + return nearestIndices; +}; + +/** + * Get raw data index + * @param {number} idx + * @return {number} + */ +listProto.getRawIndex = getRawIndexWithoutIndices; + +function getRawIndexWithoutIndices(idx) { + return idx; +} + +function getRawIndexWithIndices(idx) { + if (idx < this._count && idx >= 0) { + return this._indices[idx]; + } + return -1; +} + +/** + * Get raw data item + * @param {number} idx + * @return {number} + */ +listProto.getRawDataItem = function (idx) { + if (!this._rawData.persistent) { + var val = []; + for (var i = 0; i < this.dimensions.length; i++) { + var dim = this.dimensions[i]; + val.push(this.get(dim, idx)); + } + return val; + } + else { + return this._rawData.getItem(this.getRawIndex(idx)); + } +}; + +/** + * @param {number} idx + * @param {boolean} [notDefaultIdx=false] + * @return {string} + */ +listProto.getName = function (idx) { + var rawIndex = this.getRawIndex(idx); + return this._nameList[rawIndex] + || getRawValueFromStore(this, this._nameDimIdx, rawIndex) + || ''; +}; + +/** + * @param {number} idx + * @param {boolean} [notDefaultIdx=false] + * @return {string} + */ +listProto.getId = function (idx) { + return getId(this, this.getRawIndex(idx)); +}; + +function getId(list, rawIndex) { + var id = list._idList[rawIndex]; + if (id == null) { + id = getRawValueFromStore(list, list._idDimIdx, rawIndex); + } + if (id == null) { + // FIXME Check the usage in graph, should not use prefix. + id = ID_PREFIX + rawIndex; + } + return id; +} + +function normalizeDimensions(dimensions) { + if (!isArray(dimensions)) { + dimensions = [dimensions]; + } + return dimensions; +} + +function validateDimensions(list, dims) { + for (var i = 0; i < dims.length; i++) { + // stroage may be empty when no data, so use + // dimensionInfos to check. + if (!list._dimensionInfos[dims[i]]) { + console.error('Unkown dimension ' + dims[i]); + } + } +} + +/** + * Data iteration + * @param {string|Array.} + * @param {Function} cb + * @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 (dims, cb, context, contextCompat) { + 'use strict'; + + if (!this._count) { + return; + } + + if (typeof dims === 'function') { + contextCompat = context; + context = cb; + cb = dims; + dims = []; + } + + // contextCompat just for compat echarts3 + context = context || contextCompat || this; + + dims = map(normalizeDimensions(dims), this.getDimension, this); + + if (__DEV__) { + validateDimensions(this, dims); + } + + var dimSize = dims.length; + + for (var i = 0; i < this.count(); i++) { + // Simple optimization + switch (dimSize) { + case 0: + cb.call(context, i); + break; + case 1: + cb.call(context, this.get(dims[0], i), i); + break; + case 2: + cb.call(context, this.get(dims[0], i), this.get(dims[1], i), i); + break; + default: + var k = 0; + var value = []; + for (; k < dimSize; k++) { + value[k] = this.get(dims[k], i); + } + // Index + value[k] = i; + cb.apply(context, value); + } + } +}; + +/** + * Data filter + * @param {string|Array.} + * @param {Function} cb + * @param {*} [context=this] + */ +listProto.filterSelf = function (dimensions, cb, context, contextCompat) { + 'use strict'; + + if (!this._count) { + return; + } + + if (typeof dimensions === 'function') { + contextCompat = context; + context = cb; + cb = dimensions; + dimensions = []; + } + + // contextCompat just for compat echarts3 + context = context || contextCompat || this; + + dimensions = map( + normalizeDimensions(dimensions), this.getDimension, this + ); + + if (__DEV__) { + validateDimensions(this, dimensions); + } + + + var count = this.count(); + var Ctor = getIndicesCtor(this); + var newIndices = new Ctor(count); + var value = []; + var dimSize = dimensions.length; + + var offset = 0; + var dim0 = dimensions[0]; + + for (var i = 0; i < count; i++) { + var keep; + var rawIdx = this.getRawIndex(i); + // Simple optimization + if (dimSize === 0) { + keep = cb.call(context, i); + } + else if (dimSize === 1) { + var val = this._getFast(dim0, rawIdx); + keep = cb.call(context, val, i); + } + else { + for (var k = 0; k < dimSize; k++) { + value[k] = this._getFast(dim0, rawIdx); + } + value[k] = i; + keep = cb.apply(context, value); + } + if (keep) { + newIndices[offset++] = rawIdx; + } + } + + // Set indices after filtered. + if (offset < count) { + this._indices = newIndices; + } + this._count = offset; + // Reset data extent + this._extent = {}; + + this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices; + + return this; +}; + +/** + * Select data in range. (For optimization of filter) + * (Manually inline code, support 5 million data filtering in data zoom.) + */ +listProto.selectRange = function (range) { + 'use strict'; + + if (!this._count) { + return; + } + + var dimensions = []; + for (var dim in range) { + if (range.hasOwnProperty(dim)) { + dimensions.push(dim); + } + } + + if (__DEV__) { + validateDimensions(this, dimensions); + } + + var dimSize = dimensions.length; + if (!dimSize) { + return; + } + + var originalCount = this.count(); + var Ctor = getIndicesCtor(this); + var newIndices = new Ctor(originalCount); + + var offset = 0; + var dim0 = dimensions[0]; + + var min = range[dim0][0]; + var max = range[dim0][1]; + + var quickFinished = false; + if (!this._indices) { + // Extreme optimization for common case. About 2x faster in chrome. + var idx = 0; + if (dimSize === 1) { + var dimStorage = this._storage[dimensions[0]]; + for (var k = 0; k < this._chunkCount; k++) { + var chunkStorage = dimStorage[k]; + var len = Math.min(this._count - k * this._chunkSize, this._chunkSize); + for (var i = 0; i < len; i++) { + var val = chunkStorage[i]; + // NaN will not be filtered. Consider the case, in line chart, empty + // value indicates the line should be broken. But for the case like + // scatter plot, a data item with empty value will not be rendered, + // but the axis extent may be effected if some other dim of the data + // item has value. Fortunately it is not a significant negative effect. + if ( + (val >= min && val <= max) || isNaN(val) + ) { + newIndices[offset++] = idx; + } + idx++; + } + } + quickFinished = true; + } + else if (dimSize === 2) { + var dimStorage = this._storage[dim0]; + var dimStorage2 = this._storage[dimensions[1]]; + var min2 = range[dimensions[1]][0]; + var max2 = range[dimensions[1]][1]; + for (var k = 0; k < this._chunkCount; k++) { + var chunkStorage = dimStorage[k]; + var chunkStorage2= dimStorage2[k]; + var len = Math.min(this._count - k * this._chunkSize, this._chunkSize); + for (var i = 0; i < len; i++) { + var val = chunkStorage[i]; + var val2 = chunkStorage2[i]; + // Do not filter NaN, see comment above. + if (( + (val >= min && val <= max) || isNaN(val) + ) + && ( + (val2 >= min2 && val2 <= max2) || isNaN(val2) + ) + ) { + newIndices[offset++] = idx; + } + idx++; + } + } + quickFinished = true; + } + } + if (!quickFinished) { + if (dimSize === 1) { + for (var i = 0; i < originalCount; i++) { + var rawIndex = this.getRawIndex(i); + var val = this._getFast(dim0, rawIndex); + // Do not filter NaN, see comment above. + if ( + (val >= min && val <= max) || isNaN(val) + ) { + newIndices[offset++] = rawIndex; + } + } + } + else { + for (var i = 0; i < originalCount; i++) { + var keep = true; + var rawIndex = this.getRawIndex(i); + for (var k = 0; k < dimSize; k++) { + var dimk = dimensions[k]; + var val = this._getFast(dim, rawIndex); + // Do not filter NaN, see comment above. + if (val < range[dimk][0] || val > range[dimk][1]) { + keep = false; + } + } + if (keep) { + newIndices[offset++] = this.getRawIndex(i); + } + } + } + } + + // Set indices after filtered. + if (offset < originalCount) { + this._indices = newIndices; + } + this._count = offset; + // Reset data extent + this._extent = {}; + + this.getRawIndex = this._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices; + + return this; +}; + +/** + * Data mapping to a plain array + * @param {string|Array.} [dimensions] + * @param {Function} cb + * @param {*} [context=this] + * @return {Array} + */ +listProto.mapArray = function (dimensions, cb, context, contextCompat) { + 'use strict'; + + if (typeof dimensions === 'function') { + contextCompat = context; + context = cb; + cb = dimensions; + dimensions = []; + } + + // contextCompat just for compat echarts3 + context = context || contextCompat || this; + + var result = []; + this.each(dimensions, function () { + result.push(cb && cb.apply(this, arguments)); + }, context); + return result; +}; + +// Data in excludeDimensions is copied, otherwise transfered. +function cloneListForMapAndSample(original, excludeDimensions) { + var allDimensions = original.dimensions; + var list = new List( + map(allDimensions, original.getDimensionInfo, original), + original.hostModel + ); + // FIXME If needs stackedOn, value may already been stacked + transferProperties(list, original); + + var storage = list._storage = {}; + var originalStorage = original._storage; + + // Init storage + for (var i = 0; i < allDimensions.length; i++) { + var dim = allDimensions[i]; + if (originalStorage[dim]) { + // Notice that we do not reset invertedIndicesMap here, becuase + // there is no scenario of mapping or sampling ordinal dimension. + if (indexOf(excludeDimensions, dim) >= 0) { + storage[dim] = cloneDimStore(originalStorage[dim]); + list._rawExtent[dim] = getInitialExtent(); + list._extent[dim] = null; + } + else { + // Direct reference for other dimensions + storage[dim] = originalStorage[dim]; + } + } + } + return list; +} + +function cloneDimStore(originalDimStore) { + var newDimStore = new Array(originalDimStore.length); + for (var j = 0; j < originalDimStore.length; j++) { + newDimStore[j] = cloneChunk(originalDimStore[j]); + } + return newDimStore; +} + +function getInitialExtent() { + return [Infinity, -Infinity]; +} + +/** + * Data mapping to a new List with given dimensions + * @param {string|Array.} dimensions + * @param {Function} cb + * @param {*} [context=this] + * @return {Array} + */ +listProto.map = function (dimensions, cb, context, contextCompat) { + 'use strict'; + + // contextCompat just for compat echarts3 + context = context || contextCompat || this; + + dimensions = map( + normalizeDimensions(dimensions), this.getDimension, this + ); + + if (__DEV__) { + validateDimensions(this, dimensions); + } + + var list = cloneListForMapAndSample(this, dimensions); + + // Following properties are all immutable. + // So we can reference to the same value + list._indices = this._indices; + list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices; + + var storage = list._storage; + + var tmpRetValue = []; + var chunkSize = this._chunkSize; + var dimSize = dimensions.length; + var dataCount = this.count(); + var values = []; + var rawExtent = list._rawExtent; + + for (var dataIndex = 0; dataIndex < dataCount; dataIndex++) { + for (var dimIndex = 0; dimIndex < dimSize; dimIndex++) { + values[dimIndex] = this.get(dimensions[dimIndex], dataIndex /*, stack */); + } + values[dimSize] = dataIndex; + + var retValue = cb && cb.apply(context, values); + if (retValue != null) { + // a number or string (in oridinal dimension)? + if (typeof retValue !== 'object') { + tmpRetValue[0] = retValue; + retValue = tmpRetValue; + } + + var rawIndex = this.getRawIndex(dataIndex); + var chunkIndex = Math.floor(rawIndex / chunkSize); + var chunkOffset = rawIndex % chunkSize; + + for (var i = 0; i < retValue.length; i++) { + var dim = dimensions[i]; + var val = retValue[i]; + var rawExtentOnDim = rawExtent[dim]; + + var dimStore = storage[dim]; + if (dimStore) { + dimStore[chunkIndex][chunkOffset] = val; + } + + if (val < rawExtentOnDim[0]) { + rawExtentOnDim[0] = val; + } + if (val > rawExtentOnDim[1]) { + rawExtentOnDim[1] = val; + } + } + } + } + + 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 targetStorage = list._storage; + + var frameValues = []; + var frameSize = Math.floor(1 / rate); + + var dimStore = targetStorage[dimension]; + var len = this.count(); + var chunkSize = this._chunkSize; + var rawExtentOnDim = list._rawExtent[dimension]; + + var newIndices = new (getIndicesCtor(this))(len); + + var offset = 0; + 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 dataIdx = this.getRawIndex(i + k); + var originalChunkIndex = Math.floor(dataIdx / chunkSize); + var originalChunkOffset = dataIdx % chunkSize; + frameValues[k] = dimStore[originalChunkIndex][originalChunkOffset]; + } + var value = sampleValue(frameValues); + var sampleFrameIdx = this.getRawIndex( + Math.min(i + sampleIndex(frameValues, value) || 0, len - 1) + ); + var sampleChunkIndex = Math.floor(sampleFrameIdx / chunkSize); + var sampleChunkOffset = sampleFrameIdx % chunkSize; + // Only write value on the filtered data + dimStore[sampleChunkIndex][sampleChunkOffset] = value; + + if (value < rawExtentOnDim[0]) { + rawExtentOnDim[0] = value; + } + if (value > rawExtentOnDim[1]) { + rawExtentOnDim[1] = value; + } + + newIndices[offset++] = sampleFrameIdx; + } + + list._count = offset; + list._indices = newIndices; + + list.getRawIndex = getRawIndexWithIndices; + + return list; +}; + +/** + * Get model of one data item. + * + * @param {number} idx + */ +// FIXME Model proxy ? +listProto.getItemModel = function (idx) { + var hostModel = this.hostModel; + return new Model(this.getRawDataItem(idx), hostModel, hostModel && hostModel.ecModel); +}; + +/** + * Create a data differ + * @param {module:echarts/data/List} otherList + * @return {module:echarts/data/DataDiffer} + */ +listProto.diff = function (otherList) { + var thisList = this; + + return new DataDiffer( + otherList ? otherList.getIndices() : [], + this.getIndices(), + function (idx) { + return getId(otherList, idx); + }, + function (idx) { + return getId(thisList, 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$4(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|Object} key + * @param {*} [val] + */ +listProto.setLayout = function (key, val) { + if (isObject$4(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$$1) { + this._itemLayouts[idx] = merge$$1 + ? extend(this._itemLayouts[idx] || {}, layout) + : layout; +}; + +/** + * Clear all layout of single data item + */ +listProto.clearItemLayouts = function () { + this._itemLayouts.length = 0; +}; + +/** + * Get visual property of single data item + * @param {number} idx + * @param {string} key + * @param {boolean} [ignoreParent=false] + */ +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] || {}; + var hasItemVisual = this.hasItemVisual; + this._itemVisuals[idx] = itemVisual; + + if (isObject$4(key)) { + for (var name in key) { + if (key.hasOwnProperty(name)) { + itemVisual[name] = key[name]; + hasItemVisual[name] = true; + } + } + return; + } + itemVisual[key] = value; + hasItemVisual[key] = true; +}; + +/** + * Clear itemVisuals and list visual. + */ +listProto.clearAllVisual = function () { + this._visual = {}; + this._itemVisuals = []; + this.hasItemVisual = {}; +}; + +var setItemDataAndSeriesIndex = function (child) { + child.seriesIndex = this.seriesIndex; + child.dataIndex = this.dataIndex; + child.dataType = this.dataType; +}; +/** + * 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.dataType = this.dataType; + 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) { + each$1(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 (list) { + if (!list) { + var dimensionInfoList = map(this.dimensions, this.getDimensionInfo, this); + list = new List(dimensionInfoList, this.hostModel); + } + + // FIXME + list._storage = this._storage; + + transferProperties(list, this); + + // Clone will not change the data extent and indices + if (this._indices) { + var Ctor = this._indices.constructor; + list._indices = new Ctor(this._indices); + } + else { + list._indices = null; + } + list.getRawIndex = list._indices ? getRawIndexWithIndices : getRawIndexWithoutIndices; + + 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.apply(this, [res].concat(slice(arguments))); + }; +}; + +// Methods that create a new list based on this list should be listed here. +// Notice that those method should `RETURN` the new list. +listProto.TRANSFERABLE_METHODS = ['cloneShallow', 'downSample', 'map']; +// Methods that change indices of this list should be listed here. +listProto.CHANGABLE_METHODS = ['filterSelf', 'selectRange']; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @deprecated + * Use `echarts/data/helper/createDimensions` instead. + */ + +/** + * @see {module:echarts/test/ut/spec/data/completeDimensions} + * + * Complete the dimensions array, by user defined `dimension` and `encode`, + * and guessing from the data structure. + * If no 'value' dimension specified, the first no-named dimension will be + * named as 'value'. + * + * @param {Array.} sysDims Necessary dimensions, like ['x', 'y'], which + * provides not only dim template, but also default order. + * properties: 'name', 'type', 'displayName'. + * `name` of each item provides default coord name. + * [{dimsDef: [string|Object, ...]}, ...] dimsDef of sysDim item provides default dim name, and + * provide dims count that the sysDim required. + * [{ordinalMeta}] can be specified. + * @param {module:echarts/data/Source|Array|Object} source or data (for compatibal with pervious) + * @param {Object} [opt] + * @param {Array.} [opt.dimsDef] option.series.dimensions User defined dimensions + * For example: ['asdf', {name, type}, ...]. + * @param {Object|HashMap} [opt.encodeDef] option.series.encode {x: 2, y: [3, 1], tooltip: [1, 2], label: 3} + * @param {string} [opt.generateCoord] Generate coord dim with the given name. + * If not specified, extra dim names will be: + * 'value', 'value0', 'value1', ... + * @param {number} [opt.generateCoordCount] By default, the generated dim name is `generateCoord`. + * If `generateCoordCount` specified, the generated dim names will be: + * `generateCoord` + 0, `generateCoord` + 1, ... + * can be Infinity, indicate that use all of the remain columns. + * @param {number} [opt.dimCount] If not specified, guess by the first data item. + * @param {number} [opt.encodeDefaulter] If not specified, auto find the next available data dim. + * @return {Array.} [{ + * name: string mandatory, + * displayName: string, the origin name in dimsDef, see source helper. + * If displayName given, the tooltip will displayed vertically. + * coordDim: string mandatory, + * coordDimIndex: number mandatory, + * type: string optional, + * otherDims: { never null/undefined + * tooltip: number optional, + * label: number optional, + * itemName: number optional, + * seriesName: number optional, + * }, + * isExtraCoord: boolean true if coord is generated + * (not specified in encode and not series specified) + * other props ... + * }] + */ +function completeDimensions(sysDims, source, opt) { + if (!Source.isInstance(source)) { + source = Source.seriesDataToSource(source); + } + + opt = opt || {}; + sysDims = (sysDims || []).slice(); + var dimsDef = (opt.dimsDef || []).slice(); + var encodeDef = createHashMap(opt.encodeDef); + var dataDimNameMap = createHashMap(); + var coordDimNameMap = createHashMap(); + // var valueCandidate; + var result = []; + + var dimCount = getDimCount(source, sysDims, dimsDef, opt.dimCount); + + // Apply user defined dims (`name` and `type`) and init result. + for (var i = 0; i < dimCount; i++) { + var dimDefItem = dimsDef[i] = extend( + {}, isObject$1(dimsDef[i]) ? dimsDef[i] : {name: dimsDef[i]} + ); + var userDimName = dimDefItem.name; + var resultItem = result[i] = {otherDims: {}}; + // Name will be applied later for avoiding duplication. + if (userDimName != null && dataDimNameMap.get(userDimName) == null) { + // Only if `series.dimensions` is defined in option + // displayName, will be set, and dimension will be diplayed vertically in + // tooltip by default. + resultItem.name = resultItem.displayName = userDimName; + dataDimNameMap.set(userDimName, i); + } + dimDefItem.type != null && (resultItem.type = dimDefItem.type); + dimDefItem.displayName != null && (resultItem.displayName = dimDefItem.displayName); + } + + // Set `coordDim` and `coordDimIndex` by `encodeDef` and normalize `encodeDef`. + encodeDef.each(function (dataDims, coordDim) { + dataDims = normalizeToArray(dataDims).slice(); + var validDataDims = encodeDef.set(coordDim, []); + each$1(dataDims, function (resultDimIdx, idx) { + // The input resultDimIdx can be dim name or index. + isString(resultDimIdx) && (resultDimIdx = dataDimNameMap.get(resultDimIdx)); + if (resultDimIdx != null && resultDimIdx < dimCount) { + validDataDims[idx] = resultDimIdx; + applyDim(result[resultDimIdx], coordDim, idx); + } + }); + }); + + // Apply templetes and default order from `sysDims`. + var availDimIdx = 0; + each$1(sysDims, function (sysDimItem, sysDimIndex) { + var coordDim; + var sysDimItem; + var sysDimItemDimsDef; + var sysDimItemOtherDims; + if (isString(sysDimItem)) { + coordDim = sysDimItem; + sysDimItem = {}; + } + else { + coordDim = sysDimItem.name; + var ordinalMeta = sysDimItem.ordinalMeta; + sysDimItem.ordinalMeta = null; + sysDimItem = clone(sysDimItem); + sysDimItem.ordinalMeta = ordinalMeta; + // `coordDimIndex` should not be set directly. + sysDimItemDimsDef = sysDimItem.dimsDef; + sysDimItemOtherDims = sysDimItem.otherDims; + sysDimItem.name = sysDimItem.coordDim = sysDimItem.coordDimIndex + = sysDimItem.dimsDef = sysDimItem.otherDims = null; + } + + var dataDims = normalizeToArray(encodeDef.get(coordDim)); + // dimensions provides default dim sequences. + if (!dataDims.length) { + for (var i = 0; i < (sysDimItemDimsDef && sysDimItemDimsDef.length || 1); i++) { + while (availDimIdx < result.length && result[availDimIdx].coordDim != null) { + availDimIdx++; + } + availDimIdx < result.length && dataDims.push(availDimIdx++); + } + } + + // Apply templates. + each$1(dataDims, function (resultDimIdx, coordDimIndex) { + var resultItem = result[resultDimIdx]; + applyDim(defaults(resultItem, sysDimItem), coordDim, coordDimIndex); + if (resultItem.name == null && sysDimItemDimsDef) { + var sysDimItemDimsDefItem = sysDimItemDimsDef[coordDimIndex]; + !isObject$1(sysDimItemDimsDefItem) && (sysDimItemDimsDefItem = {name: sysDimItemDimsDefItem}); + resultItem.name = resultItem.displayName = sysDimItemDimsDefItem.name; + resultItem.defaultTooltip = sysDimItemDimsDefItem.defaultTooltip; + } + // FIXME refactor, currently only used in case: {otherDims: {tooltip: false}} + sysDimItemOtherDims && defaults(resultItem.otherDims, sysDimItemOtherDims); + }); + }); + + function applyDim(resultItem, coordDim, coordDimIndex) { + if (OTHER_DIMENSIONS.get(coordDim) != null) { + resultItem.otherDims[coordDim] = coordDimIndex; + } + else { + resultItem.coordDim = coordDim; + resultItem.coordDimIndex = coordDimIndex; + coordDimNameMap.set(coordDim, true); + } + } + + // Make sure the first extra dim is 'value'. + var generateCoord = opt.generateCoord; + var generateCoordCount = opt.generateCoordCount; + var fromZero = generateCoordCount != null; + generateCoordCount = generateCoord ? (generateCoordCount || 1) : 0; + var extra = generateCoord || 'value'; + + // Set dim `name` and other `coordDim` and other props. + for (var resultDimIdx = 0; resultDimIdx < dimCount; resultDimIdx++) { + var resultItem = result[resultDimIdx] = result[resultDimIdx] || {}; + var coordDim = resultItem.coordDim; + + if (coordDim == null) { + resultItem.coordDim = genName( + extra, coordDimNameMap, fromZero + ); + resultItem.coordDimIndex = 0; + if (!generateCoord || generateCoordCount <= 0) { + resultItem.isExtraCoord = true; + } + generateCoordCount--; + } + + resultItem.name == null && (resultItem.name = genName( + resultItem.coordDim, + dataDimNameMap + )); + + if (resultItem.type == null && guessOrdinal(source, resultDimIdx, resultItem.name)) { + resultItem.type = 'ordinal'; + } + } + + return result; +} + +// ??? TODO +// Originally detect dimCount by data[0]. Should we +// optimize it to only by sysDims and dimensions and encode. +// So only necessary dims will be initialized. +// But +// (1) custom series should be considered. where other dims +// may be visited. +// (2) sometimes user need to calcualte bubble size or use visualMap +// on other dimensions besides coordSys needed. +// So, dims that is not used by system, should be shared in storage? +function getDimCount(source, sysDims, dimsDef, optDimCount) { + // Note that the result dimCount should not small than columns count + // of data, otherwise `dataDimNameMap` checking will be incorrect. + var dimCount = Math.max( + source.dimensionsDetectCount || 1, + sysDims.length, + dimsDef.length, + optDimCount || 0 + ); + each$1(sysDims, function (sysDimItem) { + var sysDimItemDimsDef = sysDimItem.dimsDef; + sysDimItemDimsDef && (dimCount = Math.max(dimCount, sysDimItemDimsDef.length)); + }); + return dimCount; +} + +function genName(name, map$$1, fromZero) { + if (fromZero || map$$1.get(name) != null) { + var i = 0; + while (map$$1.get(name + i) != null) { + i++; + } + name += i; + } + map$$1.set(name, true); + return name; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Substitute `completeDimensions`. + * `completeDimensions` is to be deprecated. + */ +/** + * @param {module:echarts/data/Source|module:echarts/data/List} source or data. + * @param {Object|Array} [opt] + * @param {Array.} [opt.coordDimensions=[]] + * @param {number} [opt.dimensionsCount] + * @param {string} [opt.generateCoord] + * @param {string} [opt.generateCoordCount] + * @param {Array.} [opt.dimensionsDefine=source.dimensionsDefine] Overwrite source define. + * @param {Object|HashMap} [opt.encodeDefine=source.encodeDefine] Overwrite source define. + * @return {Array.} dimensionsInfo + */ +var createDimensions = function (source, opt) { + opt = opt || {}; + return completeDimensions(opt.coordDimensions || [], source, { + dimsDef: opt.dimensionsDefine || source.dimensionsDefine, + encodeDef: opt.encodeDefine || source.encodeDefine, + dimCount: opt.dimensionsCount, + generateCoord: opt.generateCoord, + generateCoordCount: opt.generateCoordCount + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Note that it is too complicated to support 3d stack by value + * (have to create two-dimension inverted index), so in 3d case + * we just support that stacked by index. + * + * @param {module:echarts/model/Series} seriesModel + * @param {Array.} dimensionInfoList The same as the input of . + * The input dimensionInfoList will be modified. + * @param {Object} [opt] + * @param {boolean} [opt.stackedCoordDimension=''] Specify a coord dimension if needed. + * @param {boolean} [opt.byIndex=false] + * @return {Object} calculationInfo + * { + * stackedDimension: string + * stackedByDimension: string + * isStackedByIndex: boolean + * stackedOverDimension: string + * stackResultDimension: string + * } + */ +function enableDataStack(seriesModel, dimensionInfoList, opt) { + opt = opt || {}; + var byIndex = opt.byIndex; + var stackedCoordDimension = opt.stackedCoordDimension; + + // Compatibal: when `stack` is set as '', do not stack. + var mayStack = !!(seriesModel && seriesModel.get('stack')); + var stackedByDimInfo; + var stackedDimInfo; + var stackResultDimension; + var stackedOverDimension; + + each$1(dimensionInfoList, function (dimensionInfo, index) { + if (isString(dimensionInfo)) { + dimensionInfoList[index] = dimensionInfo = {name: dimensionInfo}; + } + + if (mayStack && !dimensionInfo.isExtraCoord) { + // Find the first ordinal dimension as the stackedByDimInfo. + if (!byIndex && !stackedByDimInfo && dimensionInfo.ordinalMeta) { + stackedByDimInfo = dimensionInfo; + } + // Find the first stackable dimension as the stackedDimInfo. + if (!stackedDimInfo + && dimensionInfo.type !== 'ordinal' + && dimensionInfo.type !== 'time' + && (!stackedCoordDimension || stackedCoordDimension === dimensionInfo.coordDim) + ) { + stackedDimInfo = dimensionInfo; + } + } + }); + + if (stackedDimInfo && !byIndex && !stackedByDimInfo) { + // Compatible with previous design, value axis (time axis) only stack by index. + // It may make sense if the user provides elaborately constructed data. + byIndex = true; + } + + // Add stack dimension, they can be both calculated by coordinate system in `unionExtent`. + // That put stack logic in List is for using conveniently in echarts extensions, but it + // might not be a good way. + if (stackedDimInfo) { + // Use a weird name that not duplicated with other names. + stackResultDimension = '__\0ecstackresult'; + stackedOverDimension = '__\0ecstackedover'; + + // Create inverted index to fast query index by value. + if (stackedByDimInfo) { + stackedByDimInfo.createInvertedIndices = true; + } + + var stackedDimCoordDim = stackedDimInfo.coordDim; + var stackedDimType = stackedDimInfo.type; + var stackedDimCoordIndex = 0; + + each$1(dimensionInfoList, function (dimensionInfo) { + if (dimensionInfo.coordDim === stackedDimCoordDim) { + stackedDimCoordIndex++; + } + }); + + dimensionInfoList.push({ + name: stackResultDimension, + coordDim: stackedDimCoordDim, + coordDimIndex: stackedDimCoordIndex, + type: stackedDimType, + isExtraCoord: true, + isCalculationCoord: true + }); + + stackedDimCoordIndex++; + + dimensionInfoList.push({ + name: stackedOverDimension, + // This dimension contains stack base (generally, 0), so do not set it as + // `stackedDimCoordDim` to avoid extent calculation, consider log scale. + coordDim: stackedOverDimension, + coordDimIndex: stackedDimCoordIndex, + type: stackedDimType, + isExtraCoord: true, + isCalculationCoord: true + }); + } + + return { + stackedDimension: stackedDimInfo && stackedDimInfo.name, + stackedByDimension: stackedByDimInfo && stackedByDimInfo.name, + isStackedByIndex: byIndex, + stackedOverDimension: stackedOverDimension, + stackResultDimension: stackResultDimension + }; +} + +/** + * @param {module:echarts/data/List} data + * @param {string} stackedDim + */ +function isDimensionStacked(data, stackedDim /*, stackedByDim*/) { + // Each single series only maps to one pair of axis. So we do not need to + // check stackByDim, whatever stacked by a dimension or stacked by index. + return !!stackedDim && stackedDim === data.getCalculationInfo('stackedDimension'); + // && ( + // stackedByDim != null + // ? stackedByDim === data.getCalculationInfo('stackedByDimension') + // : data.getCalculationInfo('isStackedByIndex') + // ); +} + +/** + * @param {module:echarts/data/List} data + * @param {string} targetDim + * @param {string} [stackedByDim] If not input this parameter, check whether + * stacked by index. + * @return {string} dimension + */ +function getStackedDimension(data, targetDim) { + return isDimensionStacked(data, targetDim) + ? data.getCalculationInfo('stackResultDimension') + : targetDim; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @param {module:echarts/data/Source|Array} source Or raw data. + * @param {module:echarts/model/Series} seriesModel + * @param {Object} [opt] + * @param {string} [opt.generateCoord] + */ +function createListFromArray(source, seriesModel, opt) { + opt = opt || {}; + + if (!Source.isInstance(source)) { + source = Source.seriesDataToSource(source); + } + + var coordSysName = seriesModel.get('coordinateSystem'); + var registeredCoordSys = CoordinateSystemManager.get(coordSysName); + + var coordSysDefine = getCoordSysDefineBySeries(seriesModel); + + var coordSysDimDefs; + + if (coordSysDefine) { + coordSysDimDefs = map(coordSysDefine.coordSysDims, function (dim) { + var dimInfo = {name: dim}; + var axisModel = coordSysDefine.axisMap.get(dim); + if (axisModel) { + var axisType = axisModel.get('type'); + dimInfo.type = getDimensionTypeByAxis(axisType); + // dimInfo.stackable = isStackable(axisType); + } + return dimInfo; + }); + } + + if (!coordSysDimDefs) { + // Get dimensions from registered coordinate system + coordSysDimDefs = (registeredCoordSys && ( + registeredCoordSys.getDimensionsInfo + ? registeredCoordSys.getDimensionsInfo() + : registeredCoordSys.dimensions.slice() + )) || ['x', 'y']; + } + + var dimInfoList = createDimensions(source, { + coordDimensions: coordSysDimDefs, + generateCoord: opt.generateCoord + }); + + var firstCategoryDimIndex; + var hasNameEncode; + coordSysDefine && each$1(dimInfoList, function (dimInfo, dimIndex) { + var coordDim = dimInfo.coordDim; + var categoryAxisModel = coordSysDefine.categoryAxisMap.get(coordDim); + if (categoryAxisModel) { + if (firstCategoryDimIndex == null) { + firstCategoryDimIndex = dimIndex; + } + dimInfo.ordinalMeta = categoryAxisModel.getOrdinalMeta(); + } + if (dimInfo.otherDims.itemName != null) { + hasNameEncode = true; + } + }); + if (!hasNameEncode && firstCategoryDimIndex != null) { + dimInfoList[firstCategoryDimIndex].otherDims.itemName = 0; + } + + var stackCalculationInfo = enableDataStack(seriesModel, dimInfoList); + + var list = new List(dimInfoList, seriesModel); + + list.setCalculationInfo(stackCalculationInfo); + + var dimValueGetter = (firstCategoryDimIndex != null && isNeedCompleteOrdinalData(source)) + ? function (itemOpt, dimName, dataIndex, dimIndex) { + // Use dataIndex as ordinal value in categoryAxis + return dimIndex === firstCategoryDimIndex + ? dataIndex + : this.defaultDimValueGetter(itemOpt, dimName, dataIndex, dimIndex); + } + : null; + + list.hasItemOption = false; + list.initData(source, null, dimValueGetter); + + return list; +} + +function isNeedCompleteOrdinalData(source) { + if (source.sourceFormat === SOURCE_FORMAT_ORIGINAL) { + var sampleItem = firstDataNotNull(source.data || []); + return sampleItem != null + && !isArray(getDataItemValue(sampleItem)); + } +} + +function firstDataNotNull(data) { + var i = 0; + while (i < data.length && data[i] == null) { + i++; + } + return data[i]; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * // Scale class management + * @module echarts/scale/Scale + */ + +/** + * @param {Object} [setting] + */ +function Scale(setting) { + this._setting = setting || {}; + + /** + * Extent + * @type {Array.} + * @protected + */ + this._extent = [Infinity, -Infinity]; + + /** + * Step is calculated in adjustExtent + * @type {Array.} + * @protected + */ + this._interval = 0; + + this.init && this.init.apply(this, arguments); +} + +/** + * Parse input val to valid inner number. + * @param {*} val + * @return {number} + */ +Scale.prototype.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; +}; + +Scale.prototype.getSetting = function (name) { + return this._setting[name]; +}; + +Scale.prototype.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} + */ +Scale.prototype.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} + */ +Scale.prototype.scale = function (val) { + var extent = this._extent; + return val * (extent[1] - extent[0]) + extent[0]; +}; + +/** + * Set extent from data + * @param {Array.} other + */ +Scale.prototype.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]); +}; + +/** + * Set extent from data + * @param {module:echarts/data/List} data + * @param {string} dim + */ +Scale.prototype.unionExtentFromData = function (data, dim) { + this.unionExtent(data.getApproximateExtent(dim)); +}; + +/** + * Get extent + * @return {Array.} + */ +Scale.prototype.getExtent = function () { + return this._extent.slice(); +}; + +/** + * Set extent + * @param {number} start + * @param {number} end + */ +Scale.prototype.setExtent = function (start, end) { + var thisExtent = this._extent; + if (!isNaN(start)) { + thisExtent[0] = start; + } + if (!isNaN(end)) { + thisExtent[1] = end; + } +}; + +/** + * When axis extent depends on data and no data exists, + * axis ticks should not be drawn, which is named 'blank'. + */ +Scale.prototype.isBlank = function () { + return this._isBlank; +}, + +/** + * When axis extent depends on data and no data exists, + * axis ticks should not be drawn, which is named 'blank'. + */ +Scale.prototype.setBlank = function (isBlank) { + this._isBlank = isBlank; +}; + +/** + * @abstract + * @param {*} tick + * @return {string} label of the tick. + */ +Scale.prototype.getLabel = null; + + +enableClassExtend(Scale); +enableClassManagement(Scale, { + registerWhenExtend: true +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @constructor + * @param {Object} [opt] + * @param {Object} [opt.categories=[]] + * @param {Object} [opt.needCollect=false] + * @param {Object} [opt.deduplication=false] + */ +function OrdinalMeta(opt) { + + /** + * @readOnly + * @type {Array.} + */ + this.categories = opt.categories || []; + + /** + * @private + * @type {boolean} + */ + this._needCollect = opt.needCollect; + + /** + * @private + * @type {boolean} + */ + this._deduplication = opt.deduplication; + + /** + * @private + * @type {boolean} + */ + this._map; +} + +/** + * @param {module:echarts/model/Model} axisModel + * @return {module:echarts/data/OrdinalMeta} + */ +OrdinalMeta.createByAxisModel = function (axisModel) { + var option = axisModel.option; + var data = option.data; + var categories = data && map(data, getName); + + return new OrdinalMeta({ + categories: categories, + needCollect: !categories, + // deduplication is default in axis. + deduplication: option.dedplication !== false + }); +}; + +var proto$1 = OrdinalMeta.prototype; + +/** + * @param {string} category + * @return {number} ordinal + */ +proto$1.getOrdinal = function (category) { + return getOrCreateMap(this).get(category); +}; + +/** + * @param {*} category + * @return {number} The ordinal. If not found, return NaN. + */ +proto$1.parseAndCollect = function (category) { + var index; + var needCollect = this._needCollect; + + // The value of category dim can be the index of the given category set. + // This feature is only supported when !needCollect, because we should + // consider a common case: a value is 2017, which is a number but is + // expected to be tread as a category. This case usually happen in dataset, + // where it happent to be no need of the index feature. + if (typeof category !== 'string' && !needCollect) { + return category; + } + + // Optimize for the scenario: + // category is ['2012-01-01', '2012-01-02', ...], where the input + // data has been ensured not duplicate and is large data. + // Notice, if a dataset dimension provide categroies, usually echarts + // should remove duplication except user tell echarts dont do that + // (set axis.deduplication = false), because echarts do not know whether + // the values in the category dimension has duplication (consider the + // parallel-aqi example) + if (needCollect && !this._deduplication) { + index = this.categories.length; + this.categories[index] = category; + return index; + } + + var map$$1 = getOrCreateMap(this); + index = map$$1.get(category); + + if (index == null) { + if (needCollect) { + index = this.categories.length; + this.categories[index] = category; + map$$1.set(category, index); + } + else { + index = NaN; + } + } + + return index; +}; + +// Consider big data, do not create map until needed. +function getOrCreateMap(ordinalMeta) { + return ordinalMeta._map || ( + ordinalMeta._map = createHashMap(ordinalMeta.categories) + ); +} + +function getName(obj) { + if (isObject$1(obj) && obj.value != null) { + return obj.value; + } + else { + return obj + ''; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Linear continuous scale + * @module echarts/coord/scale/Ordinal + * + * http://en.wikipedia.org/wiki/Level_of_measurement + */ + +// FIXME only one data + +var scaleProto = Scale.prototype; + +var OrdinalScale = Scale.extend({ + + type: 'ordinal', + + /** + * @param {module:echarts/data/OrdianlMeta|Array.} ordinalMeta + */ + init: function (ordinalMeta, extent) { + // Caution: Should not use instanceof, consider ec-extensions using + // import approach to get OrdinalMeta class. + if (!ordinalMeta || isArray(ordinalMeta)) { + ordinalMeta = new OrdinalMeta({categories: ordinalMeta}); + } + this._ordinalMeta = ordinalMeta; + this._extent = extent || [0, ordinalMeta.categories.length - 1]; + }, + + parse: function (val) { + return typeof val === 'string' + ? this._ordinalMeta.getOrdinal(val) + // val might be float. + : Math.round(val); + }, + + contain: function (rank) { + rank = this.parse(rank); + return scaleProto.contain.call(this, rank) + && this._ordinalMeta.categories[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) { + if (!this.isBlank()) { + // Note that if no data, ordinalMeta.categories is an empty array. + return this._ordinalMeta.categories[n]; + } + }, + + /** + * @return {number} + */ + count: function () { + return this._extent[1] - this._extent[0] + 1; + }, + + /** + * @override + */ + unionExtentFromData: function (data, dim) { + this.unionExtent(data.getApproximateExtent(dim)); + }, + + getOrdinalMeta: function () { + return this._ordinalMeta; + }, + + niceTicks: noop, + niceExtent: noop +}); + +/** + * @return {module:echarts/scale/Time} + */ +OrdinalScale.create = function () { + return new OrdinalScale(); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * For testable. + */ + +var roundNumber$1 = round$1; + +/** + * @param {Array.} extent Both extent[0] and extent[1] should be valid number. + * Should be extent[0] < extent[1]. + * @param {number} splitNumber splitNumber should be >= 1. + * @param {number} [minInterval] + * @param {number} [maxInterval] + * @return {Object} {interval, intervalPrecision, niceTickExtent} + */ +function intervalScaleNiceTicks(extent, splitNumber, minInterval, maxInterval) { + var result = {}; + var span = extent[1] - extent[0]; + + var interval = result.interval = nice(span / splitNumber, true); + if (minInterval != null && interval < minInterval) { + interval = result.interval = minInterval; + } + if (maxInterval != null && interval > maxInterval) { + interval = result.interval = maxInterval; + } + // Tow more digital for tick. + var precision = result.intervalPrecision = getIntervalPrecision(interval); + // Niced extent inside original extent + var niceTickExtent = result.niceTickExtent = [ + roundNumber$1(Math.ceil(extent[0] / interval) * interval, precision), + roundNumber$1(Math.floor(extent[1] / interval) * interval, precision) + ]; + + fixExtent(niceTickExtent, extent); + + return result; +} + +/** + * @param {number} interval + * @return {number} interval precision + */ +function getIntervalPrecision(interval) { + // Tow more digital for tick. + return getPrecisionSafe(interval) + 2; +} + +function clamp(niceTickExtent, idx, extent) { + niceTickExtent[idx] = Math.max(Math.min(niceTickExtent[idx], extent[1]), extent[0]); +} + +// In some cases (e.g., splitNumber is 1), niceTickExtent may be out of extent. +function fixExtent(niceTickExtent, extent) { + !isFinite(niceTickExtent[0]) && (niceTickExtent[0] = extent[0]); + !isFinite(niceTickExtent[1]) && (niceTickExtent[1] = extent[1]); + clamp(niceTickExtent, 0, extent); + clamp(niceTickExtent, 1, extent); + if (niceTickExtent[0] > niceTickExtent[1]) { + niceTickExtent[0] = niceTickExtent[1]; + } +} + +function intervalScaleGetTicks(interval, extent, niceTickExtent, intervalPrecision) { + var ticks = []; + + // If interval is 0, return []; + if (!interval) { + return ticks; + } + + // Consider this case: using dataZoom toolbox, zoom and zoom. + var safeLimit = 10000; + + if (extent[0] < niceTickExtent[0]) { + ticks.push(extent[0]); + } + var tick = niceTickExtent[0]; + + while (tick <= niceTickExtent[1]) { + ticks.push(tick); + // Avoid rounding error + tick = roundNumber$1(tick + interval, intervalPrecision); + if (tick === ticks[ticks.length - 1]) { + // Consider out of safe float point, e.g., + // -3711126.9907707 + 2e-10 === -3711126.9907707 + break; + } + if (ticks.length > safeLimit) { + return []; + } + } + // Consider this case: the last item of ticks is smaller + // than niceTickExtent[1] and niceTickExtent[1] === extent[1]. + if (extent[1] > (ticks.length ? ticks[ticks.length - 1] : niceTickExtent[1])) { + ticks.push(extent[1]); + } + + return ticks; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Interval scale + * @module echarts/scale/Interval + */ + + +var roundNumber = round$1; + +/** + * @alias module:echarts/coord/scale/Interval + * @constructor + */ +var IntervalScale = Scale.extend({ + + type: 'interval', + + _interval: 0, + + _intervalPrecision: 2, + + 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 () { + 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(); + + this._intervalPrecision = getIntervalPrecision(interval); + }, + + /** + * @return {Array.} + */ + getTicks: function () { + return intervalScaleGetTicks( + this._interval, this._extent, this._niceExtent, this._intervalPrecision + ); + }, + + /** + * @param {number} data + * @param {Object} [opt] + * @param {number|string} [opt.precision] If 'auto', use nice presision. + * @param {boolean} [opt.pad] returns 1.50 but not 1.5 if precision is 2. + * @return {string} + */ + getLabel: function (data, opt) { + if (data == null) { + return ''; + } + + var precision = opt && opt.precision; + + if (precision == null) { + precision = getPrecisionSafe(data) || 0; + } + else if (precision === 'auto') { + // Should be more precise then tick. + precision = this._intervalPrecision; + } + + // (1) If `precision` is set, 12.005 should be display as '12.00500'. + // (2) Use roundNumber (toFixed) to avoid scientific notation like '3.5e-7'. + data = roundNumber(data, precision, true); + + return addCommas(data); + }, + + /** + * Update interval and extent of intervals for nice ticks + * + * @param {number} [splitNumber = 5] Desired number of ticks + * @param {number} [minInterval] + * @param {number} [maxInterval] + */ + niceTicks: function (splitNumber, minInterval, maxInterval) { + 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(); + } + + var result = intervalScaleNiceTicks( + extent, splitNumber, minInterval, maxInterval + ); + + this._intervalPrecision = result.intervalPrecision; + this._interval = result.interval; + this._niceExtent = result.niceTickExtent; + }, + + /** + * Nice extent. + * @param {Object} opt + * @param {number} [opt.splitNumber = 5] Given approx tick number + * @param {boolean} [opt.fixMin=false] + * @param {boolean} [opt.fixMax=false] + * @param {boolean} [opt.minInterval] + * @param {boolean} [opt.maxInterval] + */ + niceExtent: function (opt) { + 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]; + // In the fowllowing case + // Axis has been fixed max 100 + // Plus data are all 100 and axis extent are [100, 100]. + // Extend to the both side will cause expanded max is larger than fixed max. + // So only expand to the smaller side. + if (!opt.fixMax) { + extent[1] += expandSize / 2; + extent[0] -= expandSize / 2; + } + else { + extent[0] -= expandSize / 2; + } + } + 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(opt.splitNumber, opt.minInterval, opt.maxInterval); + + // var extent = this._extent; + var interval = this._interval; + + if (!opt.fixMin) { + extent[0] = roundNumber(Math.floor(extent[0] / interval) * interval); + } + if (!opt.fixMax) { + extent[1] = roundNumber(Math.ceil(extent[1] / interval) * interval); + } + } +}); + +/** + * @return {module:echarts/scale/Time} + */ +IntervalScale.create = function () { + return new IntervalScale(); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 STACK_PREFIX = '__ec_stack_'; +var LARGE_BAR_MIN_WIDTH = 0.5; + +var LargeArr = typeof Float32Array !== 'undefined' ? Float32Array : Array; + +function getSeriesStackId(seriesModel) { + return seriesModel.get('stack') || STACK_PREFIX + seriesModel.seriesIndex; +} + +function getAxisKey(axis) { + return axis.dim + axis.index; +} + +/** + * @param {Object} opt + * @param {module:echarts/coord/Axis} opt.axis Only support category axis currently. + * @param {number} opt.count Positive interger. + * @param {number} [opt.barWidth] + * @param {number} [opt.barMaxWidth] + * @param {number} [opt.barGap] + * @param {number} [opt.barCategoryGap] + * @return {Object} {width, offset, offsetCenter} If axis.type is not 'category', return undefined. + */ +function getLayoutOnAxis(opt) { + var params = []; + var baseAxis = opt.axis; + var axisKey = 'axis0'; + + if (baseAxis.type !== 'category') { + return; + } + var bandWidth = baseAxis.getBandWidth(); + + for (var i = 0; i < opt.count || 0; i++) { + params.push(defaults({ + bandWidth: bandWidth, + axisKey: axisKey, + stackId: STACK_PREFIX + i + }, opt)); + } + var widthAndOffsets = doCalBarWidthAndOffset(params); + + var result = []; + for (var i = 0; i < opt.count; i++) { + var item = widthAndOffsets[axisKey][STACK_PREFIX + i]; + item.offsetCenter = item.offset + item.width / 2; + result.push(item); + } + + return result; +} + +function prepareLayoutBarSeries(seriesType, ecModel) { + var seriesModels = []; + ecModel.eachSeriesByType(seriesType, function (seriesModel) { + // Check series coordinate, do layout for cartesian2d only + if (isOnCartesian(seriesModel) && !isInLargeMode(seriesModel)) { + seriesModels.push(seriesModel); + } + }); + return seriesModels; +} + +function makeColumnLayout(barSeries) { + var seriesInfoList = []; + each$1(barSeries, function (seriesModel) { + var data = seriesModel.getData(); + var cartesian = seriesModel.coordinateSystem; + var baseAxis = cartesian.getBaseAxis(); + var axisExtent = baseAxis.getExtent(); + var bandWidth = baseAxis.type === 'category' + ? baseAxis.getBandWidth() + : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count()); + + var barWidth = parsePercent$1( + seriesModel.get('barWidth'), bandWidth + ); + var barMaxWidth = parsePercent$1( + seriesModel.get('barMaxWidth'), bandWidth + ); + var barGap = seriesModel.get('barGap'); + var barCategoryGap = seriesModel.get('barCategoryGap'); + + seriesInfoList.push({ + bandWidth: bandWidth, + barWidth: barWidth, + barMaxWidth: barMaxWidth, + barGap: barGap, + barCategoryGap: barCategoryGap, + axisKey: getAxisKey(baseAxis), + stackId: getSeriesStackId(seriesModel) + }); + }); + + return doCalBarWidthAndOffset(seriesInfoList); +} + +function doCalBarWidthAndOffset(seriesInfoList) { + // Columns info on each category axis. Key is cartesian name + var columnsMap = {}; + + each$1(seriesInfoList, function (seriesInfo, idx) { + var axisKey = seriesInfo.axisKey; + var bandWidth = seriesInfo.bandWidth; + var columnsOnAxis = columnsMap[axisKey] || { + bandWidth: bandWidth, + remainedWidth: bandWidth, + autoWidthCount: 0, + categoryGap: '20%', + gap: '30%', + stacks: {} + }; + var stacks = columnsOnAxis.stacks; + columnsMap[axisKey] = columnsOnAxis; + + var stackId = seriesInfo.stackId; + + if (!stacks[stackId]) { + columnsOnAxis.autoWidthCount++; + } + stacks[stackId] = stacks[stackId] || { + width: 0, + maxWidth: 0 + }; + + // Caution: In a single coordinate system, these barGrid attributes + // will be shared by series. Consider that they have default values, + // only the attributes set on the last series will work. + // Do not change this fact unless there will be a break change. + + // TODO + var barWidth = seriesInfo.barWidth; + if (barWidth && !stacks[stackId].width) { + // See #6312, do not restrict width. + stacks[stackId].width = barWidth; + barWidth = Math.min(columnsOnAxis.remainedWidth, barWidth); + columnsOnAxis.remainedWidth -= barWidth; + } + + var barMaxWidth = seriesInfo.barMaxWidth; + barMaxWidth && (stacks[stackId].maxWidth = barMaxWidth); + var barGap = seriesInfo.barGap; + (barGap != null) && (columnsOnAxis.gap = barGap); + var barCategoryGap = seriesInfo.barCategoryGap; + (barCategoryGap != null) && (columnsOnAxis.categoryGap = barCategoryGap); + }); + + var result = {}; + + each$1(columnsMap, function (columnsOnAxis, coordSysName) { + + result[coordSysName] = {}; + + var stacks = columnsOnAxis.stacks; + var bandWidth = columnsOnAxis.bandWidth; + var categoryGap = parsePercent$1(columnsOnAxis.categoryGap, bandWidth); + var barGapPercent = parsePercent$1(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 + each$1(stacks, function (column, stack) { + var maxWidth = column.maxWidth; + if (maxWidth && maxWidth < autoWidth) { + maxWidth = Math.min(maxWidth, remainedWidth); + if (column.width) { + maxWidth = Math.min(maxWidth, column.width); + } + 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; + each$1(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; + each$1(stacks, function (column, stackId) { + result[coordSysName][stackId] = result[coordSysName][stackId] || { + offset: offset, + width: column.width + }; + + offset += column.width * (1 + barGapPercent); + }); + }); + + return result; +} + +/** + * @param {Object} barWidthAndOffset The result of makeColumnLayout + * @param {module:echarts/coord/Axis} axis + * @param {module:echarts/model/Series} [seriesModel] If not provided, return all. + * @return {Object} {stackId: {offset, width}} or {offset, width} if seriesModel provided. + */ +function retrieveColumnLayout(barWidthAndOffset, axis, seriesModel) { + if (barWidthAndOffset && axis) { + var result = barWidthAndOffset[getAxisKey(axis)]; + if (result != null && seriesModel != null) { + result = result[getSeriesStackId(seriesModel)]; + } + return result; + } +} + +/** + * @param {string} seriesType + * @param {module:echarts/model/Global} ecModel + */ +function layout(seriesType, ecModel) { + + var seriesModels = prepareLayoutBarSeries(seriesType, ecModel); + var barWidthAndOffset = makeColumnLayout(seriesModels); + + var lastStackCoords = {}; + each$1(seriesModels, function (seriesModel) { + + var data = seriesModel.getData(); + var cartesian = seriesModel.coordinateSystem; + var baseAxis = cartesian.getBaseAxis(); + + var stackId = getSeriesStackId(seriesModel); + var columnLayoutInfo = barWidthAndOffset[getAxisKey(baseAxis)][stackId]; + var columnOffset = columnLayoutInfo.offset; + var columnWidth = columnLayoutInfo.width; + var valueAxis = cartesian.getOtherAxis(baseAxis); + + var barMinHeight = seriesModel.get('barMinHeight') || 0; + + lastStackCoords[stackId] = lastStackCoords[stackId] || []; + data.setLayout({ + offset: columnOffset, + size: columnWidth + }); + + var valueDim = data.mapDimension(valueAxis.dim); + var baseDim = data.mapDimension(baseAxis.dim); + var stacked = isDimensionStacked(data, valueDim /*, baseDim*/); + var isValueAxisH = valueAxis.isHorizontal(); + + var valueAxisStart = getValueAxisStart(baseAxis, valueAxis, stacked); + + for (var idx = 0, len = data.count(); idx < len; idx++) { + var value = data.get(valueDim, idx); + var baseValue = data.get(baseDim, idx); + + if (isNaN(value)) { + continue; + } + + var sign = value >= 0 ? 'p' : 'n'; + var baseCoord = valueAxisStart; + + // Because of the barMinHeight, we can not use the value in + // stackResultDimension directly. + if (stacked) { + // Only ordinal axis can be stacked. + if (!lastStackCoords[stackId][baseValue]) { + lastStackCoords[stackId][baseValue] = { + p: valueAxisStart, // Positive stack + n: valueAxisStart // Negative stack + }; + } + // Should also consider #4243 + baseCoord = lastStackCoords[stackId][baseValue][sign]; + } + + var x; + var y; + var width; + var height; + + if (isValueAxisH) { + var coord = cartesian.dataToPoint([value, baseValue]); + x = baseCoord; + y = coord[1] + columnOffset; + width = coord[0] - valueAxisStart; + height = columnWidth; + + if (Math.abs(width) < barMinHeight) { + width = (width < 0 ? -1 : 1) * barMinHeight; + } + stacked && (lastStackCoords[stackId][baseValue][sign] += width); + } + else { + var coord = cartesian.dataToPoint([baseValue, value]); + x = coord[0] + columnOffset; + y = baseCoord; + width = columnWidth; + height = coord[1] - valueAxisStart; + + if (Math.abs(height) < barMinHeight) { + // Include zero to has a positive bar + height = (height <= 0 ? -1 : 1) * barMinHeight; + } + stacked && (lastStackCoords[stackId][baseValue][sign] += height); + } + + data.setItemLayout(idx, { + x: x, + y: y, + width: width, + height: height + }); + } + + }, this); +} + +// TODO: Do not support stack in large mode yet. +var largeLayout = { + + seriesType: 'bar', + + plan: createRenderPlanner(), + + reset: function (seriesModel) { + if (!isOnCartesian(seriesModel) || !isInLargeMode(seriesModel)) { + return; + } + + var data = seriesModel.getData(); + var cartesian = seriesModel.coordinateSystem; + var baseAxis = cartesian.getBaseAxis(); + var valueAxis = cartesian.getOtherAxis(baseAxis); + var valueDim = data.mapDimension(valueAxis.dim); + var baseDim = data.mapDimension(baseAxis.dim); + var valueAxisHorizontal = valueAxis.isHorizontal(); + var valueDimIdx = valueAxisHorizontal ? 0 : 1; + + var barWidth = retrieveColumnLayout( + makeColumnLayout([seriesModel]), baseAxis, seriesModel + ).width; + if (!(barWidth > LARGE_BAR_MIN_WIDTH)) { // jshint ignore:line + barWidth = LARGE_BAR_MIN_WIDTH; + } + + return {progress: progress}; + + function progress(params, data) { + var largePoints = new LargeArr(params.count * 2); + var dataIndex; + var coord = []; + var valuePair = []; + var offset = 0; + + while ((dataIndex = params.next()) != null) { + valuePair[valueDimIdx] = data.get(valueDim, dataIndex); + valuePair[1 - valueDimIdx] = data.get(baseDim, dataIndex); + + coord = cartesian.dataToPoint(valuePair, null, coord); + largePoints[offset++] = coord[0]; + largePoints[offset++] = coord[1]; + } + + data.setLayout({ + largePoints: largePoints, + barWidth: barWidth, + valueAxisStart: getValueAxisStart(baseAxis, valueAxis, false), + valueAxisHorizontal: valueAxisHorizontal + }); + } + } +}; + +function isOnCartesian(seriesModel) { + return seriesModel.coordinateSystem && seriesModel.coordinateSystem.type === 'cartesian2d'; +} + +function isInLargeMode(seriesModel) { + return seriesModel.pipelineContext && seriesModel.pipelineContext.large; +} + +function getValueAxisStart(baseAxis, valueAxis, stacked) { + return ( + indexOf(baseAxis.getAxesOnZeroOf(), valueAxis) >= 0 + || stacked + ) + ? valueAxis.toGlobalCoord(valueAxis.dataToCoord(0)) + : valueAxis.getGlobalExtent()[0]; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* The `scaleLevels` references to d3.js. The use of the source +* code of this file is also subject to the terms and consitions +* of its license (BSD-3Clause, see ). +*/ + +// [About UTC and local time zone]: +// In most cases, `number.parseDate` will treat input data string as local time +// (except time zone is specified in time string). And `format.formateTime` returns +// local time by default. option.useUTC is false by default. This design have +// concidered these common case: +// (1) Time that is persistent in server is in UTC, but it is needed to be diplayed +// in local time by default. +// (2) By default, the input data string (e.g., '2011-01-02') should be displayed +// as its original time, without any time difference. + +var intervalScaleProto = IntervalScale.prototype; + +var mathCeil = Math.ceil; +var mathFloor = Math.floor; +var ONE_SECOND = 1000; +var ONE_MINUTE = ONE_SECOND * 60; +var ONE_HOUR = ONE_MINUTE * 60; +var ONE_DAY = ONE_HOUR * 24; + +// FIXME 公用? +var bisect = function (a, x, lo, hi) { + while (lo < hi) { + var mid = lo + hi >>> 1; + if (a[mid][1] < x) { + lo = mid + 1; + } + else { + hi = mid; + } + } + return lo; +}; + +/** + * @alias module:echarts/coord/scale/Time + * @constructor + */ +var TimeScale = IntervalScale.extend({ + type: 'time', + + /** + * @override + */ + getLabel: function (val) { + var stepLvl = this._stepLvl; + + var date = new Date(val); + + return formatTime(stepLvl[0], date, this.getSetting('useUTC')); + }, + + /** + * @override + */ + niceExtent: function (opt) { + 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(opt.splitNumber, opt.minInterval, opt.maxInterval); + + // var extent = this._extent; + var interval = this._interval; + + if (!opt.fixMin) { + extent[0] = round$1(mathFloor(extent[0] / interval) * interval); + } + if (!opt.fixMax) { + extent[1] = round$1(mathCeil(extent[1] / interval) * interval); + } + }, + + /** + * @override + */ + niceTicks: function (approxTickNum, minInterval, maxInterval) { + approxTickNum = approxTickNum || 10; + + var extent = this._extent; + var span = extent[1] - extent[0]; + var approxInterval = span / approxTickNum; + + if (minInterval != null && approxInterval < minInterval) { + approxInterval = minInterval; + } + if (maxInterval != null && approxInterval > maxInterval) { + approxInterval = maxInterval; + } + + var scaleLevelsLen = scaleLevels.length; + var idx = bisect(scaleLevels, approxInterval, 0, scaleLevelsLen); + + var level = scaleLevels[Math.min(idx, scaleLevelsLen - 1)]; + var interval = level[1]; + // 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 = nice(yearSpan / approxTickNum, true); + + interval *= yearStep; + } + + var timezoneOffset = this.getSetting('useUTC') + ? 0 : (new Date(+extent[0] || +extent[1])).getTimezoneOffset() * 60 * 1000; + var niceExtent = [ + Math.round(mathCeil((extent[0] - timezoneOffset) / interval) * interval + timezoneOffset), + Math.round(mathFloor((extent[1] - timezoneOffset) / interval) * interval + timezoneOffset) + ]; + + fixExtent(niceExtent, extent); + + this._stepLvl = level; + // Interval will be used in getTicks + this._interval = interval; + this._niceExtent = niceExtent; + }, + + parse: function (val) { + // val might be float. + return +parseDate(val); + } +}); + +each$1(['contain', 'normalize'], function (methodName) { + TimeScale.prototype[methodName] = function (val) { + return intervalScaleProto[methodName].call(this, this.parse(val)); + }; +}); + +// Steps from d3, see the license statement at the top of this file. +var scaleLevels = [ + // Format interval + ['hh:mm:ss', ONE_SECOND], // 1s + ['hh:mm:ss', ONE_SECOND * 5], // 5s + ['hh:mm:ss', ONE_SECOND * 10], // 10s + ['hh:mm:ss', ONE_SECOND * 15], // 15s + ['hh:mm:ss', ONE_SECOND * 30], // 30s + ['hh:mm\nMM-dd', ONE_MINUTE], // 1m + ['hh:mm\nMM-dd', ONE_MINUTE * 5], // 5m + ['hh:mm\nMM-dd', ONE_MINUTE * 10], // 10m + ['hh:mm\nMM-dd', ONE_MINUTE * 15], // 15m + ['hh:mm\nMM-dd', ONE_MINUTE * 30], // 30m + ['hh:mm\nMM-dd', ONE_HOUR], // 1h + ['hh:mm\nMM-dd', ONE_HOUR * 2], // 2h + ['hh:mm\nMM-dd', ONE_HOUR * 6], // 6h + ['hh:mm\nMM-dd', ONE_HOUR * 12], // 12h + ['MM-dd\nyyyy', ONE_DAY], // 1d + ['MM-dd\nyyyy', ONE_DAY * 2], // 2d + ['MM-dd\nyyyy', ONE_DAY * 3], // 3d + ['MM-dd\nyyyy', ONE_DAY * 4], // 4d + ['MM-dd\nyyyy', ONE_DAY * 5], // 5d + ['MM-dd\nyyyy', ONE_DAY * 6], // 6d + ['week', ONE_DAY * 7], // 7d + ['MM-dd\nyyyy', ONE_DAY * 10], // 10d + ['week', ONE_DAY * 14], // 2w + ['week', ONE_DAY * 21], // 3w + ['month', ONE_DAY * 31], // 1M + ['week', ONE_DAY * 42], // 6w + ['month', ONE_DAY * 62], // 2M + ['week', ONE_DAY * 70], // 10w + ['quarter', ONE_DAY * 95], // 3M + ['month', ONE_DAY * 31 * 4], // 4M + ['month', ONE_DAY * 31 * 5], // 5M + ['half-year', ONE_DAY * 380 / 2], // 6M + ['month', ONE_DAY * 31 * 8], // 8M + ['month', ONE_DAY * 31 * 10], // 10M + ['year', ONE_DAY * 380] // 1Y +]; + +/** + * @param {module:echarts/model/Model} + * @return {module:echarts/scale/Time} + */ +TimeScale.create = function (model) { + return new TimeScale({useUTC: model.ecModel.get('useUTC')}); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Log scale + * @module echarts/scale/Log + */ + +// Use some method of IntervalScale +var scaleProto$1 = Scale.prototype; +var intervalScaleProto$1 = IntervalScale.prototype; + +var getPrecisionSafe$1 = getPrecisionSafe; +var roundingErrorFix = round$1; + +var mathFloor$1 = Math.floor; +var mathCeil$1 = Math.ceil; +var mathPow$1 = Math.pow; + +var mathLog = Math.log; + +var LogScale = Scale.extend({ + + type: 'log', + + base: 10, + + $constructor: function () { + Scale.apply(this, arguments); + this._originalScale = new IntervalScale(); + }, + + /** + * @return {Array.} + */ + getTicks: function () { + var originalScale = this._originalScale; + var extent = this._extent; + var originalExtent = originalScale.getExtent(); + + return map(intervalScaleProto$1.getTicks.call(this), function (val) { + var powVal = round$1(mathPow$1(this.base, val)); + + // Fix #4158 + powVal = (val === extent[0] && originalScale.__fixMin) + ? fixRoundingError(powVal, originalExtent[0]) + : powVal; + powVal = (val === extent[1] && originalScale.__fixMax) + ? fixRoundingError(powVal, originalExtent[1]) + : powVal; + + return powVal; + }, this); + }, + + /** + * @param {number} val + * @return {string} + */ + getLabel: intervalScaleProto$1.getLabel, + + /** + * @param {number} val + * @return {number} + */ + scale: function (val) { + val = scaleProto$1.scale.call(this, val); + return mathPow$1(this.base, val); + }, + + /** + * @param {number} start + * @param {number} end + */ + setExtent: function (start, end) { + var base = this.base; + start = mathLog(start) / mathLog(base); + end = mathLog(end) / mathLog(base); + intervalScaleProto$1.setExtent.call(this, start, end); + }, + + /** + * @return {number} end + */ + getExtent: function () { + var base = this.base; + var extent = scaleProto$1.getExtent.call(this); + extent[0] = mathPow$1(base, extent[0]); + extent[1] = mathPow$1(base, extent[1]); + + // Fix #4158 + var originalScale = this._originalScale; + var originalExtent = originalScale.getExtent(); + originalScale.__fixMin && (extent[0] = fixRoundingError(extent[0], originalExtent[0])); + originalScale.__fixMax && (extent[1] = fixRoundingError(extent[1], originalExtent[1])); + + return extent; + }, + + /** + * @param {Array.} extent + */ + unionExtent: function (extent) { + this._originalScale.unionExtent(extent); + + var base = this.base; + extent[0] = mathLog(extent[0]) / mathLog(base); + extent[1] = mathLog(extent[1]) / mathLog(base); + scaleProto$1.unionExtent.call(this, extent); + }, + + /** + * @override + */ + unionExtentFromData: function (data, dim) { + // TODO + // filter value that <= 0 + this.unionExtent(data.getApproximateExtent(dim)); + }, + + /** + * 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 = quantity(span); + var err = approxTickNum / span * interval; + + // Filter ticks to get closer to the desired count. + if (err <= 0.5) { + interval *= 10; + } + + // Interval should be integer + while (!isNaN(interval) && Math.abs(interval) < 1 && Math.abs(interval) > 0) { + interval *= 10; + } + + var niceExtent = [ + round$1(mathCeil$1(extent[0] / interval) * interval), + round$1(mathFloor$1(extent[1] / interval) * interval) + ]; + + this._interval = interval; + this._niceExtent = niceExtent; + }, + + /** + * Nice extent. + * @override + */ + niceExtent: function (opt) { + intervalScaleProto$1.niceExtent.call(this, opt); + + var originalScale = this._originalScale; + originalScale.__fixMin = opt.fixMin; + originalScale.__fixMax = opt.fixMax; + } + +}); + +each$1(['contain', 'normalize'], function (methodName) { + LogScale.prototype[methodName] = function (val) { + val = mathLog(val) / mathLog(this.base); + return scaleProto$1[methodName].call(this, val); + }; +}); + +LogScale.create = function () { + return new LogScale(); +}; + +function fixRoundingError(val, originalVal) { + return roundingErrorFix(val, getPrecisionSafe$1(originalVal)); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Get axis scale extent before niced. + * Item of returned array can only be number (including Infinity and NaN). + */ +function getScaleExtent(scale, model) { + var scaleType = scale.type; + + var min = model.getMin(); + var max = model.getMax(); + var fixMin = min != null; + var fixMax = max != null; + var originalExtent = scale.getExtent(); + + var axisDataLen; + var boundaryGap; + var span; + if (scaleType === 'ordinal') { + axisDataLen = model.getCategories().length; + } + else { + boundaryGap = model.get('boundaryGap'); + if (!isArray(boundaryGap)) { + boundaryGap = [boundaryGap || 0, boundaryGap || 0]; + } + if (typeof boundaryGap[0] === 'boolean') { + if (__DEV__) { + console.warn('Boolean type for boundaryGap is only ' + + 'allowed for ordinal axis. Please use string in ' + + 'percentage instead, e.g., "20%". Currently, ' + + 'boundaryGap is set to be 0.'); + } + boundaryGap = [0, 0]; + } + boundaryGap[0] = parsePercent$1(boundaryGap[0], 1); + boundaryGap[1] = parsePercent$1(boundaryGap[1], 1); + span = (originalExtent[1] - originalExtent[0]) + || Math.abs(originalExtent[0]); + } + + // Notice: When min/max is not set (that is, when there are null/undefined, + // which is the most common case), these cases should be ensured: + // (1) For 'ordinal', show all axis.data. + // (2) For others: + // + `boundaryGap` is applied (if min/max set, boundaryGap is + // disabled). + // + If `needCrossZero`, min/max should be zero, otherwise, min/max should + // be the result that originalExtent enlarged by boundaryGap. + // (3) If no data, it should be ensured that `scale.setBlank` is set. + + // FIXME + // (1) When min/max is 'dataMin' or 'dataMax', should boundaryGap be able to used? + // (2) When `needCrossZero` and all data is positive/negative, should it be ensured + // that the results processed by boundaryGap are positive/negative? + + if (min == null) { + min = scaleType === 'ordinal' + ? (axisDataLen ? 0 : NaN) + : originalExtent[0] - boundaryGap[0] * span; + } + if (max == null) { + max = scaleType === 'ordinal' + ? (axisDataLen ? axisDataLen - 1 : NaN) + : originalExtent[1] + boundaryGap[1] * span; + } + + if (min === 'dataMin') { + min = originalExtent[0]; + } + else if (typeof min === 'function') { + min = min({ + min: originalExtent[0], + max: originalExtent[1] + }); + } + + if (max === 'dataMax') { + max = originalExtent[1]; + } + else if (typeof max === 'function') { + max = max({ + min: originalExtent[0], + max: originalExtent[1] + }); + } + + (min == null || !isFinite(min)) && (min = NaN); + (max == null || !isFinite(max)) && (max = NaN); + + scale.setBlank( + eqNaN(min) + || eqNaN(max) + || (scaleType === 'ordinal' && !scale.getOrdinalMeta().categories.length) + ); + + // Evaluate if axis needs cross zero + if (model.getNeedCrossZero()) { + // 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; + } + } + + // If bars are placed on a base axis of type time or interval account for axis boundary overflow and current axis + // is base axis + // FIXME + // (1) Consider support value axis, where below zero and axis `onZero` should be handled properly. + // (2) Refactor the logic with `barGrid`. Is it not need to `makeBarWidthAndOffsetInfo` twice with different extent? + // Should not depend on series type `bar`? + // (3) Fix that might overlap when using dataZoom. + // (4) Consider other chart types using `barGrid`? + // See #6728, #4862, `test/bar-overflow-time-plot.html` + var ecModel = model.ecModel; + if (ecModel && (scaleType === 'time' /*|| scaleType === 'interval' */)) { + var barSeriesModels = prepareLayoutBarSeries('bar', ecModel); + var isBaseAxisAndHasBarSeries; + + each$1(barSeriesModels, function (seriesModel) { + isBaseAxisAndHasBarSeries |= seriesModel.getBaseAxis() === model.axis; + }); + + if (isBaseAxisAndHasBarSeries) { + // Calculate placement of bars on axis + var barWidthAndOffset = makeColumnLayout(barSeriesModels); + + // Adjust axis min and max to account for overflow + var adjustedScale = adjustScaleForOverflow(min, max, model, barWidthAndOffset); + min = adjustedScale.min; + max = adjustedScale.max; + } + } + + return [min, max]; +} + +function adjustScaleForOverflow(min, max, model, barWidthAndOffset) { + + // Get Axis Length + var axisExtent = model.axis.getExtent(); + var axisLength = axisExtent[1] - axisExtent[0]; + + // Get bars on current base axis and calculate min and max overflow + var barsOnCurrentAxis = retrieveColumnLayout(barWidthAndOffset, model.axis); + if (barsOnCurrentAxis === undefined) { + return {min: min, max: max}; + } + + var minOverflow = Infinity; + each$1(barsOnCurrentAxis, function (item) { + minOverflow = Math.min(item.offset, minOverflow); + }); + var maxOverflow = -Infinity; + each$1(barsOnCurrentAxis, function (item) { + maxOverflow = Math.max(item.offset + item.width, maxOverflow); + }); + minOverflow = Math.abs(minOverflow); + maxOverflow = Math.abs(maxOverflow); + var totalOverFlow = minOverflow + maxOverflow; + + // Calulate required buffer based on old range and overflow + var oldRange = max - min; + var oldRangePercentOfNew = (1 - (minOverflow + maxOverflow) / axisLength); + var overflowBuffer = ((oldRange / oldRangePercentOfNew) - oldRange); + + max += overflowBuffer * (maxOverflow / totalOverFlow); + min -= overflowBuffer * (minOverflow / totalOverFlow); + + return {min: min, max: max}; +} + +function niceScaleExtent(scale, model) { + var extent = getScaleExtent(scale, model); + var fixMin = model.getMin() != null; + var fixMax = model.getMax() != null; + var splitNumber = model.get('splitNumber'); + + if (scale.type === 'log') { + scale.base = model.get('logBase'); + } + + var scaleType = scale.type; + scale.setExtent(extent[0], extent[1]); + scale.niceExtent({ + splitNumber: splitNumber, + fixMin: fixMin, + fixMax: fixMax, + minInterval: (scaleType === 'interval' || scaleType === 'time') + ? model.get('minInterval') : null, + maxInterval: (scaleType === 'interval' || scaleType === 'time') + ? model.get('maxInterval') : null + }); + + // 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/*} + */ +function createScaleByModel(model, axisType) { + axisType = axisType || model.get('type'); + if (axisType) { + switch (axisType) { + // Buildin scale + case 'category': + return new OrdinalScale( + model.getOrdinalMeta + ? model.getOrdinalMeta() + : 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 + */ +function ifAxisCrossZero(axis) { + var dataExtent = axis.scale.getExtent(); + var min = dataExtent[0]; + var max = dataExtent[1]; + return !((min > 0 && max > 0) || (min < 0 && max < 0)); +} + +/** + * @param {module:echarts/coord/Axis} axis + * @return {Function} Label formatter function. + * param: {number} tickValue, + * param: {number} idx, the index in all ticks. + * If category axis, this param is not requied. + * return: {string} label string. + */ +function makeLabelFormatter(axis) { + var labelFormatter = axis.getLabelModel().get('formatter'); + var categoryTickStart = axis.type === 'category' ? axis.scale.getExtent()[0] : null; + + if (typeof labelFormatter === 'string') { + labelFormatter = (function (tpl) { + return function (val) { + // For category axis, get raw value; for numeric axis, + // get foramtted label like '1,333,444'. + val = axis.scale.getLabel(val); + return tpl.replace('{value}', val != null ? val : ''); + }; + })(labelFormatter); + // Consider empty array + return labelFormatter; + } + else if (typeof labelFormatter === 'function') { + return function (tickValue, idx) { + // The original intention of `idx` is "the index of the tick in all ticks". + // But the previous implementation of category axis do not consider the + // `axisLabel.interval`, which cause that, for example, the `interval` is + // `1`, then the ticks "name5", "name7", "name9" are displayed, where the + // corresponding `idx` are `0`, `2`, `4`, but not `0`, `1`, `2`. So we keep + // the definition here for back compatibility. + if (categoryTickStart != null) { + idx = tickValue - categoryTickStart; + } + return labelFormatter(getAxisRawValue(axis, tickValue), idx); + }; + } + else { + return function (tick) { + return axis.scale.getLabel(tick); + }; + } +} + +function getAxisRawValue(axis, value) { + // In category axis with data zoom, tick is not the original + // index of axis.data. So tick should not be exposed to user + // in category axis. + return axis.type === 'category' ? axis.scale.getLabel(value) : value; +} + +/** + * @param {module:echarts/coord/Axis} axis + * @return {module:zrender/core/BoundingRect} Be null/undefined if no labels. + */ +function estimateLabelUnionRect(axis) { + var axisModel = axis.model; + var scale = axis.scale; + + if (!axisModel.get('axisLabel.show') || scale.isBlank()) { + return; + } + + var isCategory = axis.type === 'category'; + + var realNumberScaleTicks; + var tickCount; + var categoryScaleExtent = scale.getExtent(); + + // Optimize for large category data, avoid call `getTicks()`. + if (isCategory) { + tickCount = scale.count(); + } + else { + realNumberScaleTicks = scale.getTicks(); + tickCount = realNumberScaleTicks.length; + } + + var axisLabelModel = axis.getLabelModel(); + var labelFormatter = makeLabelFormatter(axis); + + var rect; + var step = 1; + // Simple optimization for large amount of labels + if (tickCount > 40) { + step = Math.ceil(tickCount / 40); + } + for (var i = 0; i < tickCount; i += step) { + var tickValue = realNumberScaleTicks ? realNumberScaleTicks[i] : categoryScaleExtent[0] + i; + var label = labelFormatter(tickValue); + var unrotatedSingleRect = axisLabelModel.getTextRect(label); + var singleRect = rotateTextRect(unrotatedSingleRect, axisLabelModel.get('rotate') || 0); + + rect ? rect.union(singleRect) : (rect = singleRect); + } + + return rect; +} + +function rotateTextRect(textRect, rotate) { + var rotateRadians = rotate * Math.PI / 180; + var boundingBox = textRect.plain(); + var beforeWidth = boundingBox.width; + var beforeHeight = boundingBox.height; + var afterWidth = beforeWidth * Math.cos(rotateRadians) + beforeHeight * Math.sin(rotateRadians); + var afterHeight = beforeWidth * Math.sin(rotateRadians) + beforeHeight * Math.cos(rotateRadians); + var rotatedRect = new BoundingRect(boundingBox.x, boundingBox.y, afterWidth, afterHeight); + + return rotatedRect; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 axisModelCommonMixin = { + + /** + * @param {boolean} origin + * @return {number|string} min value or 'dataMin' or null/undefined (means auto) or NaN + */ + getMin: function (origin) { + var option = this.option; + var min = (!origin && option.rangeStart != null) + ? option.rangeStart : option.min; + + if (this.axis + && min != null + && min !== 'dataMin' + && typeof min !== 'function' + && !eqNaN(min) + ) { + min = this.axis.scale.parse(min); + } + return min; + }, + + /** + * @param {boolean} origin + * @return {number|string} max value or 'dataMax' or null/undefined (means auto) or NaN + */ + getMax: function (origin) { + var option = this.option; + var max = (!origin && option.rangeEnd != null) + ? option.rangeEnd : option.max; + + if (this.axis + && max != null + && max !== 'dataMax' + && typeof max !== 'function' + && !eqNaN(max) + ) { + max = this.axis.scale.parse(max); + } + return max; + }, + + /** + * @return {boolean} + */ + getNeedCrossZero: function () { + var option = this.option; + return (option.rangeStart != null || option.rangeEnd != null) + ? false : !option.scale; + }, + + /** + * Should be implemented by each axis model if necessary. + * @return {module:echarts/model/Component} coordinate system model + */ + getCoordSysModel: noop, + + /** + * @param {number} rangeStart Can only be finite number or null/undefined or NaN. + * @param {number} rangeEnd Can only be finite number or null/undefined or NaN. + */ + setRange: function (rangeStart, rangeEnd) { + this.option.rangeStart = rangeStart; + this.option.rangeEnd = rangeEnd; + }, + + /** + * Reset range + */ + resetRange: function () { + // rangeStart and rangeEnd is readonly. + this.option.rangeStart = this.option.rangeEnd = null; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Symbol factory + +/** + * Triangle shape + * @inner + */ +var Triangle = 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 = 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 = 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); + + var cpLen = r * 0.6; + var cpLen2 = r * 0.7; + + path.moveTo(x - dx, cy + dy); + + path.arc( + x, cy, r, + Math.PI - angle, + Math.PI * 2 + angle + ); + 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 = 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.} + */ +var symbolCtors = { + + line: Line, + + rect: Rect, + + roundRect: Rect, + + square: Rect, + + circle: 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 = {}; +each$1(symbolCtors, function (Ctor, name) { + symbolBuildProxies[name] = new Ctor(); +}); + +var SymbolClz = 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, inBundle) { + 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, inBundle); + } + } +}); + +// Provide setColor helper method to avoid determine if set the fill or stroke outside +function symbolPathSetColor(color, innerColor) { + 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 = innerColor || '#fff'; + } + else { + // FIXME 判断图形默认是填充还是描边,使用 onlyStroke ? + symbolStyle.fill && (symbolStyle.fill = color); + symbolStyle.stroke && (symbolStyle.stroke = color); + } + this.dirty(false); + } +} + +/** + * 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 + * @param {boolean} [keepAspect=false] whether to keep the ratio of w/h, + * for path and image only. + */ +function createSymbol(symbolType, x, y, w, h, color, keepAspect) { + // TODO Support image object, DynamicImage. + + 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 = makeImage( + symbolType.slice(8), + new BoundingRect(x, y, w, h), + keepAspect ? 'center' : 'cover' + ); + } + else if (symbolType.indexOf('path://') === 0) { + symbolPath = makePath( + symbolType.slice(7), + {}, + new BoundingRect(x, y, w, h), + keepAspect ? 'center' : 'cover' + ); + } + else { + symbolPath = new SymbolClz({ + shape: { + symbolType: symbolType, + x: x, + y: y, + width: w, + height: h + } + }); + } + + symbolPath.__isEmptyBrush = isEmpty; + + symbolPath.setColor = symbolPathSetColor; + + symbolPath.setColor(color); + + return symbolPath; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// import createGraphFromNodeEdge from './chart/helper/createGraphFromNodeEdge'; +/** + * Create a muti dimension List structure from seriesModel. + * @param {module:echarts/model/Model} seriesModel + * @return {module:echarts/data/List} list + */ +function createList(seriesModel) { + return createListFromArray(seriesModel.getSource(), seriesModel); +} + +var dataStack$1 = { + isDimensionStacked: isDimensionStacked, + enableDataStack: enableDataStack, + getStackedDimension: getStackedDimension +}; + +/** + * Create scale + * @param {Array.} dataExtent + * @param {Object|module:echarts/Model} option + */ +function createScale(dataExtent, option) { + var axisModel = option; + if (!Model.isInstance(option)) { + axisModel = new Model(option); + mixin(axisModel, axisModelCommonMixin); + } + + var scale = createScaleByModel(axisModel); + scale.setExtent(dataExtent[0], dataExtent[1]); + + niceScaleExtent(scale, axisModel); + return scale; +} + +/** + * Mixin common methods to axis model, + * + * Inlcude methods + * `getFormattedLabels() => Array.` + * `getCategories() => Array.` + * `getMin(origin: boolean) => number` + * `getMax(origin: boolean) => number` + * `getNeedCrossZero() => boolean` + * `setRange(start: number, end: number)` + * `resetRange()` + */ +function mixinAxisModelCommonMethods(Model$$1) { + mixin(Model$$1, axisModelCommonMixin); +} + +var helper = (Object.freeze || Object)({ + createList: createList, + getLayoutRect: getLayoutRect, + dataStack: dataStack$1, + createScale: createScale, + mixinAxisModelCommonMethods: mixinAxisModelCommonMethods, + completeDimensions: completeDimensions, + createDimensions: createDimensions, + createSymbol: createSymbol +}); + +var EPSILON$3 = 1e-8; + +function isAroundEqual$1(a, b) { + return Math.abs(a - b) < EPSILON$3; +} + +function contain$1(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$1(p[0], p0[0]) || !isAroundEqual$1(p[1], p0[1])) { + w += windingLine(p[0], p[1], p0[0], p0[1], x, y); + } + + return w !== 0; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @module echarts/coord/geo/Region + */ + +/** + * @param {string|Region} name + * @param {Array} geometries + * @param {Array.} cp + */ +function Region(name, geometries, cp) { + + /** + * @type {string} + * @readOnly + */ + this.name = name; + + /** + * @type {Array.} + * @readOnly + */ + this.geometries = geometries; + + 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.} + */ + this.center = cp; +} + +Region.prototype = { + + constructor: Region, + + properties: null, + + /** + * @return {module:zrender/core/BoundingRect} + */ + getBoundingRect: function () { + var rect = this._rect; + if (rect) { + return rect; + } + + var MAX_NUMBER = Number.MAX_VALUE; + var min$$1 = [MAX_NUMBER, MAX_NUMBER]; + var max$$1 = [-MAX_NUMBER, -MAX_NUMBER]; + var min2 = []; + var max2 = []; + var geometries = this.geometries; + for (var i = 0; i < geometries.length; i++) { + // Only support polygon + if (geometries[i].type !== 'polygon') { + continue; + } + // Doesn't consider hole + var exterior = geometries[i].exterior; + fromPoints(exterior, min2, max2); + min(min$$1, min$$1, min2); + max(max$$1, max$$1, max2); + } + // No data + if (i === 0) { + min$$1[0] = min$$1[1] = max$$1[0] = max$$1[1] = 0; + } + + return (this._rect = new BoundingRect( + min$$1[0], min$$1[1], max$$1[0] - min$$1[0], max$$1[1] - min$$1[1] + )); + }, + + /** + * @param {} coord + * @return {boolean} + */ + contain: function (coord) { + var rect = this.getBoundingRect(); + var geometries = this.geometries; + if (!rect.contain(coord[0], coord[1])) { + return false; + } + loopGeo: for (var i = 0, len$$1 = geometries.length; i < len$$1; i++) { + // Only support polygon. + if (geometries[i].type !== 'polygon') { + continue; + } + var exterior = geometries[i].exterior; + var interiors = geometries[i].interiors; + if (contain$1(exterior, coord[0], coord[1])) { + // Not in the region if point is in the hole. + for (var k = 0; k < (interiors ? interiors.length : 0); k++) { + if (contain$1(interiors[k])) { + continue loopGeo; + } + } + 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 geometries = this.geometries; + for (var i = 0; i < geometries.length; i++) { + // Only support polygon. + if (geometries[i].type !== 'polygon') { + continue; + } + var exterior = geometries[i].exterior; + var interiors = geometries[i].interiors; + for (var p = 0; p < exterior.length; p++) { + applyTransform(exterior[p], exterior[p], transform); + } + for (var h = 0; h < (interiors ? interiors.length : 0); h++) { + for (var p = 0; p < interiors[h].length; p++) { + applyTransform(interiors[h][p], interiors[h][p], transform); + } + } + } + rect = this._rect; + rect.copy(target); + // Update center + this.center = [ + rect.x + rect.width / 2, + rect.y + rect.height / 2 + ]; + }, + + cloneShallow: function (name) { + name == null && (name = this.name); + var newRegion = new Region(name, this.geometries, this.center); + newRegion._rect = this._rect; + newRegion.transformTo = null; // Simply avoid to be called. + return newRegion; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Parse and decode geo json + * @module echarts/coord/geo/parseGeoJson + */ + +function decode(json) { + if (!json.UTF8Encoding) { + return json; + } + var encodeScale = json.UTF8Scale; + if (encodeScale == null) { + encodeScale = 1024; + } + + 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], + encodeScale + ); + } + else if (geometry.type === 'MultiPolygon') { + for (var c2 = 0; c2 < coordinate.length; c2++) { + var polygon = coordinate[c2]; + coordinate[c2] = decodePolygon( + polygon, + encodeOffsets[c][c2], + encodeScale + ); + } + } + } + } + // Has been decoded + json.UTF8Encoding = false; + return json; +} + +function decodePolygon(coordinate, encodeOffsets, encodeScale) { + 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 / encodeScale, y / encodeScale]); + } + + return result; +} + +/** + * @alias module:echarts/coord/geo/parseGeoJson + * @param {Object} geoJson + * @return {module:zrender/container/Group} + */ +var parseGeoJson$1 = function (geoJson) { + + decode(geoJson); + + return map(filter(geoJson.features, function (featureObj) { + // Output of mapshaper may have geometry null + return featureObj.geometry + && featureObj.properties + && featureObj.geometry.coordinates.length > 0; + }), function (featureObj) { + var properties = featureObj.properties; + var geo = featureObj.geometry; + + var coordinates = geo.coordinates; + + var geometries = []; + if (geo.type === 'Polygon') { + geometries.push({ + type: 'polygon', + // According to the GeoJSON specification. + // First must be exterior, and the rest are all interior(holes). + exterior: coordinates[0], + interiors: coordinates.slice(1) + }); + } + if (geo.type === 'MultiPolygon') { + each$1(coordinates, function (item) { + if (item[0]) { + geometries.push({ + type: 'polygon', + exterior: item[0], + interiors: item.slice(1) + }); + } + }); + } + + var region = new Region( + properties.name, + geometries, + properties.cp + ); + region.properties = properties; + return region; + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 inner$6 = makeInner(); + +/** + * @param {module:echats/coord/Axis} axis + * @return {Object} { + * labels: [{ + * formattedLabel: string, + * rawLabel: string, + * tickValue: number + * }, ...], + * labelCategoryInterval: number + * } + */ +function createAxisLabels(axis) { + // Only ordinal scale support tick interval + return axis.type === 'category' + ? makeCategoryLabels(axis) + : makeRealNumberLabels(axis); +} + +/** + * @param {module:echats/coord/Axis} axis + * @param {module:echarts/model/Model} tickModel For example, can be axisTick, splitLine, splitArea. + * @return {Object} { + * ticks: Array. + * tickCategoryInterval: number + * } + */ +function createAxisTicks(axis, tickModel) { + // Only ordinal scale support tick interval + return axis.type === 'category' + ? makeCategoryTicks(axis, tickModel) + : {ticks: axis.scale.getTicks()}; +} + +function makeCategoryLabels(axis) { + var labelModel = axis.getLabelModel(); + var result = makeCategoryLabelsActually(axis, labelModel); + + return (!labelModel.get('show') || axis.scale.isBlank()) + ? {labels: [], labelCategoryInterval: result.labelCategoryInterval} + : result; +} + +function makeCategoryLabelsActually(axis, labelModel) { + var labelsCache = getListCache(axis, 'labels'); + var optionLabelInterval = getOptionCategoryInterval(labelModel); + var result = listCacheGet(labelsCache, optionLabelInterval); + + if (result) { + return result; + } + + var labels; + var numericLabelInterval; + + if (isFunction$1(optionLabelInterval)) { + labels = makeLabelsByCustomizedCategoryInterval(axis, optionLabelInterval); + } + else { + numericLabelInterval = optionLabelInterval === 'auto' + ? makeAutoCategoryInterval(axis) : optionLabelInterval; + labels = makeLabelsByNumericCategoryInterval(axis, numericLabelInterval); + } + + // Cache to avoid calling interval function repeatly. + return listCacheSet(labelsCache, optionLabelInterval, { + labels: labels, labelCategoryInterval: numericLabelInterval + }); +} + +function makeCategoryTicks(axis, tickModel) { + var ticksCache = getListCache(axis, 'ticks'); + var optionTickInterval = getOptionCategoryInterval(tickModel); + var result = listCacheGet(ticksCache, optionTickInterval); + + if (result) { + return result; + } + + var ticks; + var tickCategoryInterval; + + // Optimize for the case that large category data and no label displayed, + // we should not return all ticks. + if (!tickModel.get('show') || axis.scale.isBlank()) { + ticks = []; + } + + if (isFunction$1(optionTickInterval)) { + ticks = makeLabelsByCustomizedCategoryInterval(axis, optionTickInterval, true); + } + // Always use label interval by default despite label show. Consider this + // scenario, Use multiple grid with the xAxis sync, and only one xAxis shows + // labels. `splitLine` and `axisTick` should be consistent in this case. + else if (optionTickInterval === 'auto') { + var labelsResult = makeCategoryLabelsActually(axis, axis.getLabelModel()); + tickCategoryInterval = labelsResult.labelCategoryInterval; + ticks = map(labelsResult.labels, function (labelItem) { + return labelItem.tickValue; + }); + } + else { + tickCategoryInterval = optionTickInterval; + ticks = makeLabelsByNumericCategoryInterval(axis, tickCategoryInterval, true); + } + + // Cache to avoid calling interval function repeatly. + return listCacheSet(ticksCache, optionTickInterval, { + ticks: ticks, tickCategoryInterval: tickCategoryInterval + }); +} + +function makeRealNumberLabels(axis) { + var ticks = axis.scale.getTicks(); + var labelFormatter = makeLabelFormatter(axis); + return { + labels: map(ticks, function (tickValue, idx) { + return { + formattedLabel: labelFormatter(tickValue, idx), + rawLabel: axis.scale.getLabel(tickValue), + tickValue: tickValue + }; + }) + }; +} + +// Large category data calculation is performence sensitive, and ticks and label +// probably be fetched by multiple times. So we cache the result. +// axis is created each time during a ec process, so we do not need to clear cache. +function getListCache(axis, prop) { + // Because key can be funciton, and cache size always be small, we use array cache. + return inner$6(axis)[prop] || (inner$6(axis)[prop] = []); +} + +function listCacheGet(cache, key) { + for (var i = 0; i < cache.length; i++) { + if (cache[i].key === key) { + return cache[i].value; + } + } +} + +function listCacheSet(cache, key, value) { + cache.push({key: key, value: value}); + return value; +} + +function makeAutoCategoryInterval(axis) { + var result = inner$6(axis).autoInterval; + return result != null + ? result + : (inner$6(axis).autoInterval = axis.calculateCategoryInterval()); +} + +/** + * Calculate interval for category axis ticks and labels. + * To get precise result, at least one of `getRotate` and `isHorizontal` + * should be implemented in axis. + */ +function calculateCategoryInterval(axis) { + var params = fetchAutoCategoryIntervalCalculationParams(axis); + var labelFormatter = makeLabelFormatter(axis); + var rotation = (params.axisRotate - params.labelRotate) / 180 * Math.PI; + + var ordinalScale = axis.scale; + var ordinalExtent = ordinalScale.getExtent(); + // Providing this method is for optimization: + // avoid generating a long array by `getTicks` + // in large category data case. + var tickCount = ordinalScale.count(); + + if (ordinalExtent[1] - ordinalExtent[0] < 1) { + return 0; + } + + var step = 1; + // Simple optimization. Empirical value: tick count should less than 40. + if (tickCount > 40) { + step = Math.max(1, Math.floor(tickCount / 40)); + } + var tickValue = ordinalExtent[0]; + var unitSpan = axis.dataToCoord(tickValue + 1) - axis.dataToCoord(tickValue); + var unitW = Math.abs(unitSpan * Math.cos(rotation)); + var unitH = Math.abs(unitSpan * Math.sin(rotation)); + + var maxW = 0; + var maxH = 0; + + // Caution: Performance sensitive for large category data. + // Consider dataZoom, we should make appropriate step to avoid O(n) loop. + for (; tickValue <= ordinalExtent[1]; tickValue += step) { + var width = 0; + var height = 0; + + // Polar is also calculated in assumptive linear layout here. + // Not precise, do not consider align and vertical align + // and each distance from axis line yet. + var rect = getBoundingRect( + labelFormatter(tickValue), params.font, 'center', 'top' + ); + // Magic number + width = rect.width * 1.3; + height = rect.height * 1.3; + + // Min size, void long loop. + maxW = Math.max(maxW, width, 7); + maxH = Math.max(maxH, height, 7); + } + + var dw = maxW / unitW; + var dh = maxH / unitH; + // 0/0 is NaN, 1/0 is Infinity. + isNaN(dw) && (dw = Infinity); + isNaN(dh) && (dh = Infinity); + var interval = Math.max(0, Math.floor(Math.min(dw, dh))); + + var cache = inner$6(axis.model); + var lastAutoInterval = cache.lastAutoInterval; + var lastTickCount = cache.lastTickCount; + + // Use cache to keep interval stable while moving zoom window, + // otherwise the calculated interval might jitter when the zoom + // window size is close to the interval-changing size. + if (lastAutoInterval != null + && lastTickCount != null + && Math.abs(lastAutoInterval - interval) <= 1 + && Math.abs(lastTickCount - tickCount) <= 1 + // Always choose the bigger one, otherwise the critical + // point is not the same when zooming in or zooming out. + && lastAutoInterval > interval + ) { + interval = lastAutoInterval; + } + // Only update cache if cache not used, otherwise the + // changing of interval is too insensitive. + else { + cache.lastTickCount = tickCount; + cache.lastAutoInterval = interval; + } + + return interval; +} + +function fetchAutoCategoryIntervalCalculationParams(axis) { + var labelModel = axis.getLabelModel(); + return { + axisRotate: axis.getRotate + ? axis.getRotate() + : (axis.isHorizontal && !axis.isHorizontal()) + ? 90 + : 0, + labelRotate: labelModel.get('rotate') || 0, + font: labelModel.getFont() + }; +} + +function makeLabelsByNumericCategoryInterval(axis, categoryInterval, onlyTick) { + var labelFormatter = makeLabelFormatter(axis); + var ordinalScale = axis.scale; + var ordinalExtent = ordinalScale.getExtent(); + var labelModel = axis.getLabelModel(); + var result = []; + + // TODO: axisType: ordinalTime, pick the tick from each month/day/year/... + + var step = Math.max((categoryInterval || 0) + 1, 1); + var startTick = ordinalExtent[0]; + var tickCount = ordinalScale.count(); + + // Calculate start tick based on zero if possible to keep label consistent + // while zooming and moving while interval > 0. Otherwise the selection + // of displayable ticks and symbols probably keep changing. + // 3 is empirical value. + if (startTick !== 0 && step > 1 && tickCount / step > 2) { + startTick = Math.round(Math.ceil(startTick / step) * step); + } + + // (1) Only add min max label here but leave overlap checking + // to render stage, which also ensure the returned list + // suitable for splitLine and splitArea rendering. + // (2) Scales except category always contain min max label so + // do not need to perform this process. + var showMinMax = { + min: labelModel.get('showMinLabel'), + max: labelModel.get('showMaxLabel') + }; + + if (showMinMax.min && startTick !== ordinalExtent[0]) { + addItem(ordinalExtent[0]); + } + + // Optimize: avoid generating large array by `ordinalScale.getTicks()`. + var tickValue = startTick; + for (; tickValue <= ordinalExtent[1]; tickValue += step) { + addItem(tickValue); + } + + if (showMinMax.max && tickValue !== ordinalExtent[1]) { + addItem(ordinalExtent[1]); + } + + function addItem(tVal) { + result.push(onlyTick + ? tVal + : { + formattedLabel: labelFormatter(tVal), + rawLabel: ordinalScale.getLabel(tVal), + tickValue: tVal + } + ); + } + + return result; +} + +// When interval is function, the result `false` means ignore the tick. +// It is time consuming for large category data. +function makeLabelsByCustomizedCategoryInterval(axis, categoryInterval, onlyTick) { + var ordinalScale = axis.scale; + var labelFormatter = makeLabelFormatter(axis); + var result = []; + + each$1(ordinalScale.getTicks(), function (tickValue) { + var rawLabel = ordinalScale.getLabel(tickValue); + if (categoryInterval(tickValue, rawLabel)) { + result.push(onlyTick + ? tickValue + : { + formattedLabel: labelFormatter(tickValue), + rawLabel: rawLabel, + tickValue: tickValue + } + ); + } + }); + + return result; +} + +// Can be null|'auto'|number|function +function getOptionCategoryInterval(model) { + var interval = model.get('interval'); + return interval == null ? 'auto' : interval; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 NORMALIZED_EXTENT = [0, 1]; + +/** + * Base class of Axis. + * @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.} + * @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.} + */ + getExtent: function () { + return this._extent.slice(); + }, + + /** + * Get precision used for formatting + * @param {Array.} [dataExtent] + * @return {number} + */ + getPixelPrecision: function (dataExtent) { + return 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 an 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, NORMALIZED_EXTENT, extent, clamp); + }, + + /** + * Convert coord to data. Data is the rank if it has an 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, NORMALIZED_EXTENT, clamp); + + return this.scale.scale(t); + }, + + /** + * Convert pixel point to data in axis + * @param {Array.} point + * @param {boolean} clamp + * @return {number} data + */ + pointToData: function (point, clamp) { + // Should be implemented in derived class if necessary. + }, + + /** + * Different from `zrUtil.map(axis.getTicks(), axis.dataToCoord, axis)`, + * `axis.getTicksCoords` considers `onBand`, which is used by + * `boundaryGap:true` of category axis and splitLine and splitArea. + * @param {Object} [opt] + * @param {number} [opt.tickModel=axis.model.getModel('axisTick')] + * @param {boolean} [opt.clamp] If `true`, the first and the last + * tick must be at the axis end points. Otherwise, clip ticks + * that outside the axis extent. + * @return {Array.} [{ + * coord: ..., + * tickValue: ... + * }, ...] + */ + getTicksCoords: function (opt) { + opt = opt || {}; + + var tickModel = opt.tickModel || this.getTickModel(); + + var result = createAxisTicks(this, tickModel); + var ticks = result.ticks; + + var ticksCoords = map(ticks, function (tickValue) { + return { + coord: this.dataToCoord(tickValue), + tickValue: tickValue + }; + }, this); + + var alignWithLabel = tickModel.get('alignWithLabel'); + fixOnBandTicksCoords( + this, ticksCoords, result.tickCategoryInterval, alignWithLabel, opt.clamp + ); + + return ticksCoords; + }, + + /** + * @return {Array.} [{ + * formattedLabel: string, + * rawLabel: axis.scale.getLabel(tickValue) + * tickValue: number + * }, ...] + */ + getViewLabels: function () { + return createAxisLabels(this).labels; + }, + + /** + * @return {module:echarts/coord/model/Model} + */ + getLabelModel: function () { + return this.model.getModel('axisLabel'); + }, + + /** + * Notice here we only get the default tick model. For splitLine + * or splitArea, we should pass the splitLineModel or splitAreaModel + * manually when calling `getTicksCoords`. + * In GL, this method may be overrided to: + * `axisModel.getModel('axisTick', grid3DModel.getModel('axisTick'));` + * @return {module:echarts/coord/model/Model} + */ + getTickModel: function () { + return this.model.getModel('axisTick'); + }, + + /** + * 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; + }, + + /** + * @abstract + * @return {boolean} Is horizontal + */ + isHorizontal: null, + + /** + * @abstract + * @return {number} Get axis rotate, by degree. + */ + getRotate: null, + + /** + * Only be called in category axis. + * Can be overrided, consider other axes like in 3D. + * @return {number} Auto interval for cateogry axis tick and label + */ + calculateCategoryInterval: function () { + return calculateCategoryInterval(this); + } + +}; + +function fixExtentWithBands(extent, nTick) { + var size = extent[1] - extent[0]; + var len = nTick; + var margin = size / len / 2; + extent[0] += margin; + extent[1] -= margin; +} + +// If axis has labels [1, 2, 3, 4]. Bands on the axis are +// |---1---|---2---|---3---|---4---|. +// So the displayed ticks and splitLine/splitArea should between +// each data item, otherwise cause misleading (e.g., split tow bars +// of a single data item when there are two bar series). +// Also consider if tickCategoryInterval > 0 and onBand, ticks and +// splitLine/spliteArea should layout appropriately corresponding +// to displayed labels. (So we should not use `getBandWidth` in this +// case). +function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWithLabel, clamp) { + var ticksLen = ticksCoords.length; + + if (!axis.onBand || alignWithLabel || !ticksLen) { + return; + } + + var axisExtent = axis.getExtent(); + var last; + if (ticksLen === 1) { + ticksCoords[0].coord = axisExtent[0]; + last = ticksCoords[1] = {coord: axisExtent[0]}; + } + else { + var shift = (ticksCoords[1].coord - ticksCoords[0].coord); + each$1(ticksCoords, function (ticksItem) { + ticksItem.coord -= shift / 2; + var tickCategoryInterval = tickCategoryInterval || 0; + // Avoid split a single data item when odd interval. + if (tickCategoryInterval % 2 > 0) { + ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2); + } + }); + last = {coord: ticksCoords[ticksLen - 1].coord + shift}; + ticksCoords.push(last); + } + + var inverse = axisExtent[0] > axisExtent[1]; + + if (littleThan(ticksCoords[0].coord, axisExtent[0])) { + clamp ? (ticksCoords[0].coord = axisExtent[0]) : ticksCoords.shift(); + } + if (clamp && littleThan(axisExtent[0], ticksCoords[0].coord)) { + ticksCoords.unshift({coord: axisExtent[0]}); + } + if (littleThan(axisExtent[1], last.coord)) { + clamp ? (last.coord = axisExtent[1]) : ticksCoords.pop(); + } + if (clamp && littleThan(last.coord, axisExtent[1])) { + ticksCoords.push({coord: axisExtent[1]}); + } + + function littleThan(a, b) { + return inverse ? a > b : a < b; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Do not mount those modules on 'src/echarts' for better tree shaking. + */ + +var parseGeoJson = parseGeoJson$1; + +var ecUtil = {}; +each$1( + [ + 'map', 'each', 'filter', 'indexOf', 'inherits', 'reduce', 'filter', + 'bind', 'curry', 'isArray', 'isString', 'isObject', 'isFunction', + 'extend', 'defaults', 'clone', 'merge' + ], + function (name) { + ecUtil[name] = zrUtil[name]; + } +); +var graphic$1 = {}; +each$1( + [ + 'extendShape', 'extendPath', 'makePath', 'makeImage', + 'mergePath', 'resizePath', 'createIcon', + 'setHoverStyle', 'setLabelStyle', 'setTextStyle', 'setText', + 'getFont', 'updateProps', 'initProps', 'getTransform', + 'clipPointsByRect', 'clipRectByRect', + 'Group', + 'Image', + 'Text', + 'Circle', + 'Sector', + 'Ring', + 'Polygon', + 'Polyline', + 'Rect', + 'Line', + 'BezierCurve', + 'Arc', + 'IncrementalDisplayable', + 'CompoundPath', + 'LinearGradient', + 'RadialGradient', + 'BoundingRect' + ], + function (name) { + graphic$1[name] = graphic[name]; + } +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +SeriesModel.extend({ + + type: 'series.line', + + dependencies: ['grid', 'polar'], + + getInitialData: function (option, ecModel) { + if (__DEV__) { + var coordSys = option.coordinateSystem; + if (coordSys !== 'polar' && coordSys !== 'cartesian2d') { + throw new Error('Line not support coordinateSystem besides cartesian and polar'); + } + } + return createListFromArray(this.getSource(), this); + }, + + 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, + // cursor: null, + + label: { + position: 'top' + }, + // itemStyle: { + // }, + + lineStyle: { + width: 2, + type: 'solid' + }, + // areaStyle: { + // origin of areaStyle. Valid values: + // `'auto'/null/undefined`: from axisLine to data + // `'start'`: from min to data + // `'end'`: from data to max + // origin: 'auto' + // }, + // false, 'start', 'end', 'middle' + step: false, + + // Disabled if step is true + smooth: false, + smoothMonotone: null, + symbol: 'emptyCircle', + symbolSize: 4, + symbolRotate: null, + + showSymbol: true, + // `false`: follow the label interval strategy. + // `true`: show all symbols. + // `'auto'`: If possible, show all symbols, otherwise + // follow the label interval strategy. + showAllSymbol: 'auto', + + // Whether to connect break point. + connectNulls: false, + + // Sampling for large data. Can be: 'average', 'max', 'min', 'sum'. + sampling: 'none', + + animationEasing: 'linear', + + // Disable progressive + progressive: 0, + hoverLayerThreshold: Infinity + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @param {module:echarts/data/List} data + * @param {number} dataIndex + * @return {string} label string. Not null/undefined + */ +function getDefaultLabel(data, dataIndex) { + var labelDims = data.mapDimension('defaultedLabel', true); + var len = labelDims.length; + + // Simple optimization (in lots of cases, label dims length is 1) + if (len === 1) { + return retrieveRawValue(data, dataIndex, labelDims[0]); + } + else if (len) { + var vals = []; + for (var i = 0; i < labelDims.length; i++) { + var val = retrieveRawValue(data, dataIndex, labelDims[i]); + vals.push(val); + } + return vals.join(' '); + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @module echarts/chart/helper/Symbol + */ + +/** + * @constructor + * @alias {module:echarts/chart/helper/Symbol} + * @param {module:echarts/data/List} data + * @param {number} idx + * @extends {module:zrender/graphic/Group} + */ +function SymbolClz$1(data, idx, seriesScope) { + Group.call(this); + this.updateData(data, idx, seriesScope); +} + +var symbolProto = SymbolClz$1.prototype; + +/** + * @public + * @static + * @param {module:echarts/data/List} data + * @param {number} dataIndex + * @return {Array.} [width, height] + */ +var getSymbolSize = SymbolClz$1.getSymbolSize = function (data, idx) { + var symbolSize = data.getItemVisual(idx, 'symbolSize'); + return symbolSize instanceof Array + ? symbolSize.slice() + : [+symbolSize, +symbolSize]; +}; + +function getScale(symbolSize) { + return [symbolSize[0] / 2, symbolSize[1] / 2]; +} + +function driftSymbol(dx, dy) { + this.parent.drift(dx, dy); +} + +symbolProto._createSymbol = function ( + symbolType, + data, + idx, + symbolSize, + keepAspect +) { + // Remove paths created before + this.removeAll(); + + var color = data.getItemVisual(idx, 'color'); + + // var symbolPath = createSymbol( + // symbolType, -0.5, -0.5, 1, 1, color + // ); + // If width/height are set too small (e.g., set to 1) on ios10 + // and macOS Sierra, a circle stroke become a rect, no matter what + // the scale is set. So we set width/height as 2. See #4150. + var symbolPath = createSymbol( + symbolType, -1, -1, 2, 2, color, keepAspect + ); + + symbolPath.attr({ + z2: 100, + culling: true, + scale: getScale(symbolSize) + }); + // Rewrite drift method + symbolPath.drift = driftSymbol; + + this._symbolType = symbolType; + + this.add(symbolPath); +}; + +/** + * Stop animation + * @param {boolean} toLastFrame + */ +symbolProto.stopSymbolAnimation = function (toLastFrame) { + this.childAt(0).stopAnimation(toLastFrame); +}; + +/** + * FIXME: + * Caution: This method breaks the encapsulation of this module, + * but it indeed brings convenience. So do not use the method + * unless you detailedly know all the implements of `Symbol`, + * especially animation. + * + * Get symbol path element. + */ +symbolProto.getSymbolPath = function () { + return this.childAt(0); +}; + +/** + * Get scale(aka, current symbol size). + * Including the change caused by animation + */ +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 + * @param {Object} [seriesScope] + * @param {Object} [seriesScope.itemStyle] + * @param {Object} [seriesScope.hoverItemStyle] + * @param {Object} [seriesScope.symbolRotate] + * @param {Object} [seriesScope.symbolOffset] + * @param {module:echarts/model/Model} [seriesScope.labelModel] + * @param {module:echarts/model/Model} [seriesScope.hoverLabelModel] + * @param {boolean} [seriesScope.hoverAnimation] + * @param {Object} [seriesScope.cursorStyle] + * @param {module:echarts/model/Model} [seriesScope.itemModel] + * @param {string} [seriesScope.symbolInnerColor] + * @param {Object} [seriesScope.fadeIn=false] + */ +symbolProto.updateData = function (data, idx, seriesScope) { + this.silent = false; + + var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; + var seriesModel = data.hostModel; + var symbolSize = getSymbolSize(data, idx); + var isInit = symbolType !== this._symbolType; + + if (isInit) { + var keepAspect = data.getItemVisual(idx, 'symbolKeepAspect'); + this._createSymbol(symbolType, data, idx, symbolSize, keepAspect); + } + else { + var symbolPath = this.childAt(0); + symbolPath.silent = false; + updateProps(symbolPath, { + scale: getScale(symbolSize) + }, seriesModel, idx); + } + + this._updateCommon(data, idx, symbolSize, seriesScope); + + if (isInit) { + var symbolPath = this.childAt(0); + var fadeIn = seriesScope && seriesScope.fadeIn; + + var target = {scale: symbolPath.scale.slice()}; + fadeIn && (target.style = {opacity: symbolPath.style.opacity}); + + symbolPath.scale = [0, 0]; + fadeIn && (symbolPath.style.opacity = 0); + + initProps(symbolPath, target, seriesModel, idx); + } + + this._seriesModel = seriesModel; +}; + +// Update common properties +var normalStyleAccessPath = ['itemStyle']; +var emphasisStyleAccessPath = ['emphasis', 'itemStyle']; +var normalLabelAccessPath = ['label']; +var emphasisLabelAccessPath = ['emphasis', 'label']; + +/** + * @param {module:echarts/data/List} data + * @param {number} idx + * @param {Array.} symbolSize + * @param {Object} [seriesScope] + */ +symbolProto._updateCommon = function (data, idx, symbolSize, seriesScope) { + var symbolPath = this.childAt(0); + var seriesModel = data.hostModel; + var color = data.getItemVisual(idx, 'color'); + + // Reset style + if (symbolPath.type !== 'image') { + symbolPath.useStyle({ + strokeNoScale: true + }); + } + + var itemStyle = seriesScope && seriesScope.itemStyle; + var hoverItemStyle = seriesScope && seriesScope.hoverItemStyle; + var symbolRotate = seriesScope && seriesScope.symbolRotate; + var symbolOffset = seriesScope && seriesScope.symbolOffset; + var labelModel = seriesScope && seriesScope.labelModel; + var hoverLabelModel = seriesScope && seriesScope.hoverLabelModel; + var hoverAnimation = seriesScope && seriesScope.hoverAnimation; + var cursorStyle = seriesScope && seriesScope.cursorStyle; + + if (!seriesScope || data.hasItemOption) { + var itemModel = (seriesScope && seriesScope.itemModel) + ? seriesScope.itemModel : data.getItemModel(idx); + + // Color must be excluded. + // Because symbol provide setColor individually to set fill and stroke + itemStyle = itemModel.getModel(normalStyleAccessPath).getItemStyle(['color']); + hoverItemStyle = itemModel.getModel(emphasisStyleAccessPath).getItemStyle(); + + symbolRotate = itemModel.getShallow('symbolRotate'); + symbolOffset = itemModel.getShallow('symbolOffset'); + + labelModel = itemModel.getModel(normalLabelAccessPath); + hoverLabelModel = itemModel.getModel(emphasisLabelAccessPath); + hoverAnimation = itemModel.getShallow('hoverAnimation'); + cursorStyle = itemModel.getShallow('cursor'); + } + else { + hoverItemStyle = extend({}, hoverItemStyle); + } + + var elStyle = symbolPath.style; + + symbolPath.attr('rotation', (symbolRotate || 0) * Math.PI / 180 || 0); + + if (symbolOffset) { + symbolPath.attr('position', [ + parsePercent$1(symbolOffset[0], symbolSize[0]), + parsePercent$1(symbolOffset[1], symbolSize[1]) + ]); + } + + cursorStyle && symbolPath.attr('cursor', cursorStyle); + + // PENDING setColor before setStyle!!! + symbolPath.setColor(color, seriesScope && seriesScope.symbolInnerColor); + + symbolPath.setStyle(itemStyle); + + var opacity = data.getItemVisual(idx, 'opacity'); + if (opacity != null) { + elStyle.opacity = opacity; + } + + var liftZ = data.getItemVisual(idx, 'liftZ'); + var z2Origin = symbolPath.__z2Origin; + if (liftZ != null) { + if (z2Origin == null) { + symbolPath.__z2Origin = symbolPath.z2; + symbolPath.z2 += liftZ; + } + } + else if (z2Origin != null) { + symbolPath.z2 = z2Origin; + symbolPath.__z2Origin = null; + } + + var useNameLabel = seriesScope && seriesScope.useNameLabel; + + setLabelStyle( + elStyle, hoverItemStyle, labelModel, hoverLabelModel, + { + labelFetcher: seriesModel, + labelDataIndex: idx, + defaultText: getLabelDefaultText, + isRectText: true, + autoColor: color + } + ); + + // Do not execute util needed. + function getLabelDefaultText(idx, opt) { + return useNameLabel ? data.getName(idx) : getDefaultLabel(data, idx); + } + + symbolPath.off('mouseover') + .off('mouseout') + .off('emphasis') + .off('normal'); + + symbolPath.hoverStyle = hoverItemStyle; + + // FIXME + // Do not use symbol.trigger('emphasis'), but use symbol.highlight() instead. + setHoverStyle(symbolPath); + + symbolPath.__symbolOriginalScale = getScale(symbolSize); + + if (hoverAnimation && seriesModel.isAnimationEnabled()) { + symbolPath.on('mouseover', onEmphasis) + .on('mouseout', onNormal) + .on('emphasis', onEmphasis) + .on('normal', onNormal); + } +}; + +function onEmphasis() { + // Do not support this hover animation util some scenario required. + // Animation can only be supported in hover layer when using `el.incremetal`. + if (this.incremental || this.useHoverLayer || isInEmphasis(this)) { + return; + } + var scale = this.__symbolOriginalScale; + var ratio = scale[1] / scale[0]; + this.animateTo({ + scale: [ + Math.max(scale[0] * 1.1, scale[0] + 3), + Math.max(scale[1] * 1.1, scale[1] + 3 * ratio) + ] + }, 400, 'elasticOut'); +} + +function onNormal() { + if (this.incremental || this.useHoverLayer || isInEmphasis(this)) { + return; + } + this.animateTo({ + scale: this.__symbolOriginalScale + }, 400, 'elasticOut'); +} + + +/** + * @param {Function} cb + * @param {Object} [opt] + * @param {Object} [opt.keepLabel=true] + */ +symbolProto.fadeOut = function (cb, opt) { + var symbolPath = this.childAt(0); + // Avoid mistaken hover when fading out + this.silent = symbolPath.silent = true; + // Not show text when animating + !(opt && opt.keepLabel) && (symbolPath.style.text = null); + + updateProps( + symbolPath, + { + style: {opacity: 0}, + scale: [0, 0] + }, + this._seriesModel, + this.dataIndex, + cb + ); +}; + +inherits(SymbolClz$1, Group); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @module echarts/chart/helper/SymbolDraw + */ + +/** + * @constructor + * @alias module:echarts/chart/helper/SymbolDraw + * @param {module:zrender/graphic/Group} [symbolCtor] + */ +function SymbolDraw(symbolCtor) { + this.group = new Group(); + + this._symbolCtor = symbolCtor || SymbolClz$1; +} + +var symbolDrawProto = SymbolDraw.prototype; + +function symbolNeedsDraw(data, point, idx, opt) { + return point && !isNaN(point[0]) && !isNaN(point[1]) + && !(opt.isIgnore && opt.isIgnore(idx)) + // We do not set clipShape on group, because it will cut part of + // the symbol element shape. We use the same clip shape here as + // the line clip. + && !(opt.clipShape && !opt.clipShape.contain(point[0], point[1])) + && data.getItemVisual(idx, 'symbol') !== 'none'; +} + +/** + * Update symbols draw by new data + * @param {module:echarts/data/List} data + * @param {Object} [opt] Or isIgnore + * @param {Function} [opt.isIgnore] + * @param {Object} [opt.clipShape] + */ +symbolDrawProto.updateData = function (data, opt) { + opt = normalizeUpdateOpt(opt); + + var group = this.group; + var seriesModel = data.hostModel; + var oldData = this._data; + var SymbolCtor = this._symbolCtor; + + var seriesScope = makeSeriesScope(data); + + // There is no oldLineData only when first rendering or switching from + // stream mode to normal mode, where previous elements should be removed. + if (!oldData) { + group.removeAll(); + } + + data.diff(oldData) + .add(function (newIdx) { + var point = data.getItemLayout(newIdx); + if (symbolNeedsDraw(data, point, newIdx, opt)) { + var symbolEl = new SymbolCtor(data, newIdx, seriesScope); + 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, point, newIdx, opt)) { + group.remove(symbolEl); + return; + } + if (!symbolEl) { + symbolEl = new SymbolCtor(data, newIdx); + symbolEl.attr('position', point); + } + else { + symbolEl.updateData(data, newIdx, seriesScope); + 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.isPersistent = function () { + return true; +}; + +symbolDrawProto.updateLayout = function () { + var data = this._data; + if (data) { + // Not use animation + data.eachItemGraphicEl(function (el, idx) { + var point = data.getItemLayout(idx); + el.attr('position', point); + }); + } +}; + +symbolDrawProto.incrementalPrepareUpdate = function (data) { + this._seriesScope = makeSeriesScope(data); + this._data = null; + this.group.removeAll(); +}; + +/** + * Update symbols draw by new data + * @param {module:echarts/data/List} data + * @param {Object} [opt] Or isIgnore + * @param {Function} [opt.isIgnore] + * @param {Object} [opt.clipShape] + */ +symbolDrawProto.incrementalUpdate = function (taskParams, data, opt) { + opt = normalizeUpdateOpt(opt); + + function updateIncrementalAndHover(el) { + if (!el.isGroup) { + el.incremental = el.useHoverLayer = true; + } + } + for (var idx = taskParams.start; idx < taskParams.end; idx++) { + var point = data.getItemLayout(idx); + if (symbolNeedsDraw(data, point, idx, opt)) { + var el = new this._symbolCtor(data, idx, this._seriesScope); + el.traverse(updateIncrementalAndHover); + el.attr('position', point); + this.group.add(el); + data.setItemGraphicEl(idx, el); + } + } +}; + +function normalizeUpdateOpt(opt) { + if (opt != null && !isObject$1(opt)) { + opt = {isIgnore: opt}; + } + return opt || {}; +} + +symbolDrawProto.remove = function (enableAnimation) { + var group = this.group; + var data = this._data; + // Incremental model do not have this._data. + if (data && enableAnimation) { + data.eachItemGraphicEl(function (el) { + el.fadeOut(function () { + group.remove(el); + }); + }); + } + else { + group.removeAll(); + } +}; + +function makeSeriesScope(data) { + var seriesModel = data.hostModel; + return { + itemStyle: seriesModel.getModel('itemStyle').getItemStyle(['color']), + hoverItemStyle: seriesModel.getModel('emphasis.itemStyle').getItemStyle(), + symbolRotate: seriesModel.get('symbolRotate'), + symbolOffset: seriesModel.get('symbolOffset'), + hoverAnimation: seriesModel.get('hoverAnimation'), + labelModel: seriesModel.getModel('label'), + hoverLabelModel: seriesModel.getModel('emphasis.label'), + cursorStyle: seriesModel.get('cursor') + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @param {Object} coordSys + * @param {module:echarts/data/List} data + * @param {string} valueOrigin lineSeries.option.areaStyle.origin + */ +function prepareDataCoordInfo(coordSys, data, valueOrigin) { + var baseAxis = coordSys.getBaseAxis(); + var valueAxis = coordSys.getOtherAxis(baseAxis); + var valueStart = getValueStart(valueAxis, valueOrigin); + + var baseAxisDim = baseAxis.dim; + var valueAxisDim = valueAxis.dim; + var valueDim = data.mapDimension(valueAxisDim); + var baseDim = data.mapDimension(baseAxisDim); + var baseDataOffset = valueAxisDim === 'x' || valueAxisDim === 'radius' ? 1 : 0; + + var dims = map(coordSys.dimensions, function (coordDim) { + return data.mapDimension(coordDim); + }); + + var stacked; + var stackResultDim = data.getCalculationInfo('stackResultDimension'); + if (stacked |= isDimensionStacked(data, dims[0] /*, dims[1]*/)) { // jshint ignore:line + dims[0] = stackResultDim; + } + if (stacked |= isDimensionStacked(data, dims[1] /*, dims[0]*/)) { // jshint ignore:line + dims[1] = stackResultDim; + } + + return { + dataDimsForPoint: dims, + valueStart: valueStart, + valueAxisDim: valueAxisDim, + baseAxisDim: baseAxisDim, + stacked: !!stacked, + valueDim: valueDim, + baseDim: baseDim, + baseDataOffset: baseDataOffset, + stackedOverDimension: data.getCalculationInfo('stackedOverDimension') + }; +} + +function getValueStart(valueAxis, valueOrigin) { + var valueStart = 0; + var extent = valueAxis.scale.getExtent(); + + if (valueOrigin === 'start') { + valueStart = extent[0]; + } + else if (valueOrigin === 'end') { + valueStart = extent[1]; + } + // auto + else { + // Both positive + if (extent[0] > 0) { + valueStart = extent[0]; + } + // Both negative + else if (extent[1] < 0) { + valueStart = extent[1]; + } + // If is one positive, and one negative, onZero shall be true + } + + return valueStart; +} + +function getStackedOnPoint(dataCoordInfo, coordSys, data, idx) { + var value = NaN; + if (dataCoordInfo.stacked) { + value = data.get(data.getCalculationInfo('stackedOverDimension'), idx); + } + if (isNaN(value)) { + value = dataCoordInfo.valueStart; + } + + var baseDataOffset = dataCoordInfo.baseDataOffset; + var stackedData = []; + stackedData[baseDataOffset] = data.get(dataCoordInfo.baseDim, idx); + stackedData[1 - baseDataOffset] = value; + + return coordSys.dataToPoint(stackedData); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 arrayDiff = require('zrender/src/core/arrayDiff'); +// 'zrender/src/core/arrayDiff' has been used before, but it did +// not do well in performance when roam with fixed dataZoom window. + +// 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; +} + +var lineAnimationDiff = function ( + oldData, newData, + oldStackedOnPoints, newStackedOnPoints, + oldCoordSys, newCoordSys, + oldValueOrigin, newValueOrigin +) { + 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 newDataOldCoordInfo = prepareDataCoordInfo(oldCoordSys, newData, oldValueOrigin); + var oldDataNewCoordInfo = prepareDataCoordInfo(newCoordSys, oldData, newValueOrigin); + + 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(newDataOldCoordInfo.dataDimsForPoint[0], idx), + newData.get(newDataOldCoordInfo.dataDimsForPoint[1], idx) + ]) + ); + + nextPoints.push(newData.getItemLayout(idx).slice()); + + currStackedPoints.push( + getStackedOnPoint(newDataOldCoordInfo, 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(oldDataNewCoordInfo.dataDimsForPoint[0], idx), + oldData.get(oldDataNewCoordInfo.dataDimsForPoint[1], idx) + ])); + + currStackedPoints.push(oldStackedOnPoints[idx]); + nextStackedPoints.push( + getStackedOnPoint(oldDataNewCoordInfo, 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 + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Poly path support NaN point + +var vec2Min = min; +var vec2Max = max; + +var scaleAndAdd$1 = scaleAndAdd; +var v2Copy = copy; + +// Temporary variable +var v = []; +var cp0 = []; +var cp1 = []; + +function isPointNull(p) { + return isNaN(p[0]) || isNaN(p[1]); +} + +function drawSegment( + ctx, points, start, segLen, allLen, + dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls +) { + // if (smoothMonotone == null) { + // if (isMono(points, 'x')) { + // return drawMono(ctx, points, start, segLen, allLen, + // dir, smoothMin, smoothMax, smooth, 'x', connectNulls); + // } + // else if (isMono(points, 'y')) { + // return drawMono(ctx, points, start, segLen, allLen, + // dir, smoothMin, smoothMax, smooth, 'y', connectNulls); + // } + // else { + // return drawNonMono.apply(this, arguments); + // } + // } + // else if (smoothMonotone !== 'none' && isMono(points, smoothMonotone)) { + // return drawMono.apply(this, arguments); + // } + // else { + // return drawNonMono.apply(this, arguments); + // } + if (smoothMonotone === 'none' || !smoothMonotone) { + return drawNonMono.apply(this, arguments); + } + else { + return drawMono.apply(this, arguments); + } +} + +/** + * Check if points is in monotone. + * + * @param {number[][]} points Array of points which is in [x, y] form + * @param {string} smoothMonotone 'x', 'y', or 'none', stating for which + * dimension that is checking. + * If is 'none', `drawNonMono` should be + * called. + * If is undefined, either being monotone + * in 'x' or 'y' will call `drawMono`. + */ +// function isMono(points, smoothMonotone) { +// if (points.length <= 1) { +// return true; +// } + +// var dim = smoothMonotone === 'x' ? 0 : 1; +// var last = points[0][dim]; +// var lastDiff = 0; +// for (var i = 1; i < points.length; ++i) { +// var diff = points[i][dim] - last; +// if (!isNaN(diff) && !isNaN(lastDiff) +// && diff !== 0 && lastDiff !== 0 +// && ((diff >= 0) !== (lastDiff >= 0)) +// ) { +// return false; +// } +// if (!isNaN(diff) && diff !== 0) { +// lastDiff = diff; +// last = points[i][dim]; +// } +// } +// return true; +// } + +/** + * Draw smoothed line in monotone, in which only vertical or horizontal bezier + * control points will be used. This should be used when points are monotone + * either in x or y dimension. + */ +function drawMono( + ctx, points, start, segLen, allLen, + dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls +) { + var prevIdx = 0; + var idx = start; + for (var k = 0; k < segLen; k++) { + var p = points[idx]; + if (idx >= allLen || idx < 0) { + break; + } + if (isPointNull(p)) { + if (connectNulls) { + idx += dir; + continue; + } + break; + } + + if (idx === start) { + ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]); + } + else { + if (smooth > 0) { + var prevP = points[prevIdx]; + var dim = smoothMonotone === 'y' ? 1 : 0; + + // Length of control point to p, either in x or y, but not both + var ctrlLen = (p[dim] - prevP[dim]) * smooth; + + v2Copy(cp0, prevP); + cp0[dim] = prevP[dim] + ctrlLen; + + v2Copy(cp1, p); + cp1[dim] = p[dim] - ctrlLen; + + ctx.bezierCurveTo( + cp0[0], cp0[1], + cp1[0], cp1[1], + p[0], p[1] + ); + } + else { + ctx.lineTo(p[0], p[1]); + } + } + + prevIdx = idx; + idx += dir; + } + + return k; +} + +/** + * Draw smoothed line in non-monotone, in may cause undesired curve in extreme + * situations. This should be used when points are non-monotone neither in x or + * y dimension. + */ +function drawNonMono( + ctx, points, start, segLen, allLen, + dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls +) { + var prevIdx = 0; + var idx = start; + for (var k = 0; k < segLen; k++) { + var p = points[idx]; + if (idx >= allLen || idx < 0) { + break; + } + if (isPointNull(p)) { + if (connectNulls) { + idx += dir; + continue; + } + break; + } + + if (idx === start) { + ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]); + v2Copy(cp0, p); + } + else { + if (smooth > 0) { + var nextIdx = idx + dir; + var nextP = points[nextIdx]; + if (connectNulls) { + // Find next point not null + while (nextP && isPointNull(points[nextIdx])) { + nextIdx += dir; + nextP = points[nextIdx]; + } + } + + var ratioNextSeg = 0.5; + var prevP = points[prevIdx]; + var nextP = points[nextIdx]; + // Last point + if (!nextP || isPointNull(nextP)) { + v2Copy(cp1, p); + } + else { + // If next data is null in not connect case + if (isPointNull(nextP) && !connectNulls) { + nextP = p; + } + + 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 = dist(p, prevP); + lenNextSeg = dist(p, nextP); + } + + // Use ratio of seg length + ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg); + + scaleAndAdd$1(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$1(cp0, p, v, smooth * ratioNextSeg); + } + else { + ctx.lineTo(p[0], p[1]); + } + } + + prevIdx = idx; + 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 + }; +} + +var Polyline$1 = Path.extend({ + + type: 'ec-polyline', + + shape: { + points: [], + + smooth: 0, + + smoothConstraint: true, + + smoothMonotone: null, + + connectNulls: false + }, + + style: { + fill: null, + + stroke: '#000' + }, + + brush: fixClipWithShadow(Path.prototype.brush), + + buildPath: function (ctx, shape) { + var points = shape.points; + + var i = 0; + var len$$1 = points.length; + + var result = getBoundingBox(points, shape.smoothConstraint); + + if (shape.connectNulls) { + // Must remove first and last null values avoid draw error in polygon + for (; len$$1 > 0; len$$1--) { + if (!isPointNull(points[len$$1 - 1])) { + break; + } + } + for (; i < len$$1; i++) { + if (!isPointNull(points[i])) { + break; + } + } + } + while (i < len$$1) { + i += drawSegment( + ctx, points, i, len$$1, len$$1, + 1, result.min, result.max, shape.smooth, + shape.smoothMonotone, shape.connectNulls + ) + 1; + } + } +}); + +var Polygon$1 = Path.extend({ + + type: 'ec-polygon', + + shape: { + points: [], + + // Offset between stacked base points and points + stackedOnPoints: [], + + smooth: 0, + + stackedOnSmooth: 0, + + smoothConstraint: true, + + smoothMonotone: null, + + connectNulls: false + }, + + brush: fixClipWithShadow(Path.prototype.brush), + + buildPath: function (ctx, shape) { + var points = shape.points; + var stackedOnPoints = shape.stackedOnPoints; + + var i = 0; + var len$$1 = points.length; + var smoothMonotone = shape.smoothMonotone; + var bbox = getBoundingBox(points, shape.smoothConstraint); + var stackedOnBBox = getBoundingBox(stackedOnPoints, shape.smoothConstraint); + + if (shape.connectNulls) { + // Must remove first and last null values avoid draw error in polygon + for (; len$$1 > 0; len$$1--) { + if (!isPointNull(points[len$$1 - 1])) { + break; + } + } + for (; i < len$$1; i++) { + if (!isPointNull(points[i])) { + break; + } + } + } + while (i < len$$1) { + var k = drawSegment( + ctx, points, i, len$$1, len$$1, + 1, bbox.min, bbox.max, shape.smooth, + smoothMonotone, shape.connectNulls + ); + drawSegment( + ctx, stackedOnPoints, i + k - 1, k, len$$1, + -1, stackedOnBBox.min, stackedOnBBox.max, shape.stackedOnSmooth, + smoothMonotone, shape.connectNulls + ); + i += k + 1; + + ctx.closePath(); + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// FIXME step not support polar + +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.5 : 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; +} + +/** + * @param {module:echarts/coord/cartesian/Cartesian2D|module:echarts/coord/polar/Polar} coordSys + * @param {module:echarts/data/List} data + * @param {Object} dataCoordInfo + * @param {Array.>} points + */ +function getStackedOnPoints(coordSys, data, dataCoordInfo) { + if (!dataCoordInfo.valueDim) { + return []; + } + + var points = []; + for (var idx = 0, len = data.count(); idx < len; idx++) { + points.push(getStackedOnPoint(dataCoordInfo, coordSys, data, idx)); + } + + return points; +} + +function createGridClipShape(cartesian, hasAnimation, forSymbol, seriesModel) { + var xExtent = getAxisExtentWithGap(cartesian.getAxis('x')); + var yExtent = getAxisExtentWithGap(cartesian.getAxis('y')); + var isHorizontal = cartesian.getBaseAxis().isHorizontal(); + + var x = Math.min(xExtent[0], xExtent[1]); + var y = Math.min(yExtent[0], yExtent[1]); + var width = Math.max(xExtent[0], xExtent[1]) - x; + var height = Math.max(yExtent[0], yExtent[1]) - y; + + // Avoid float number rounding error for symbol on the edge of axis extent. + // See #7913 and `test/dataZoom-clip.html`. + if (forSymbol) { + x -= 0.5; + width += 0.5; + y -= 0.5; + height += 0.5; + } + else { + var lineWidth = seriesModel.get('lineStyle.width') || 2; + // Expand clip shape to avoid clipping when line value exceeds axis + var expandSize = seriesModel.get('clipOverflow') ? lineWidth / 2 : Math.max(width, height); + if (isHorizontal) { + y -= expandSize; + height += expandSize * 2; + } + else { + x -= expandSize; + width += expandSize * 2; + } + } + + var clipPath = new Rect({ + shape: { + x: x, + y: y, + width: width, + height: height + } + }); + + if (hasAnimation) { + clipPath.shape[isHorizontal ? 'width' : 'height'] = 0; + initProps(clipPath, { + shape: { + width: width, + height: height + } + }, seriesModel); + } + + return clipPath; +} + +function createPolarClipShape(polar, hasAnimation, forSymbol, seriesModel) { + var angleAxis = polar.getAngleAxis(); + var radiusAxis = polar.getRadiusAxis(); + + var radiusExtent = radiusAxis.getExtent().slice(); + radiusExtent[0] > radiusExtent[1] && radiusExtent.reverse(); + var angleExtent = angleAxis.getExtent(); + + var RADIAN = Math.PI / 180; + + // Avoid float number rounding error for symbol on the edge of axis extent. + if (forSymbol) { + radiusExtent[0] -= 0.5; + radiusExtent[1] += 0.5; + } + + var clipPath = new Sector({ + shape: { + cx: round$1(polar.cx, 1), + cy: round$1(polar.cy, 1), + r0: round$1(radiusExtent[0], 1), + r: round$1(radiusExtent[1], 1), + startAngle: -angleExtent[0] * RADIAN, + endAngle: -angleExtent[1] * RADIAN, + clockwise: angleAxis.inverse + } + }); + + if (hasAnimation) { + clipPath.shape.endAngle = -angleExtent[0] * RADIAN; + initProps(clipPath, { + shape: { + endAngle: -angleExtent[1] * RADIAN + } + }, seriesModel); + } + + return clipPath; +} + +function createClipShape(coordSys, hasAnimation, forSymbol, seriesModel) { + return coordSys.type === 'polar' + ? createPolarClipShape(coordSys, hasAnimation, forSymbol, seriesModel) + : createGridClipShape(coordSys, hasAnimation, forSymbol, seriesModel); +} + +function turnPointsIntoStep(points, coordSys, stepTurnAt) { + var baseAxis = coordSys.getBaseAxis(); + var baseIndex = baseAxis.dim === 'x' || baseAxis.dim === 'radius' ? 0 : 1; + + var stepPoints = []; + for (var i = 0; i < points.length - 1; i++) { + var nextPt = points[i + 1]; + var pt = points[i]; + stepPoints.push(pt); + + var stepPt = []; + switch (stepTurnAt) { + case 'end': + stepPt[baseIndex] = nextPt[baseIndex]; + stepPt[1 - baseIndex] = pt[1 - baseIndex]; + // default is start + stepPoints.push(stepPt); + break; + case 'middle': + // default is start + var middle = (pt[baseIndex] + nextPt[baseIndex]) / 2; + var stepPt2 = []; + stepPt[baseIndex] = stepPt2[baseIndex] = middle; + stepPt[1 - baseIndex] = pt[1 - baseIndex]; + stepPt2[1 - baseIndex] = nextPt[1 - baseIndex]; + stepPoints.push(stepPt); + stepPoints.push(stepPt2); + break; + default: + stepPt[baseIndex] = pt[baseIndex]; + stepPt[1 - baseIndex] = nextPt[1 - baseIndex]; + // default is start + stepPoints.push(stepPt); + } + } + // Last points + points[i] && stepPoints.push(points[i]); + return stepPoints; +} + +function getVisualGradient(data, coordSys) { + var visualMetaList = data.getVisual('visualMeta'); + if (!visualMetaList || !visualMetaList.length || !data.count()) { + // When data.count() is 0, gradient range can not be calculated. + return; + } + + if (coordSys.type !== 'cartesian2d') { + if (__DEV__) { + console.warn('Visual map on line style is only supported on cartesian2d.'); + } + return; + } + + var coordDim; + var visualMeta; + + for (var i = visualMetaList.length - 1; i >= 0; i--) { + var dimIndex = visualMetaList[i].dimension; + var dimName = data.dimensions[dimIndex]; + var dimInfo = data.getDimensionInfo(dimName); + coordDim = dimInfo && dimInfo.coordDim; + // Can only be x or y + if (coordDim === 'x' || coordDim === 'y') { + visualMeta = visualMetaList[i]; + break; + } + } + + if (!visualMeta) { + if (__DEV__) { + console.warn('Visual map on line style only support x or y dimension.'); + } + return; + } + + // If the area to be rendered is bigger than area defined by LinearGradient, + // the canvas spec prescribes that the color of the first stop and the last + // stop should be used. But if two stops are added at offset 0, in effect + // browsers use the color of the second stop to render area outside + // LinearGradient. So we can only infinitesimally extend area defined in + // LinearGradient to render `outerColors`. + + var axis = coordSys.getAxis(coordDim); + + // dataToCoor mapping may not be linear, but must be monotonic. + var colorStops = map(visualMeta.stops, function (stop) { + return { + coord: axis.toGlobalCoord(axis.dataToCoord(stop.value)), + color: stop.color + }; + }); + var stopLen = colorStops.length; + var outerColors = visualMeta.outerColors.slice(); + + if (stopLen && colorStops[0].coord > colorStops[stopLen - 1].coord) { + colorStops.reverse(); + outerColors.reverse(); + } + + var tinyExtent = 10; // Arbitrary value: 10px + var minCoord = colorStops[0].coord - tinyExtent; + var maxCoord = colorStops[stopLen - 1].coord + tinyExtent; + var coordSpan = maxCoord - minCoord; + + if (coordSpan < 1e-3) { + return 'transparent'; + } + + each$1(colorStops, function (stop) { + stop.offset = (stop.coord - minCoord) / coordSpan; + }); + colorStops.push({ + offset: stopLen ? colorStops[stopLen - 1].offset : 0.5, + color: outerColors[1] || 'transparent' + }); + colorStops.unshift({ // notice colorStops.length have been changed. + offset: stopLen ? colorStops[0].offset : 0.5, + color: outerColors[0] || 'transparent' + }); + + // zrUtil.each(colorStops, function (colorStop) { + // // Make sure each offset has rounded px to avoid not sharp edge + // colorStop.offset = (Math.round(colorStop.offset * (end - start) + start) - start) / (end - start); + // }); + + var gradient = new LinearGradient(0, 0, 0, 0, colorStops, true); + gradient[coordDim] = minCoord; + gradient[coordDim + '2'] = maxCoord; + + return gradient; +} + +function getIsIgnoreFunc(seriesModel, data, coordSys) { + var showAllSymbol = seriesModel.get('showAllSymbol'); + var isAuto = showAllSymbol === 'auto'; + + if (showAllSymbol && !isAuto) { + return; + } + + var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; + if (!categoryAxis) { + return; + } + + // Note that category label interval strategy might bring some weird effect + // in some scenario: users may wonder why some of the symbols are not + // displayed. So we show all symbols as possible as we can. + if (isAuto + // Simplify the logic, do not determine label overlap here. + && canShowAllSymbolForCategory(categoryAxis, data) + ) { + return; + } + + // Otherwise follow the label interval strategy on category axis. + var categoryDataDim = data.mapDimension(categoryAxis.dim); + var labelMap = {}; + + each$1(categoryAxis.getViewLabels(), function (labelItem) { + labelMap[labelItem.tickValue] = 1; + }); + + return function (dataIndex) { + return !labelMap.hasOwnProperty(data.get(categoryDataDim, dataIndex)); + }; +} + +function canShowAllSymbolForCategory(categoryAxis, data) { + // In mose cases, line is monotonous on category axis, and the label size + // is close with each other. So we check the symbol size and some of the + // label size alone with the category axis to estimate whether all symbol + // can be shown without overlap. + var axisExtent = categoryAxis.getExtent(); + var availSize = Math.abs(axisExtent[1] - axisExtent[0]) / categoryAxis.scale.count(); + isNaN(availSize) && (availSize = 0); // 0/0 is NaN. + + // Sampling some points, max 5. + var dataLen = data.count(); + var step = Math.max(1, Math.round(dataLen / 5)); + for (var dataIndex = 0; dataIndex < dataLen; dataIndex += step) { + if (SymbolClz$1.getSymbolSize( + data, dataIndex + // Only for cartesian, where `isHorizontal` exists. + )[categoryAxis.isHorizontal() ? 1 : 0] + // Empirical number + * 1.5 > availSize + ) { + return false; + } + } + + return true; +} + +Chart.extend({ + + type: 'line', + + init: function () { + var lineGroup = new 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'); + var areaStyleModel = seriesModel.getModel('areaStyle'); + + var points = data.mapArray(data.getItemLayout); + + 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 valueOrigin = areaStyleModel.get('origin'); + var dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin); + + var stackedOnPoints = getStackedOnPoints(coordSys, data, dataCoordInfo); + + var showSymbol = seriesModel.get('showSymbol'); + + var isIgnoreFunc = showSymbol && !isCoordSysPolar + && getIsIgnoreFunc(seriesModel, 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); + + // FIXME step not support polar + var step = !isCoordSysPolar && seriesModel.get('step'); + // Initialization animation or coordinate system changed + if ( + !(polyline && prevCoordSys.type === coordSys.type && step === this._step) + ) { + showSymbol && symbolDraw.updateData(data, { + isIgnore: isIgnoreFunc, + clipShape: createClipShape(coordSys, false, true, seriesModel) + }); + + if (step) { + // TODO If stacked series is not step + points = turnPointsIntoStep(points, coordSys, step); + stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step); + } + + polyline = this._newPolyline(points, coordSys, hasAnimation); + if (isAreaChart) { + polygon = this._newPolygon( + points, stackedOnPoints, + coordSys, hasAnimation + ); + } + lineGroup.setClipPath(createClipShape(coordSys, true, false, 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, false, seriesModel)); + + // Always update, or it is wrong in the case turning on legend + // because points are not changed + showSymbol && symbolDraw.updateData(data, { + isIgnore: isIgnoreFunc, + clipShape: createClipShape(coordSys, false, true, seriesModel) + }); + + // 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, step, valueOrigin + ); + } + else { + // Not do it in update with animation + if (step) { + // TODO If stacked series is not step + points = turnPointsIntoStep(points, coordSys, step); + stackedOnPoints = turnPointsIntoStep(stackedOnPoints, coordSys, step); + } + + polyline.setShape({ + points: points + }); + polygon && polygon.setShape({ + points: points, + stackedOnPoints: stackedOnPoints + }); + } + } + } + + var visualColor = getVisualGradient(data, coordSys) || data.getVisual('color'); + + polyline.useStyle(defaults( + // Use color in lineStyle first + lineStyleModel.getLineStyle(), + { + fill: 'none', + stroke: visualColor, + lineJoin: 'bevel' + } + )); + + var smooth = seriesModel.get('smooth'); + smooth = getSmooth(seriesModel.get('smooth')); + polyline.setShape({ + smooth: smooth, + smoothMonotone: seriesModel.get('smoothMonotone'), + connectNulls: seriesModel.get('connectNulls') + }); + + if (polygon) { + var stackedOnSeries = data.getCalculationInfo('stackedOnSeries'); + var stackedOnSmooth = 0; + + polygon.useStyle(defaults( + areaStyleModel.getAreaStyle(), + { + fill: visualColor, + opacity: 0.7, + lineJoin: 'bevel' + } + )); + + if (stackedOnSeries) { + stackedOnSmooth = getSmooth(stackedOnSeries.get('smooth')); + } + + polygon.setShape({ + smooth: smooth, + stackedOnSmooth: stackedOnSmooth, + smoothMonotone: seriesModel.get('smoothMonotone'), + connectNulls: seriesModel.get('connectNulls') + }); + } + + this._data = data; + // Save the coordinate system for transition animation when data changed + this._coordSys = coordSys; + this._stackedOnPoints = stackedOnPoints; + this._points = points; + this._step = step; + this._valueOrigin = valueOrigin; + }, + + dispose: function () {}, + + highlight: function (seriesModel, ecModel, api, payload) { + var data = seriesModel.getData(); + var dataIndex = queryDataIndex(data, payload); + + if (!(dataIndex instanceof Array) && 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); + if (!pt) { + // Null data + return; + } + symbol = new SymbolClz$1(data, dataIndex); + 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 + Chart.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 { + // FIXME + // can not downplay completely. + // Downplay whole series + Chart.prototype.downplay.call( + this, seriesModel, ecModel, api, payload + ); + } + }, + + /** + * @param {module:zrender/container/Group} group + * @param {Array.>} points + * @private + */ + _newPolyline: function (points) { + var polyline = this._polyline; + // Remove previous created polyline + if (polyline) { + this._lineGroup.remove(polyline); + } + + polyline = new Polyline$1({ + shape: { + points: points + }, + silent: true, + z2: 10 + }); + + this._lineGroup.add(polyline); + + this._polyline = polyline; + + return polyline; + }, + + /** + * @param {module:zrender/container/Group} group + * @param {Array.>} stackedOnPoints + * @param {Array.>} points + * @private + */ + _newPolygon: function (points, stackedOnPoints) { + var polygon = this._polygon; + // Remove previous created polygon + if (polygon) { + this._lineGroup.remove(polygon); + } + + polygon = new Polygon$1({ + shape: { + points: points, + stackedOnPoints: stackedOnPoints + }, + silent: true + }); + + this._lineGroup.add(polygon); + + this._polygon = polygon; + return polygon; + }, + + /** + * @private + */ + // FIXME Two value axis + _updateAnimation: function (data, stackedOnPoints, coordSys, api, step, valueOrigin) { + var polyline = this._polyline; + var polygon = this._polygon; + var seriesModel = data.hostModel; + + var diff = lineAnimationDiff( + this._data, data, + this._stackedOnPoints, stackedOnPoints, + this._coordSys, coordSys, + this._valueOrigin, valueOrigin + ); + + var current = diff.current; + var stackedOnCurrent = diff.stackedOnCurrent; + var next = diff.next; + var stackedOnNext = diff.stackedOnNext; + if (step) { + // TODO If stacked series is not step + current = turnPointsIntoStep(diff.current, coordSys, step); + stackedOnCurrent = turnPointsIntoStep(diff.stackedOnCurrent, coordSys, step); + next = turnPointsIntoStep(diff.next, coordSys, step); + stackedOnNext = turnPointsIntoStep(diff.stackedOnNext, coordSys, step); + } + // `diff.current` is subset of `current` (which should be ensured by + // turnPointsIntoStep), so points in `__points` can be updated when + // points in `current` are update during animation. + polyline.shape.__points = diff.current; + polyline.shape.points = current; + + updateProps(polyline, { + shape: { + points: next + } + }, seriesModel); + + if (polygon) { + polygon.setShape({ + points: current, + stackedOnPoints: stackedOnCurrent + }); + updateProps(polygon, { + shape: { + points: next, + stackedOnPoints: 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; + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 visualSymbol = function (seriesType, defaultSymbolType, legendSymbol) { + // Encoding visual for all series include which is filtered for legend drawing + return { + seriesType: seriesType, + + // For legend. + performRawSeries: true, + + reset: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + + var symbolType = seriesModel.get('symbol') || defaultSymbolType; + var symbolSize = seriesModel.get('symbolSize'); + var keepAspect = seriesModel.get('symbolKeepAspect'); + + data.setVisual({ + legendSymbol: legendSymbol || symbolType, + symbol: symbolType, + symbolSize: symbolSize, + symbolKeepAspect: keepAspect + }); + + // Only visible series has each data be visual encoded + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } + + var hasCallback = typeof symbolSize === 'function'; + + function dataEach(data, idx) { + if (typeof symbolSize === 'function') { + var rawValue = seriesModel.getRawValue(idx); + // FIXME + var params = seriesModel.getDataParams(idx); + data.setItemVisual(idx, 'symbolSize', symbolSize(rawValue, params)); + } + + if (data.hasItemOption) { + var itemModel = data.getItemModel(idx); + var itemSymbolType = itemModel.getShallow('symbol', true); + var itemSymbolSize = itemModel.getShallow('symbolSize', + true); + var itemSymbolKeepAspect = + itemModel.getShallow('symbolKeepAspect',true); + + // If has item symbol + if (itemSymbolType != null) { + data.setItemVisual(idx, 'symbol', itemSymbolType); + } + if (itemSymbolSize != null) { + // PENDING Transform symbolSize ? + data.setItemVisual(idx, 'symbolSize', itemSymbolSize); + } + if (itemSymbolKeepAspect != null) { + data.setItemVisual(idx, 'symbolKeepAspect', + itemSymbolKeepAspect); + } + } + } + + return { dataEach: (data.hasItemOption || hasCallback) ? dataEach : null }; + } + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 pointsLayout = function (seriesType) { + return { + seriesType: seriesType, + + plan: createRenderPlanner(), + + reset: function (seriesModel) { + var data = seriesModel.getData(); + var coordSys = seriesModel.coordinateSystem; + var pipelineContext = seriesModel.pipelineContext; + var isLargeRender = pipelineContext.large; + + if (!coordSys) { + return; + } + + var dims = map(coordSys.dimensions, function (dim) { + return data.mapDimension(dim); + }).slice(0, 2); + var dimLen = dims.length; + + var stackResultDim = data.getCalculationInfo('stackResultDimension'); + if (isDimensionStacked(data, dims[0] /*, dims[1]*/)) { + dims[0] = stackResultDim; + } + if (isDimensionStacked(data, dims[1] /*, dims[0]*/)) { + dims[1] = stackResultDim; + } + + function progress(params, data) { + var segCount = params.end - params.start; + var points = isLargeRender && new Float32Array(segCount * dimLen); + + for (var i = params.start, offset = 0, tmpIn = [], tmpOut = []; i < params.end; i++) { + var point; + + if (dimLen === 1) { + var x = data.get(dims[0], i); + point = !isNaN(x) && coordSys.dataToPoint(x, null, tmpOut); + } + else { + var x = tmpIn[0] = data.get(dims[0], i); + var y = tmpIn[1] = data.get(dims[1], i); + // Also {Array.}, not undefined to avoid if...else... statement + point = !isNaN(x) && !isNaN(y) && coordSys.dataToPoint(tmpIn, null, tmpOut); + } + + if (isLargeRender) { + points[offset++] = point ? point[0] : NaN; + points[offset++] = point ? point[1] : NaN; + } + else { + data.setItemLayout(i, (point && point.slice()) || [NaN, NaN]); + } + } + + isLargeRender && data.setLayout('symbolPoints', points); + } + + return dimLen && {progress: progress}; + } + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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]); + } + // NaN will cause illegal axis extent. + return isFinite(max) ? max : NaN; + }, + min: function (frame) { + var min = Infinity; + for (var i = 0; i < frame.length; i++) { + frame[i] < min && (min = frame[i]); + } + // NaN will cause illegal axis extent. + return isFinite(min) ? min : NaN; + }, + // TODO + // Median + nearest: function (frame) { + return frame[0]; + } +}; + +var indexSampler = function (frame, value) { + return Math.round(frame.length / 2); +}; + +var dataSample = function (seriesType) { + return { + + seriesType: seriesType, + + modifyOutputEnd: true, + + reset: function (seriesModel, ecModel, api) { + 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) { + // Only support sample the first dim mapped from value axis. + seriesModel.setData(data.downSample( + data.mapDimension(valueAxis.dim), 1 / rate, sampler, indexSampler + )); + } + } + } + } + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Cartesian coordinate system + * @module echarts/coord/Cartesian + * + */ + +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.} + */ + getAxes: function () { + return map(this._dimList, dimAxisMapper, this); + }, + + /** + * Get axes list by given scale type + */ + getAxesByScale: function (scaleType) { + scaleType = scaleType.toLowerCase(); + return 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.|Object.} val + * @return {Array.|Object.} + */ + dataToCoord: function (val) { + return this._dataCoordConvert(val, 'dataToCoord'); + }, + + /** + * Convert coord in nd space to data + * @param {Array.|Object.} val + * @return {Array.|Object.} + */ + 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; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 Cartesian2D(name) { + + Cartesian.call(this, name); +} + +Cartesian2D.prototype = { + + constructor: Cartesian2D, + + type: 'cartesian2d', + + /** + * @type {Array.} + * @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.} 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.} data + * @return {boolean} + */ + containData: function (data) { + return this.getAxis('x').containData(data[0]) + && this.getAxis('y').containData(data[1]); + }, + + /** + * @param {Array.} data + * @param {Array.} out + * @return {Array.} + */ + dataToPoint: function (data, reserved, out) { + var xAxis = this.getAxis('x'); + var yAxis = this.getAxis('y'); + out = out || []; + out[0] = xAxis.toGlobalCoord(xAxis.dataToCoord(data[0])); + out[1] = yAxis.toGlobalCoord(yAxis.dataToCoord(data[1])); + return out; + }, + + /** + * @param {Array.} data + * @param {Array.} out + * @return {Array.} + */ + clampData: function (data, out) { + var xScale = this.getAxis('x').scale; + var yScale = this.getAxis('y').scale; + var xAxisExtent = xScale.getExtent(); + var yAxisExtent = yScale.getExtent(); + var x = xScale.parse(data[0]); + var y = yScale.parse(data[1]); + out = out || []; + out[0] = Math.min( + Math.max(Math.min(xAxisExtent[0], xAxisExtent[1]), x), + Math.max(xAxisExtent[0], xAxisExtent[1]) + ); + out[1] = Math.min( + Math.max(Math.min(yAxisExtent[0], yAxisExtent[1]), y), + Math.max(yAxisExtent[0], yAxisExtent[1]) + ); + + return out; + }, + + /** + * @param {Array.} point + * @param {Array.} out + * @return {Array.} + */ + pointToData: function (point, out) { + var xAxis = this.getAxis('x'); + var yAxis = this.getAxis('y'); + out = out || []; + out[0] = xAxis.coordToData(xAxis.toLocalCoord(point[0])); + out[1] = yAxis.coordToData(yAxis.toLocalCoord(point[1])); + return out; + }, + + /** + * Get other axis + * @param {module:echarts/coord/cartesian/Axis2D} axis + */ + getOtherAxis: function (axis) { + return this.getAxis(axis.dim === 'x' ? 'y' : 'x'); + } + +}; + +inherits(Cartesian2D, Cartesian); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Extend axis 2d + * @constructor module:echarts/coord/cartesian/Axis2D + * @extends {module:echarts/coord/cartesian/Axis} + * @param {string} dim + * @param {*} scale + * @param {Array.} 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, + + /** + * Implemented in . + * @return {Array.} + * If not on zero of other axis, return null/undefined. + * If no axes, return an empty array. + */ + getAxesOnZeroOf: null, + + /** + * Axis model + * @param {module:echarts/coord/cartesian/AxisModel} + */ + model: null, + + isHorizontal: function () { + var position = this.position; + return position === 'top' || position === 'bottom'; + }, + + /** + * Each item cooresponds to this.getExtent(), which + * means globalExtent[0] may greater than globalExtent[1], + * unless `asc` is input. + * + * @param {boolean} [asc] + * @return {Array.} + */ + getGlobalExtent: function (asc) { + var ret = this.getExtent(); + ret[0] = this.toGlobalCoord(ret[0]); + ret[1] = this.toGlobalCoord(ret[1]); + asc && ret[0] > ret[1] && ret.reverse(); + return ret; + }, + + getOtherAxis: function () { + this.grid.getOtherAxis(); + }, + + /** + * @override + */ + pointToData: function (point, clamp) { + return this.coordToData(this.toLocalCoord(point[this.dim === 'x' ? 0 : 1]), clamp); + }, + + /** + * 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 + +}; + +inherits(Axis2D, Axis); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 defaultOption = { + show: true, + zlevel: 0, + z: 0, + // Inverse the axis. + inverse: false, + + // Axis name displayed. + name: '', + // 'start' | 'middle' | 'end' + nameLocation: 'end', + // By degree. By defualt auto rotate by nameLocation. + nameRotate: null, + nameTruncate: { + maxWidth: null, + ellipsis: '...', + placeholder: '.' + }, + // Use global text style by default. + nameTextStyle: {}, + // The gap between axisName and axisLine. + nameGap: 15, + + // Default `false` to support tooltip. + silent: false, + // Default `false` to avoid legacy user event listener fail. + triggerEvent: false, + + tooltip: { + show: false + }, + + axisPointer: {}, + + axisLine: { + show: true, + onZero: true, + onZeroAxisIndex: null, + lineStyle: { + color: '#333', + width: 1, + type: 'solid' + }, + // The arrow at both ends the the axis. + symbol: ['none', 'none'], + symbolSize: [10, 15] + }, + axisTick: { + show: true, + // Whether axisTick is inside the grid or outside the grid. + inside: false, + // The length of axisTick. + length: 5, + lineStyle: { + width: 1 + } + }, + axisLabel: { + show: true, + // Whether axisLabel is inside the grid or outside the grid. + inside: false, + rotate: 0, + // true | false | null/undefined (auto) + showMinLabel: null, + // true | false | null/undefined (auto) + showMaxLabel: null, + margin: 8, + // formatter: null, + fontSize: 12 + }, + splitLine: { + show: true, + lineStyle: { + color: ['#ccc'], + width: 1, + type: 'solid' + } + }, + splitArea: { + show: false, + areaStyle: { + color: ['rgba(250,250,250,0.3)','rgba(200,200,200,0.3)'] + } + } +}; + +var axisDefault = {}; + +axisDefault.categoryAxis = merge({ + // The gap at both ends of the axis. For categoryAxis, boolean. + boundaryGap: true, + // Set false to faster category collection. + // Only usefull in the case like: category is + // ['2012-01-01', '2012-01-02', ...], where the input + // data has been ensured not duplicate and is large data. + // null means "auto": + // if axis.data provided, do not deduplication, + // else do deduplication. + deduplication: null, + // splitArea: { + // show: false + // }, + splitLine: { + show: false + }, + axisTick: { + // If tick is align with label when boundaryGap is true + alignWithLabel: false, + interval: 'auto' + }, + axisLabel: { + interval: 'auto' + } +}, defaultOption); + +axisDefault.valueAxis = merge({ + // The gap at both ends of the axis. For value axis, [GAP, GAP], where + // `GAP` can be an absolute pixel number (like `35`), or percent (like `'30%'`) + boundaryGap: [0, 0], + + // TODO + // min/max: [30, datamin, 60] or [20, datamin] or [datamin, 60] + + // Min value of the axis. can be: + // + a number + // + 'dataMin': use the min value in data. + // + null/undefined: auto decide min value (consider pretty look and boundaryGap). + // min: null, + + // Max value of the axis. can be: + // + a number + // + 'dataMax': use the max value in data. + // + null/undefined: auto decide max value (consider pretty look and boundaryGap). + // 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 + + // Optional value can be: + // + `false`: always include value 0. + // + `true`: the extent do not consider value 0. + // scale: false, + + // AxisTick and axisLabel and splitLine are caculated based on splitNumber. + splitNumber: 5 + + // Interval specifies the span of the ticks is mandatorily. + // interval: null + + // Specify min interval when auto calculate tick interval. + // minInterval: null + + // Specify max interval when auto calculate tick interval. + // maxInterval: null + +}, defaultOption); + +axisDefault.timeAxis = defaults({ + scale: true, + min: 'dataMin', + max: 'dataMax' +}, axisDefault.valueAxis); + +axisDefault.logAxis = defaults({ + scale: true, + logBase: 10 +}, axisDefault.valueAxis); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// 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] + */ +var axisModelCreator = function (axisName, BaseAxisModelClass, axisTypeDefaulter, extraDefaultOption) { + + each$1(AXIS_TYPES, function (axisType) { + + BaseAxisModelClass.extend({ + + /** + * @readOnly + */ + type: axisName + 'Axis.' + axisType, + + mergeDefaultAndTheme: function (option, ecModel) { + var layoutMode = this.layoutMode; + var inputPositionParams = layoutMode + ? getLayoutParams(option) : {}; + + var themeModel = ecModel.getTheme(); + merge(option, themeModel.get(axisType + 'Axis')); + merge(option, this.getDefaultOption()); + + option.type = axisTypeDefaulter(axisName, option); + + if (layoutMode) { + mergeLayoutParam(option, inputPositionParams, layoutMode); + } + }, + + /** + * @override + */ + optionUpdated: function () { + var thisOption = this.option; + if (thisOption.type === 'category') { + this.__ordinalMeta = OrdinalMeta.createByAxisModel(this); + } + }, + + /** + * Should not be called before all of 'getInitailData' finished. + * Because categories are collected during initializing data. + */ + getCategories: function (rawData) { + var option = this.option; + // FIXME + // warning if called before all of 'getInitailData' finished. + if (option.type === 'category') { + if (rawData) { + return option.data; + } + return this.__ordinalMeta.categories; + } + }, + + getOrdinalMeta: function () { + return this.__ordinalMeta; + }, + + defaultOption: mergeAll( + [ + {}, + axisDefault[axisType + 'Axis'], + extraDefaultOption + ], + true + ) + }); + }); + + ComponentModel.registerSubTypeDefaulter( + axisName + 'Axis', + curry(axisTypeDefaulter, axisName) + ); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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(); + }, + + /** + * @override + * @return {module:echarts/model/Component} + */ + getCoordSysModel: function () { + return this.ecModel.queryComponents({ + mainType: 'grid', + index: this.option.gridIndex, + id: this.option.gridId + })[0]; + } + +}); + +function getAxisType(axisDim, option) { + // Default axis with data is category axis + return option.type || (option.data ? 'category' : 'value'); +} + +merge(AxisModel.prototype, axisModelCommonMixin); + +var extraOption = { + // gridIndex: 0, + // gridId: '', + + // Offset is for multiple axis on the same position + offset: 0 +}; + +axisModelCreator('x', AxisModel, getAxisType, extraOption); +axisModelCreator('y', AxisModel, getAxisType, extraOption); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Grid 是在有直角坐标系的时候必须要存在的 +// 所以这里也要被 Cartesian2D 依赖 + +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' + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Grid is a region which contains at most 4 cartesian systems + * + * TODO Default cartesian + */ + +// Depends on GridModel, AxisModel, which performs preprocess. +/** + * Check if the axis is used in the specified grid + * @inner + */ +function isAxisUsedInTheGrid(axisModel, gridModel, ecModel) { + return axisModel.getCoordSysModel() === gridModel; +} + +function Grid(gridModel, ecModel, api) { + /** + * @type {Object.} + * @private + */ + this._coordsMap = {}; + + /** + * @type {Array.} + * @private + */ + this._coordsList = []; + + /** + * @type {Object.} + * @private + */ + this._axesMap = {}; + + /** + * @type {Array.} + * @private + */ + this._axesList = []; + + this._initCartesian(gridModel, ecModel, api); + + this.model = gridModel; +} + +var gridProto = Grid.prototype; + +gridProto.type = 'grid'; + +gridProto.axisPointerEnabled = true; + +gridProto.getRect = function () { + return this._rect; +}; + +gridProto.update = function (ecModel, api) { + + var axesMap = this._axesMap; + + this._updateScale(ecModel, this.model); + + each$1(axesMap.x, function (xAxis) { + niceScaleExtent(xAxis.scale, xAxis.model); + }); + each$1(axesMap.y, function (yAxis) { + niceScaleExtent(yAxis.scale, yAxis.model); + }); + each$1(axesMap.x, function (xAxis) { + fixAxisOnZero(axesMap, 'y', xAxis); + }); + each$1(axesMap.y, function (yAxis) { + fixAxisOnZero(axesMap, 'x', yAxis); + }); + + // Resize again if containLabel is enabled + // FIXME It may cause getting wrong grid size in data processing stage + this.resize(this.model, api); +}; + +function fixAxisOnZero(axesMap, otherAxisDim, axis) { + + axis.getAxesOnZeroOf = function () { + // TODO: onZero of multiple axes. + return otherAxis ? [otherAxis] : []; + }; + + // onZero can not be enabled in these two situations: + // 1. When any other axis is a category axis. + // 2. When no axis is cross 0 point. + var otherAxes = axesMap[otherAxisDim]; + + var otherAxis; + var axisModel = axis.model; + var onZero = axisModel.get('axisLine.onZero'); + var onZeroAxisIndex = axisModel.get('axisLine.onZeroAxisIndex'); + + if (!onZero) { + return; + } + + // If target axis is specified. + if (onZeroAxisIndex != null) { + if (canOnZeroToAxis(otherAxes[onZeroAxisIndex])) { + otherAxis = otherAxes[onZeroAxisIndex]; + } + return; + } + + // Find the first available other axis. + for (var idx in otherAxes) { + if (otherAxes.hasOwnProperty(idx) && canOnZeroToAxis(otherAxes[idx])) { + otherAxis = otherAxes[idx]; + break; + } + } +} + +function canOnZeroToAxis(axis) { + return axis && axis.type !== 'category' && axis.type !== 'time' && ifAxisCrossZero(axis); +} + +/** + * Resize the grid + * @param {module:echarts/coord/cartesian/GridModel} gridModel + * @param {module:echarts/ExtensionAPI} api + */ +gridProto.resize = function (gridModel, api, ignoreContainLabel) { + + var gridRect = getLayoutRect( + gridModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + }); + + this._rect = gridRect; + + var axesList = this._axesList; + + adjustAxes(); + + // Minus label size + if (!ignoreContainLabel && gridModel.get('containLabel')) { + each$1(axesList, function (axis) { + if (!axis.model.get('axisLabel.inside')) { + var labelUnionRect = estimateLabelUnionRect(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$1(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]); + updateAxisTransform(axis, isHorizontal ? gridRect.x : gridRect.y); + }); + } +}; + +/** + * @param {string} axisType + * @param {number} [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) { + if (axesMapOnDim.hasOwnProperty(name)) { + return axesMapOnDim[name]; + } + } + } + return axesMapOnDim[axisIndex]; + } +}; + +/** + * @return {Array.} + */ +gridProto.getAxes = function () { + return this._axesList.slice(); +}; + +/** + * Usage: + * grid.getCartesian(xAxisIndex, yAxisIndex); + * grid.getCartesian(xAxisIndex); + * grid.getCartesian(null, yAxisIndex); + * grid.getCartesian({xAxisIndex: ..., yAxisIndex: ...}); + * + * @param {number|Object} [xAxisIndex] + * @param {number} [yAxisIndex] + */ +gridProto.getCartesian = function (xAxisIndex, yAxisIndex) { + if (xAxisIndex != null && yAxisIndex != null) { + var key = 'x' + xAxisIndex + 'y' + yAxisIndex; + return this._coordsMap[key]; + } + + if (isObject$1(xAxisIndex)) { + yAxisIndex = xAxisIndex.yAxisIndex; + xAxisIndex = xAxisIndex.xAxisIndex; + } + // When only xAxisIndex or yAxisIndex given, find its first cartesian. + for (var i = 0, coordList = this._coordsList; i < coordList.length; i++) { + if (coordList[i].getAxis('x').index === xAxisIndex + || coordList[i].getAxis('y').index === yAxisIndex + ) { + return coordList[i]; + } + } +}; + +gridProto.getCartesians = function () { + return this._coordsList.slice(); +}; + +/** + * @implements + * see {module:echarts/CoodinateSystem} + */ +gridProto.convertToPixel = function (ecModel, finder, value) { + var target = this._findConvertTarget(ecModel, finder); + + return target.cartesian + ? target.cartesian.dataToPoint(value) + : target.axis + ? target.axis.toGlobalCoord(target.axis.dataToCoord(value)) + : null; +}; + +/** + * @implements + * see {module:echarts/CoodinateSystem} + */ +gridProto.convertFromPixel = function (ecModel, finder, value) { + var target = this._findConvertTarget(ecModel, finder); + + return target.cartesian + ? target.cartesian.pointToData(value) + : target.axis + ? target.axis.coordToData(target.axis.toLocalCoord(value)) + : null; +}; + +/** + * @inner + */ +gridProto._findConvertTarget = function (ecModel, finder) { + var seriesModel = finder.seriesModel; + var xAxisModel = finder.xAxisModel + || (seriesModel && seriesModel.getReferringComponents('xAxis')[0]); + var yAxisModel = finder.yAxisModel + || (seriesModel && seriesModel.getReferringComponents('yAxis')[0]); + var gridModel = finder.gridModel; + var coordsList = this._coordsList; + var cartesian; + var axis; + + if (seriesModel) { + cartesian = seriesModel.coordinateSystem; + indexOf(coordsList, cartesian) < 0 && (cartesian = null); + } + else if (xAxisModel && yAxisModel) { + cartesian = this.getCartesian(xAxisModel.componentIndex, yAxisModel.componentIndex); + } + else if (xAxisModel) { + axis = this.getAxis('x', xAxisModel.componentIndex); + } + else if (yAxisModel) { + axis = this.getAxis('y', yAxisModel.componentIndex); + } + // Lowest priority. + else if (gridModel) { + var grid = gridModel.coordinateSystem; + if (grid === this) { + cartesian = this._coordsList[0]; + } + } + + return {cartesian: cartesian, axis: axis}; +}; + +/** + * @implements + * see {module:echarts/CoodinateSystem} + */ +gridProto.containPoint = function (point) { + var coord = this._coordsList[0]; + if (coord) { + return coord.containPoint(point); + } +}; + +/** + * 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$1(axesMap.x, function (xAxis, xAxisIndex) { + each$1(axesMap.y, function (yAxis, yAxisIndex) { + var key = 'x' + xAxisIndex + 'y' + yAxisIndex; + var cartesian = new Cartesian2D(key); + + cartesian.grid = this; + cartesian.model = gridModel; + + 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, createScaleByModel(axisModel), + [0, 0], + axisModel.get('type'), + axisPosition + ); + + 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; + + // Inject grid info axis + axis.grid = this; + + // 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 + each$1(this._axesList, function (axis) { + axis.scale.setExtent(Infinity, -Infinity); + }); + ecModel.eachSeries(function (seriesModel) { + if (isCartesian2D(seriesModel)) { + var axesModels = findAxesModels(seriesModel, ecModel); + var xAxisModel = axesModels[0]; + var yAxisModel = axesModels[1]; + + if (!isAxisUsedInTheGrid(xAxisModel, gridModel, ecModel) + || !isAxisUsedInTheGrid(yAxisModel, gridModel, ecModel) + ) { + return; + } + + var cartesian = this.getCartesian( + xAxisModel.componentIndex, yAxisModel.componentIndex + ); + 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$1(data.mapDimension(axis.dim, true), function (dim) { + axis.scale.unionExtentFromData( + // For example, the extent of the orginal dimension + // is [0.1, 0.5], the extent of the `stackResultDimension` + // is [7, 9], the final extent should not include [0.1, 0.5]. + data, getStackedDimension(data, dim) + ); + }); + } +}; + +/** + * @param {string} [dim] 'x' or 'y' or 'auto' or null/undefined + * @return {Object} {baseAxes: [], otherAxes: []} + */ +gridProto.getTooltipAxes = function (dim) { + var baseAxes = []; + var otherAxes = []; + + each$1(this.getCartesians(), function (cartesian) { + var baseAxis = (dim != null && dim !== 'auto') + ? cartesian.getAxis(dim) : cartesian.getBaseAxis(); + var otherAxis = cartesian.getOtherAxis(baseAxis); + indexOf(baseAxes, baseAxis) < 0 && baseAxes.push(baseAxis); + indexOf(otherAxes, otherAxis) < 0 && otherAxes.push(otherAxis); + }); + + return {baseAxes: baseAxes, otherAxes: otherAxes}; +}; + +/** + * @inner + */ +function updateAxisTransform(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; + }; +} + +var axesTypes = ['xAxis', 'yAxis']; +/** + * @inner + */ +function findAxesModels(seriesModel, ecModel) { + return map(axesTypes, function (axisType) { + var axisModel = seriesModel.getReferringComponents(axisType)[0]; + + if (__DEV__) { + if (!axisModel) { + throw new Error(axisType + ' "' + retrieve( + seriesModel.get(axisType + 'Index'), + seriesModel.get(axisType + 'Id'), + 0 + ) + '" not found'); + } + } + return axisModel; + }); +} + +/** + * @inner + */ +function isCartesian2D(seriesModel) { + return seriesModel.get('coordinateSystem') === 'cartesian2d'; +} + +Grid.create = function (ecModel, api) { + var grids = []; + ecModel.eachComponent('grid', function (gridModel, idx) { + var grid = new Grid(gridModel, ecModel, api); + grid.name = 'grid_' + idx; + // dataSampling requires axis extent, so resize + // should be performed in create stage. + grid.resize(gridModel, api, true); + + gridModel.coordinateSystem = grid; + + grids.push(grid); + }); + + // Inject the coordinateSystems into seriesModel + ecModel.eachSeries(function (seriesModel) { + if (!isCartesian2D(seriesModel)) { + return; + } + + var axesModels = findAxesModels(seriesModel, ecModel); + var xAxisModel = axesModels[0]; + var yAxisModel = axesModels[1]; + + var gridModel = xAxisModel.getCoordSysModel(); + + if (__DEV__) { + if (!gridModel) { + throw new Error( + 'Grid "' + retrieve( + xAxisModel.get('gridIndex'), + xAxisModel.get('gridId'), + 0 + ) + '" not found' + ); + } + if (xAxisModel.getCoordSysModel() !== yAxisModel.getCoordSysModel()) { + throw new Error('xAxis and yAxis must use the same grid'); + } + } + + var grid = gridModel.coordinateSystem; + + seriesModel.coordinateSystem = grid.getCartesian( + xAxisModel.componentIndex, yAxisModel.componentIndex + ); + }); + + return grids; +}; + +// For deciding which dimensions to use when creating list data +Grid.dimensions = Grid.prototype.dimensions = Cartesian2D.prototype.dimensions; + +CoordinateSystemManager.register('cartesian2d', Grid); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 PI$2 = Math.PI; + +function makeAxisEventDataBase(axisModel) { + var eventData = { + componentType: axisModel.mainType + }; + eventData[axisModel.mainType + 'Index'] = axisModel.componentIndex; + return eventData; +} + +/** + * 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.} opt.position [x, y] + * @param {number} opt.rotation by radian + * @param {number} [opt.nameDirection=1] 1 or -1 Used when nameLocation is 'middle' or 'center'. + * @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.axisLabelShow] default get from axisModel. + * @param {string} [opt.axisName] default get from axisModel. + * @param {number} [opt.axisNameAvailableWidth] + * @param {number} [opt.labelRotate] by degree, default get from axisModel. + * @param {number} [opt.strokeContainThreshold] Default label interval when label + * @param {number} [opt.nameTruncateMaxWidth] + */ +var AxisBuilder = function (axisModel, opt) { + + /** + * @readOnly + */ + this.opt = opt; + + /** + * @readOnly + */ + this.axisModel = axisModel; + + // Default value + defaults( + opt, + { + labelOffset: 0, + nameDirection: 1, + tickDirection: 1, + labelDirection: 1, + silent: true + } + ); + + /** + * @readOnly + */ + this.group = new Group(); + + // FIXME Not use a seperate text group? + var dumbGroup = new Group({ + position: opt.position.slice(), + rotation: opt.rotation + }); + + // this.group.add(dumbGroup); + // this._dumbGroup = dumbGroup; + + dumbGroup.updateTransform(); + this._transform = dumbGroup.transform; + + this._dumbGroup = dumbGroup; +}; + +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(); + + var matrix = this._transform; + var pt1 = [extent[0], 0]; + var pt2 = [extent[1], 0]; + if (matrix) { + applyTransform(pt1, pt1, matrix); + applyTransform(pt2, pt2, matrix); + } + + var lineStyle = extend( + { + lineCap: 'round' + }, + axisModel.getModel('axisLine.lineStyle').getLineStyle() + ); + + this.group.add(new Line(subPixelOptimizeLine({ + // Id for animation + anid: 'line', + + shape: { + x1: pt1[0], + y1: pt1[1], + x2: pt2[0], + y2: pt2[1] + }, + style: lineStyle, + strokeContainThreshold: opt.strokeContainThreshold || 5, + silent: true, + z2: 1 + }))); + + var arrows = axisModel.get('axisLine.symbol'); + var arrowSize = axisModel.get('axisLine.symbolSize'); + + var arrowOffset = axisModel.get('axisLine.symbolOffset') || 0; + if (typeof arrowOffset === 'number') { + arrowOffset = [arrowOffset, arrowOffset]; + } + + if (arrows != null) { + if (typeof arrows === 'string') { + // Use the same arrow for start and end point + arrows = [arrows, arrows]; + } + if (typeof arrowSize === 'string' + || typeof arrowSize === 'number' + ) { + // Use the same size for width and height + arrowSize = [arrowSize, arrowSize]; + } + + var symbolWidth = arrowSize[0]; + var symbolHeight = arrowSize[1]; + + each$1([{ + rotate: opt.rotation + Math.PI / 2, + offset: arrowOffset[0], + r: 0 + }, { + rotate: opt.rotation - Math.PI / 2, + offset: arrowOffset[1], + r: Math.sqrt((pt1[0] - pt2[0]) * (pt1[0] - pt2[0]) + + (pt1[1] - pt2[1]) * (pt1[1] - pt2[1])) + }], function (point, index) { + if (arrows[index] !== 'none' && arrows[index] != null) { + var symbol = createSymbol( + arrows[index], + -symbolWidth / 2, + -symbolHeight / 2, + symbolWidth, + symbolHeight, + lineStyle.stroke, + true + ); + + // Calculate arrow position with offset + var r = point.r + point.offset; + var pos = [ + pt1[0] + r * Math.cos(opt.rotation), + pt1[1] - r * Math.sin(opt.rotation) + ]; + + symbol.attr({ + rotation: point.rotate, + position: pos, + silent: true + }); + this.group.add(symbol); + } + }, this); + } + }, + + /** + * @private + */ + axisTickLabel: function () { + var axisModel = this.axisModel; + var opt = this.opt; + + var tickEls = buildAxisTick(this, axisModel, opt); + var labelEls = buildAxisLabel(this, axisModel, opt); + + fixMinMaxLabelShow(axisModel, labelEls, tickEls); + }, + + /** + * @private + */ + axisName: function () { + var opt = this.opt; + var axisModel = this.axisModel; + var name = retrieve(opt.axisName, 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. + isNameLocationCenter(nameLocation) ? opt.labelOffset + nameDirection * gap : 0 + ]; + + var labelLayout; + + var nameRotation = axisModel.get('nameRotate'); + if (nameRotation != null) { + nameRotation = nameRotation * PI$2 / 180; // To radian. + } + + var axisNameAvailableWidth; + + if (isNameLocationCenter(nameLocation)) { + labelLayout = innerTextLayout( + opt.rotation, + nameRotation != null ? nameRotation : opt.rotation, // Adapt to axis. + nameDirection + ); + } + else { + labelLayout = endTextLayout( + opt, nameLocation, nameRotation || 0, extent + ); + + axisNameAvailableWidth = opt.axisNameAvailableWidth; + if (axisNameAvailableWidth != null) { + axisNameAvailableWidth = Math.abs( + axisNameAvailableWidth / Math.sin(labelLayout.rotation) + ); + !isFinite(axisNameAvailableWidth) && (axisNameAvailableWidth = null); + } + } + + var textFont = textStyleModel.getFont(); + + var truncateOpt = axisModel.get('nameTruncate', true) || {}; + var ellipsis = truncateOpt.ellipsis; + var maxWidth = retrieve( + opt.nameTruncateMaxWidth, truncateOpt.maxWidth, axisNameAvailableWidth + ); + // FIXME + // truncate rich text? (consider performance) + var truncatedText = (ellipsis != null && maxWidth != null) + ? truncateText$1( + name, maxWidth, textFont, ellipsis, + {minChar: 2, placeholder: truncateOpt.placeholder} + ) + : name; + + var tooltipOpt = axisModel.get('tooltip', true); + + var mainType = axisModel.mainType; + var formatterParams = { + componentType: mainType, + name: name, + $vars: ['name'] + }; + formatterParams[mainType + 'Index'] = axisModel.componentIndex; + + var textEl = new Text({ + // Id for animation + anid: 'name', + + __fullText: name, + __truncatedText: truncatedText, + + position: pos, + rotation: labelLayout.rotation, + silent: isSilent(axisModel), + z2: 1, + tooltip: (tooltipOpt && tooltipOpt.show) + ? extend({ + content: name, + formatter: function () { + return name; + }, + formatterParams: formatterParams + }, tooltipOpt) + : null + }); + + setTextStyle(textEl.style, textStyleModel, { + text: truncatedText, + textFont: textFont, + textFill: textStyleModel.getTextColor() + || axisModel.get('axisLine.lineStyle.color'), + textAlign: labelLayout.textAlign, + textVerticalAlign: labelLayout.textVerticalAlign + }); + + if (axisModel.get('triggerEvent')) { + textEl.eventData = makeAxisEventDataBase(axisModel); + textEl.eventData.targetType = 'axisName'; + textEl.eventData.name = name; + } + + // FIXME + this._dumbGroup.add(textEl); + textEl.updateTransform(); + + this.group.add(textEl); + + textEl.decomposeTransform(); + } + +}; + +/** + * @public + * @static + * @param {Object} opt + * @param {number} axisRotation in radian + * @param {number} textRotation in radian + * @param {number} direction + * @return {Object} { + * rotation, // according to axis + * textAlign, + * textVerticalAlign + * } + */ +var innerTextLayout = AxisBuilder.innerTextLayout = function (axisRotation, textRotation, direction) { + var rotationDiff = remRadian(textRotation - axisRotation); + var textAlign; + var textVerticalAlign; + + if (isRadianAroundZero(rotationDiff)) { // Label is parallel with axis line. + textVerticalAlign = direction > 0 ? 'top' : 'bottom'; + textAlign = 'center'; + } + else if (isRadianAroundZero(rotationDiff - PI$2)) { // Label is inverse parallel with axis line. + textVerticalAlign = direction > 0 ? 'bottom' : 'top'; + textAlign = 'center'; + } + else { + textVerticalAlign = 'middle'; + + if (rotationDiff > 0 && rotationDiff < PI$2) { + textAlign = direction > 0 ? 'right' : 'left'; + } + else { + textAlign = direction > 0 ? 'left' : 'right'; + } + } + + return { + rotation: rotationDiff, + textAlign: textAlign, + textVerticalAlign: textVerticalAlign + }; +}; + +function endTextLayout(opt, textPosition, textRotate, extent) { + var rotationDiff = remRadian(textRotate - opt.rotation); + var textAlign; + var textVerticalAlign; + var inverse = extent[0] > extent[1]; + var onLeft = (textPosition === 'start' && !inverse) + || (textPosition !== 'start' && inverse); + + if (isRadianAroundZero(rotationDiff - PI$2 / 2)) { + textVerticalAlign = onLeft ? 'bottom' : 'top'; + textAlign = 'center'; + } + else if (isRadianAroundZero(rotationDiff - PI$2 * 1.5)) { + textVerticalAlign = onLeft ? 'top' : 'bottom'; + textAlign = 'center'; + } + else { + textVerticalAlign = 'middle'; + if (rotationDiff < PI$2 * 1.5 && rotationDiff > PI$2 / 2) { + textAlign = onLeft ? 'left' : 'right'; + } + else { + textAlign = onLeft ? 'right' : 'left'; + } + } + + return { + rotation: rotationDiff, + textAlign: textAlign, + textVerticalAlign: textVerticalAlign + }; +} + +function isSilent(axisModel) { + var tooltipOpt = axisModel.get('tooltip'); + return axisModel.get('silent') + // Consider mouse cursor, add these restrictions. + || !( + axisModel.get('triggerEvent') || (tooltipOpt && tooltipOpt.show) + ); +} + +function fixMinMaxLabelShow(axisModel, labelEls, tickEls) { + // 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 + var showMinLabel = axisModel.get('axisLabel.showMinLabel'); + var showMaxLabel = axisModel.get('axisLabel.showMaxLabel'); + + // FIXME + // Have not consider onBand yet, where tick els is more than label els. + + labelEls = labelEls || []; + tickEls = tickEls || []; + + var firstLabel = labelEls[0]; + var nextLabel = labelEls[1]; + var lastLabel = labelEls[labelEls.length - 1]; + var prevLabel = labelEls[labelEls.length - 2]; + + var firstTick = tickEls[0]; + var nextTick = tickEls[1]; + var lastTick = tickEls[tickEls.length - 1]; + var prevTick = tickEls[tickEls.length - 2]; + + if (showMinLabel === false) { + ignoreEl(firstLabel); + ignoreEl(firstTick); + } + else if (isTwoLabelOverlapped(firstLabel, nextLabel)) { + if (showMinLabel) { + ignoreEl(nextLabel); + ignoreEl(nextTick); + } + else { + ignoreEl(firstLabel); + ignoreEl(firstTick); + } + } + + if (showMaxLabel === false) { + ignoreEl(lastLabel); + ignoreEl(lastTick); + } + else if (isTwoLabelOverlapped(prevLabel, lastLabel)) { + if (showMaxLabel) { + ignoreEl(prevLabel); + ignoreEl(prevTick); + } + else { + ignoreEl(lastLabel); + ignoreEl(lastTick); + } + } +} + +function ignoreEl(el) { + el && (el.ignore = true); +} + +function isTwoLabelOverlapped(current, next, labelLayout) { + // current and next has the same rotation. + var firstRect = current && current.getBoundingRect().clone(); + var nextRect = next && next.getBoundingRect().clone(); + + if (!firstRect || !nextRect) { + return; + } + + // When checking intersect of two rotated labels, we use mRotationBack + // to avoid that boundingRect is enlarge when using `boundingRect.applyTransform`. + var mRotationBack = identity([]); + rotate(mRotationBack, mRotationBack, -current.rotation); + + firstRect.applyTransform(mul$1([], mRotationBack, current.getLocalTransform())); + nextRect.applyTransform(mul$1([], mRotationBack, next.getLocalTransform())); + + return firstRect.intersect(nextRect); +} + +function isNameLocationCenter(nameLocation) { + return nameLocation === 'middle' || nameLocation === 'center'; +} + +function buildAxisTick(axisBuilder, axisModel, opt) { + var axis = axisModel.axis; + + if (!axisModel.get('axisTick.show') || axis.scale.isBlank()) { + return; + } + + var tickModel = axisModel.getModel('axisTick'); + + var lineStyleModel = tickModel.getModel('lineStyle'); + var tickLen = tickModel.get('length'); + + var ticksCoords = axis.getTicksCoords(); + + var pt1 = []; + var pt2 = []; + var matrix = axisBuilder._transform; + + var tickEls = []; + + for (var i = 0; i < ticksCoords.length; i++) { + var tickCoord = ticksCoords[i].coord; + + pt1[0] = tickCoord; + pt1[1] = 0; + pt2[0] = tickCoord; + pt2[1] = opt.tickDirection * tickLen; + + if (matrix) { + applyTransform(pt1, pt1, matrix); + applyTransform(pt2, pt2, matrix); + } + // Tick line, Not use group transform to have better line draw + var tickEl = new Line(subPixelOptimizeLine({ + // Id for animation + anid: 'tick_' + ticksCoords[i].tickValue, + + shape: { + x1: pt1[0], + y1: pt1[1], + x2: pt2[0], + y2: pt2[1] + }, + style: defaults( + lineStyleModel.getLineStyle(), + { + stroke: axisModel.get('axisLine.lineStyle.color') + } + ), + z2: 2, + silent: true + })); + axisBuilder.group.add(tickEl); + tickEls.push(tickEl); + } + + return tickEls; +} + +function buildAxisLabel(axisBuilder, axisModel, opt) { + var axis = axisModel.axis; + var show = retrieve(opt.axisLabelShow, axisModel.get('axisLabel.show')); + + if (!show || axis.scale.isBlank()) { + return; + } + + var labelModel = axisModel.getModel('axisLabel'); + var labelMargin = labelModel.get('margin'); + var labels = axis.getViewLabels(); + + // Special label rotate. + var labelRotation = ( + retrieve(opt.labelRotate, labelModel.get('rotate')) || 0 + ) * PI$2 / 180; + + var labelLayout = innerTextLayout(opt.rotation, labelRotation, opt.labelDirection); + var rawCategoryData = axisModel.getCategories(true); + + var labelEls = []; + var silent = isSilent(axisModel); + var triggerEvent = axisModel.get('triggerEvent'); + + each$1(labels, function (labelItem, index) { + var tickValue = labelItem.tickValue; + var formattedLabel = labelItem.formattedLabel; + var rawLabel = labelItem.rawLabel; + + var itemLabelModel = labelModel; + if (rawCategoryData && rawCategoryData[tickValue] && rawCategoryData[tickValue].textStyle) { + itemLabelModel = new Model( + rawCategoryData[tickValue].textStyle, labelModel, axisModel.ecModel + ); + } + + var textColor = itemLabelModel.getTextColor() + || axisModel.get('axisLine.lineStyle.color'); + + var tickCoord = axis.dataToCoord(tickValue); + var pos = [ + tickCoord, + opt.labelOffset + opt.labelDirection * labelMargin + ]; + + var textEl = new Text({ + // Id for animation + anid: 'label_' + tickValue, + position: pos, + rotation: labelLayout.rotation, + silent: silent, + z2: 10 + }); + + setTextStyle(textEl.style, itemLabelModel, { + text: formattedLabel, + textAlign: itemLabelModel.getShallow('align', true) + || labelLayout.textAlign, + textVerticalAlign: itemLabelModel.getShallow('verticalAlign', true) + || itemLabelModel.getShallow('baseline', true) + || labelLayout.textVerticalAlign, + textFill: typeof textColor === 'function' + ? textColor( + // (1) In category axis with data zoom, tick is not the original + // index of axis.data. So tick should not be exposed to user + // in category axis. + // (2) Compatible with previous version, which always use formatted label as + // input. But in interval scale the formatted label is like '223,445', which + // maked user repalce ','. So we modify it to return original val but remain + // it as 'string' to avoid error in replacing. + axis.type === 'category' + ? rawLabel + : axis.type === 'value' + ? tickValue + '' + : tickValue, + index + ) + : textColor + }); + + // Pack data for mouse event + if (triggerEvent) { + textEl.eventData = makeAxisEventDataBase(axisModel); + textEl.eventData.targetType = 'axisLabel'; + textEl.eventData.value = rawLabel; + } + + // FIXME + axisBuilder._dumbGroup.add(textEl); + textEl.updateTransform(); + + labelEls.push(textEl); + axisBuilder.group.add(textEl); + + textEl.decomposeTransform(); + + }); + + return labelEls; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$6 = each$1; +var curry$1 = curry; + +// Build axisPointerModel, mergin tooltip.axisPointer model for each axis. +// allAxesInfo should be updated when setOption performed. +function collect(ecModel, api) { + var result = { + /** + * key: makeKey(axis.model) + * value: { + * axis, + * coordSys, + * axisPointerModel, + * triggerTooltip, + * involveSeries, + * snap, + * seriesModels, + * seriesDataCount + * } + */ + axesInfo: {}, + seriesInvolved: false, + /** + * key: makeKey(coordSys.model) + * value: Object: key makeKey(axis.model), value: axisInfo + */ + coordSysAxesInfo: {}, + coordSysMap: {} + }; + + collectAxesInfo(result, ecModel, api); + + // Check seriesInvolved for performance, in case too many series in some chart. + result.seriesInvolved && collectSeriesInfo(result, ecModel); + + return result; +} + +function collectAxesInfo(result, ecModel, api) { + var globalTooltipModel = ecModel.getComponent('tooltip'); + var globalAxisPointerModel = ecModel.getComponent('axisPointer'); + // links can only be set on global. + var linksOption = globalAxisPointerModel.get('link', true) || []; + var linkGroups = []; + + // Collect axes info. + each$6(api.getCoordinateSystems(), function (coordSys) { + // Some coordinate system do not support axes, like geo. + if (!coordSys.axisPointerEnabled) { + return; + } + + var coordSysKey = makeKey(coordSys.model); + var axesInfoInCoordSys = result.coordSysAxesInfo[coordSysKey] = {}; + result.coordSysMap[coordSysKey] = coordSys; + + // Set tooltip (like 'cross') is a convienent way to show axisPointer + // for user. So we enable seting tooltip on coordSys model. + var coordSysModel = coordSys.model; + var baseTooltipModel = coordSysModel.getModel('tooltip', globalTooltipModel); + + each$6(coordSys.getAxes(), curry$1(saveTooltipAxisInfo, false, null)); + + // If axis tooltip used, choose tooltip axis for each coordSys. + // Notice this case: coordSys is `grid` but not `cartesian2D` here. + if (coordSys.getTooltipAxes + && globalTooltipModel + // If tooltip.showContent is set as false, tooltip will not + // show but axisPointer will show as normal. + && baseTooltipModel.get('show') + ) { + // Compatible with previous logic. But series.tooltip.trigger: 'axis' + // or series.data[n].tooltip.trigger: 'axis' are not support any more. + var triggerAxis = baseTooltipModel.get('trigger') === 'axis'; + var cross = baseTooltipModel.get('axisPointer.type') === 'cross'; + var tooltipAxes = coordSys.getTooltipAxes(baseTooltipModel.get('axisPointer.axis')); + if (triggerAxis || cross) { + each$6(tooltipAxes.baseAxes, curry$1( + saveTooltipAxisInfo, cross ? 'cross' : true, triggerAxis + )); + } + if (cross) { + each$6(tooltipAxes.otherAxes, curry$1(saveTooltipAxisInfo, 'cross', false)); + } + } + + // fromTooltip: true | false | 'cross' + // triggerTooltip: true | false | null + function saveTooltipAxisInfo(fromTooltip, triggerTooltip, axis) { + var axisPointerModel = axis.model.getModel('axisPointer', globalAxisPointerModel); + + var axisPointerShow = axisPointerModel.get('show'); + if (!axisPointerShow || ( + axisPointerShow === 'auto' + && !fromTooltip + && !isHandleTrigger(axisPointerModel) + )) { + return; + } + + if (triggerTooltip == null) { + triggerTooltip = axisPointerModel.get('triggerTooltip'); + } + + axisPointerModel = fromTooltip + ? makeAxisPointerModel( + axis, baseTooltipModel, globalAxisPointerModel, ecModel, + fromTooltip, triggerTooltip + ) + : axisPointerModel; + + var snap = axisPointerModel.get('snap'); + var key = makeKey(axis.model); + var involveSeries = triggerTooltip || snap || axis.type === 'category'; + + // If result.axesInfo[key] exist, override it (tooltip has higher priority). + var axisInfo = result.axesInfo[key] = { + key: key, + axis: axis, + coordSys: coordSys, + axisPointerModel: axisPointerModel, + triggerTooltip: triggerTooltip, + involveSeries: involveSeries, + snap: snap, + useHandle: isHandleTrigger(axisPointerModel), + seriesModels: [] + }; + axesInfoInCoordSys[key] = axisInfo; + result.seriesInvolved |= involveSeries; + + var groupIndex = getLinkGroupIndex(linksOption, axis); + if (groupIndex != null) { + var linkGroup = linkGroups[groupIndex] || (linkGroups[groupIndex] = {axesInfo: {}}); + linkGroup.axesInfo[key] = axisInfo; + linkGroup.mapper = linksOption[groupIndex].mapper; + axisInfo.linkGroup = linkGroup; + } + } + }); +} + +function makeAxisPointerModel( + axis, baseTooltipModel, globalAxisPointerModel, ecModel, fromTooltip, triggerTooltip +) { + var tooltipAxisPointerModel = baseTooltipModel.getModel('axisPointer'); + var volatileOption = {}; + + each$6( + [ + 'type', 'snap', 'lineStyle', 'shadowStyle', 'label', + 'animation', 'animationDurationUpdate', 'animationEasingUpdate', 'z' + ], + function (field) { + volatileOption[field] = clone(tooltipAxisPointerModel.get(field)); + } + ); + + // category axis do not auto snap, otherwise some tick that do not + // has value can not be hovered. value/time/log axis default snap if + // triggered from tooltip and trigger tooltip. + volatileOption.snap = axis.type !== 'category' && !!triggerTooltip; + + // Compatibel with previous behavior, tooltip axis do not show label by default. + // Only these properties can be overrided from tooltip to axisPointer. + if (tooltipAxisPointerModel.get('type') === 'cross') { + volatileOption.type = 'line'; + } + var labelOption = volatileOption.label || (volatileOption.label = {}); + // Follow the convention, do not show label when triggered by tooltip by default. + labelOption.show == null && (labelOption.show = false); + + if (fromTooltip === 'cross') { + // When 'cross', both axes show labels. + var tooltipAxisPointerLabelShow = tooltipAxisPointerModel.get('label.show'); + labelOption.show = tooltipAxisPointerLabelShow != null ? tooltipAxisPointerLabelShow : true; + // If triggerTooltip, this is a base axis, which should better not use cross style + // (cross style is dashed by default) + if (!triggerTooltip) { + var crossStyle = volatileOption.lineStyle = tooltipAxisPointerModel.get('crossStyle'); + crossStyle && defaults(labelOption, crossStyle.textStyle); + } + } + + return axis.model.getModel( + 'axisPointer', + new Model(volatileOption, globalAxisPointerModel, ecModel) + ); +} + +function collectSeriesInfo(result, ecModel) { + // Prepare data for axis trigger + ecModel.eachSeries(function (seriesModel) { + + // Notice this case: this coordSys is `cartesian2D` but not `grid`. + var coordSys = seriesModel.coordinateSystem; + var seriesTooltipTrigger = seriesModel.get('tooltip.trigger', true); + var seriesTooltipShow = seriesModel.get('tooltip.show', true); + if (!coordSys + || seriesTooltipTrigger === 'none' + || seriesTooltipTrigger === false + || seriesTooltipTrigger === 'item' + || seriesTooltipShow === false + || seriesModel.get('axisPointer.show', true) === false + ) { + return; + } + + each$6(result.coordSysAxesInfo[makeKey(coordSys.model)], function (axisInfo) { + var axis = axisInfo.axis; + if (coordSys.getAxis(axis.dim) === axis) { + axisInfo.seriesModels.push(seriesModel); + axisInfo.seriesDataCount == null && (axisInfo.seriesDataCount = 0); + axisInfo.seriesDataCount += seriesModel.getData().count(); + } + }); + + }, this); +} + +/** + * For example: + * { + * axisPointer: { + * links: [{ + * xAxisIndex: [2, 4], + * yAxisIndex: 'all' + * }, { + * xAxisId: ['a5', 'a7'], + * xAxisName: 'xxx' + * }] + * } + * } + */ +function getLinkGroupIndex(linksOption, axis) { + var axisModel = axis.model; + var dim = axis.dim; + for (var i = 0; i < linksOption.length; i++) { + var linkOption = linksOption[i] || {}; + if (checkPropInLink(linkOption[dim + 'AxisId'], axisModel.id) + || checkPropInLink(linkOption[dim + 'AxisIndex'], axisModel.componentIndex) + || checkPropInLink(linkOption[dim + 'AxisName'], axisModel.name) + ) { + return i; + } + } +} + +function checkPropInLink(linkPropValue, axisPropValue) { + return linkPropValue === 'all' + || (isArray(linkPropValue) && indexOf(linkPropValue, axisPropValue) >= 0) + || linkPropValue === axisPropValue; +} + +function fixValue(axisModel) { + var axisInfo = getAxisInfo(axisModel); + if (!axisInfo) { + return; + } + + var axisPointerModel = axisInfo.axisPointerModel; + var scale = axisInfo.axis.scale; + var option = axisPointerModel.option; + var status = axisPointerModel.get('status'); + var value = axisPointerModel.get('value'); + + // Parse init value for category and time axis. + if (value != null) { + value = scale.parse(value); + } + + var useHandle = isHandleTrigger(axisPointerModel); + // If `handle` used, `axisPointer` will always be displayed, so value + // and status should be initialized. + if (status == null) { + option.status = useHandle ? 'show' : 'hide'; + } + + var extent = scale.getExtent().slice(); + extent[0] > extent[1] && extent.reverse(); + + if (// Pick a value on axis when initializing. + value == null + // If both `handle` and `dataZoom` are used, value may be out of axis extent, + // where we should re-pick a value to keep `handle` displaying normally. + || value > extent[1] + ) { + // Make handle displayed on the end of the axis when init, which looks better. + value = extent[1]; + } + if (value < extent[0]) { + value = extent[0]; + } + + option.value = value; + + if (useHandle) { + option.status = axisInfo.axis.scale.isBlank() ? 'hide' : 'show'; + } +} + +function getAxisInfo(axisModel) { + var coordSysAxesInfo = (axisModel.ecModel.getComponent('axisPointer') || {}).coordSysAxesInfo; + return coordSysAxesInfo && coordSysAxesInfo.axesInfo[makeKey(axisModel)]; +} + +function getAxisPointerModel(axisModel) { + var axisInfo = getAxisInfo(axisModel); + return axisInfo && axisInfo.axisPointerModel; +} + +function isHandleTrigger(axisPointerModel) { + return !!axisPointerModel.get('handle.show'); +} + +/** + * @param {module:echarts/model/Model} model + * @return {string} unique key + */ +function makeKey(model) { + return model.type + '||' + model.id; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Base class of AxisView. + */ +var AxisView = extendComponentView({ + + type: 'axis', + + /** + * @private + */ + _axisPointer: null, + + /** + * @protected + * @type {string} + */ + axisPointerClass: null, + + /** + * @override + */ + render: function (axisModel, ecModel, api, payload) { + // FIXME + // This process should proformed after coordinate systems updated + // (axis scale updated), and should be performed each time update. + // So put it here temporarily, although it is not appropriate to + // put a model-writing procedure in `view`. + this.axisPointerClass && fixValue(axisModel); + + AxisView.superApply(this, 'render', arguments); + + updateAxisPointer(this, axisModel, ecModel, api, payload, true); + }, + + /** + * Action handler. + * @public + * @param {module:echarts/coord/cartesian/AxisModel} axisModel + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + * @param {Object} payload + */ + updateAxisPointer: function (axisModel, ecModel, api, payload, force) { + updateAxisPointer(this, axisModel, ecModel, api, payload, false); + }, + + /** + * @override + */ + remove: function (ecModel, api) { + var axisPointer = this._axisPointer; + axisPointer && axisPointer.remove(api); + AxisView.superApply(this, 'remove', arguments); + }, + + /** + * @override + */ + dispose: function (ecModel, api) { + disposeAxisPointer(this, api); + AxisView.superApply(this, 'dispose', arguments); + } + +}); + +function updateAxisPointer(axisView, axisModel, ecModel, api, payload, forceRender) { + var Clazz = AxisView.getAxisPointerClass(axisView.axisPointerClass); + if (!Clazz) { + return; + } + var axisPointerModel = getAxisPointerModel(axisModel); + axisPointerModel + ? (axisView._axisPointer || (axisView._axisPointer = new Clazz())) + .render(axisModel, axisPointerModel, api, forceRender) + : disposeAxisPointer(axisView, api); +} + +function disposeAxisPointer(axisView, ecModel, api) { + var axisPointer = axisView._axisPointer; + axisPointer && axisPointer.dispose(ecModel, api); + axisView._axisPointer = null; +} + +var axisPointerClazz = []; + +AxisView.registerAxisPointerClass = function (type, clazz) { + if (__DEV__) { + if (axisPointerClazz[type]) { + throw new Error('axisPointer ' + type + ' exists'); + } + } + axisPointerClazz[type] = clazz; +}; + +AxisView.getAxisPointerClass = function (type) { + return type && axisPointerClazz[type]; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Can only be called after coordinate system creation stage. + * (Can be called before coordinate system update stage). + * + * @param {Object} opt {labelInside} + * @return {Object} { + * position, rotation, labelDirection, labelOffset, + * tickDirection, labelRotate, z2 + * } + */ +function layout$1(gridModel, axisModel, opt) { + opt = opt || {}; + var grid = gridModel.coordinateSystem; + var axis = axisModel.axis; + var layout = {}; + var otherAxisOnZeroOf = axis.getAxesOnZeroOf()[0]; + + var rawAxisPosition = axis.position; + var axisPosition = otherAxisOnZeroOf ? 'onZero' : rawAxisPosition; + var axisDim = axis.dim; + + var rect = grid.getRect(); + var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; + var idx = {left: 0, right: 1, top: 0, bottom: 1, onZero: 2}; + var axisOffset = axisModel.get('offset') || 0; + + var posBound = axisDim === 'x' + ? [rectBound[2] - axisOffset, rectBound[3] + axisOffset] + : [rectBound[0] - axisOffset, rectBound[1] + axisOffset]; + + if (otherAxisOnZeroOf) { + var onZeroCoord = otherAxisOnZeroOf.toGlobalCoord(otherAxisOnZeroOf.dataToCoord(0)); + posBound[idx['onZero']] = Math.max(Math.min(onZeroCoord, posBound[1]), posBound[0]); + } + + // Axis position + layout.position = [ + axisDim === 'y' ? posBound[idx[axisPosition]] : rectBound[0], + axisDim === 'x' ? posBound[idx[axisPosition]] : rectBound[3] + ]; + + // Axis rotation + layout.rotation = Math.PI / 2 * (axisDim === 'x' ? 0 : 1); + + // 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]; + layout.labelOffset = otherAxisOnZeroOf ? posBound[idx[rawAxisPosition]] - posBound[idx['onZero']] : 0; + + if (axisModel.get('axisTick.inside')) { + layout.tickDirection = -layout.tickDirection; + } + if (retrieve(opt.labelInside, axisModel.get('axisLabel.inside'))) { + layout.labelDirection = -layout.labelDirection; + } + + // Special label rotation + var labelRotate = axisModel.get('axisLabel.rotate'); + layout.labelRotate = axisPosition === 'top' ? -labelRotate : labelRotate; + + // Over splitLine and splitArea + layout.z2 = 1; + + return layout; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 axisBuilderAttrs = [ + 'axisLine', 'axisTickLabel', 'axisName' +]; +var selfBuilderAttrs = [ + 'splitArea', 'splitLine' +]; + +// function getAlignWithLabel(model, axisModel) { +// var alignWithLabel = model.get('alignWithLabel'); +// if (alignWithLabel === 'auto') { +// alignWithLabel = axisModel.get('axisTick.alignWithLabel'); +// } +// return alignWithLabel; +// } + +var CartesianAxisView = AxisView.extend({ + + type: 'cartesianAxis', + + axisPointerClass: 'CartesianAxisPointer', + + /** + * @override + */ + render: function (axisModel, ecModel, api, payload) { + + this.group.removeAll(); + + var oldAxisGroup = this._axisGroup; + this._axisGroup = new Group(); + + this.group.add(this._axisGroup); + + if (!axisModel.get('show')) { + return; + } + + var gridModel = axisModel.getCoordSysModel(); + + var layout = layout$1(gridModel, axisModel); + + var axisBuilder = new AxisBuilder(axisModel, layout); + + each$1(axisBuilderAttrs, axisBuilder.add, axisBuilder); + + this._axisGroup.add(axisBuilder.getGroup()); + + each$1(selfBuilderAttrs, function (name) { + if (axisModel.get(name + '.show')) { + this['_' + name](axisModel, gridModel); + } + }, this); + + groupTransition(oldAxisGroup, this._axisGroup, axisModel); + + CartesianAxisView.superCall(this, 'render', axisModel, ecModel, api, payload); + }, + + remove: function () { + this._splitAreaColors = null; + }, + + /** + * @param {module:echarts/coord/cartesian/AxisModel} axisModel + * @param {module:echarts/coord/cartesian/GridModel} gridModel + * @private + */ + _splitLine: function (axisModel, gridModel) { + var axis = axisModel.axis; + + if (axis.scale.isBlank()) { + return; + } + + var splitLineModel = axisModel.getModel('splitLine'); + var lineStyleModel = splitLineModel.getModel('lineStyle'); + var lineColors = lineStyleModel.get('color'); + + lineColors = isArray(lineColors) ? lineColors : [lineColors]; + + var gridRect = gridModel.coordinateSystem.getRect(); + var isHorizontal = axis.isHorizontal(); + + var lineCount = 0; + + var ticksCoords = axis.getTicksCoords({ + tickModel: splitLineModel + }); + + var p1 = []; + var p2 = []; + + // Simple optimization + // Batching the lines if color are the same + var lineStyle = lineStyleModel.getLineStyle(); + for (var i = 0; i < ticksCoords.length; i++) { + var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + + 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; + var tickValue = ticksCoords[i].tickValue; + this._axisGroup.add(new Line(subPixelOptimizeLine({ + anid: tickValue != null ? 'line_' + ticksCoords[i].tickValue : null, + shape: { + x1: p1[0], + y1: p1[1], + x2: p2[0], + y2: p2[1] + }, + style: defaults({ + stroke: lineColors[colorIndex] + }, lineStyle), + silent: true + }))); + } + }, + + /** + * @param {module:echarts/coord/cartesian/AxisModel} axisModel + * @param {module:echarts/coord/cartesian/GridModel} gridModel + * @private + */ + _splitArea: function (axisModel, gridModel) { + var axis = axisModel.axis; + + if (axis.scale.isBlank()) { + return; + } + + var splitAreaModel = axisModel.getModel('splitArea'); + var areaStyleModel = splitAreaModel.getModel('areaStyle'); + var areaColors = areaStyleModel.get('color'); + + var gridRect = gridModel.coordinateSystem.getRect(); + + var ticksCoords = axis.getTicksCoords({ + tickModel: splitAreaModel, + clamp: true + }); + + if (!ticksCoords.length) { + return; + } + + // For Making appropriate splitArea animation, the color and anid + // should be corresponding to previous one if possible. + var areaColorsLen = areaColors.length; + var lastSplitAreaColors = this._splitAreaColors; + var newSplitAreaColors = createHashMap(); + var colorIndex = 0; + if (lastSplitAreaColors) { + for (var i = 0; i < ticksCoords.length; i++) { + var cIndex = lastSplitAreaColors.get(ticksCoords[i].tickValue); + if (cIndex != null) { + colorIndex = (cIndex + (areaColorsLen - 1) * i) % areaColorsLen; + break; + } + } + } + + var prev = axis.toGlobalCoord(ticksCoords[0].coord); + + var areaStyle = areaStyleModel.getAreaStyle(); + areaColors = isArray(areaColors) ? areaColors : [areaColors]; + + for (var i = 1; i < ticksCoords.length; i++) { + var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + + var x; + var y; + var width; + var height; + if (axis.isHorizontal()) { + x = prev; + y = gridRect.y; + width = tickCoord - x; + height = gridRect.height; + prev = x + width; + } + else { + x = gridRect.x; + y = prev; + width = gridRect.width; + height = tickCoord - y; + prev = y + height; + } + + var tickValue = ticksCoords[i - 1].tickValue; + tickValue != null && newSplitAreaColors.set(tickValue, colorIndex); + + this._axisGroup.add(new Rect({ + anid: tickValue != null ? 'area_' + tickValue : null, + shape: { + x: x, + y: y, + width: width, + height: height + }, + style: defaults({ + fill: areaColors[colorIndex] + }, areaStyle), + silent: true + })); + + colorIndex = (colorIndex + 1) % areaColorsLen; + } + + this._splitAreaColors = newSplitAreaColors; + } +}); + +CartesianAxisView.extend({ + type: 'xAxis' +}); +CartesianAxisView.extend({ + type: 'yAxis' +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Grid view +extendComponentView({ + + type: 'grid', + + render: function (gridModel, ecModel) { + this.group.removeAll(); + if (gridModel.get('show')) { + this.group.add(new Rect({ + shape: gridModel.coordinateSystem.getRect(), + style: defaults({ + fill: gridModel.get('backgroundColor') + }, gridModel.getItemStyle()), + silent: true, + z2: -1 + })); + } + } + +}); + +registerPreprocessor(function (option) { + // Only create grid when need + if (option.xAxis && option.yAxis && !option.grid) { + option.grid = {}; + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// In case developer forget to include grid component +registerVisual(visualSymbol('line', 'circle', 'line')); +registerLayout(pointsLayout('line')); + +// Down sample after filter +registerProcessor( + PRIORITY.PROCESSOR.STATISTIC, + dataSample('line') +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 BaseBarSeries = SeriesModel.extend({ + + type: 'series.__base_bar__', + + getInitialData: function (option, ecModel) { + return createListFromArray(this.getSource(), this); + }, + + getMarkerPosition: function (value) { + var coordSys = this.coordinateSystem; + if (coordSys) { + // PENDING if clamp ? + var pt = coordSys.dataToPoint(coordSys.clampData(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, + // 最小角度为0,仅对极坐标系下的柱状图有效 + barMinAngle: 0, + // cursor: null, + + large: false, + largeThreshold: 400, + progressive: 3e3, + progressiveChunkMode: 'mod', + + // barMaxWidth: null, + // 默认自适应 + // barWidth: null, + // 柱间距离,默认为柱形宽度的30%,可设固定值 + // barGap: '30%', + // 类目间柱形距离,默认为类目间距的20%,可设固定值 + // barCategoryGap: '20%', + // label: { + // show: false + // }, + itemStyle: {}, + emphasis: {} + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +BaseBarSeries.extend({ + + type: 'series.bar', + + dependencies: ['grid', 'polar'], + + brushSelector: 'rect', + + /** + * @override + */ + getProgressive: function () { + // Do not support progressive in normal mode. + return this.get('large') + ? this.get('progressive') + : false; + }, + + /** + * @override + */ + getProgressiveThreshold: function () { + // Do not support progressive in normal mode. + var progressiveThreshold = this.get('progressiveThreshold'); + var largeThreshold = this.get('largeThreshold'); + if (largeThreshold > progressiveThreshold) { + progressiveThreshold = largeThreshold; + } + return progressiveThreshold; + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 setLabel( + normalStyle, hoverStyle, itemModel, color, seriesModel, dataIndex, labelPositionOutside +) { + var labelModel = itemModel.getModel('label'); + var hoverLabelModel = itemModel.getModel('emphasis.label'); + + setLabelStyle( + normalStyle, hoverStyle, labelModel, hoverLabelModel, + { + labelFetcher: seriesModel, + labelDataIndex: dataIndex, + defaultText: getDefaultLabel(seriesModel.getData(), dataIndex), + isRectText: true, + autoColor: color + } + ); + + fixPosition(normalStyle); + fixPosition(hoverStyle); +} + +function fixPosition(style, labelPositionOutside) { + if (style.textPosition === 'outside') { + style.textPosition = labelPositionOutside; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 getBarItemStyle = makeStyleMapper( + [ + ['fill', 'color'], + ['stroke', 'borderColor'], + ['lineWidth', 'borderWidth'], + // Compatitable with 2 + ['stroke', 'barBorderColor'], + ['lineWidth', 'barBorderWidth'], + ['opacity'], + ['shadowBlur'], + ['shadowOffsetX'], + ['shadowOffsetY'], + ['shadowColor'] + ] +); + +var barItemStyle = { + getBarItemStyle: function (excludes) { + var style = getBarItemStyle(this, excludes); + if (this.getBorderLineDash) { + var lineDash = this.getBorderLineDash(); + lineDash && (style.lineDash = lineDash); + } + return style; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 BAR_BORDER_WIDTH_QUERY = ['itemStyle', 'barBorderWidth']; + +// FIXME +// Just for compatible with ec2. +extend(Model.prototype, barItemStyle); + +extendChartView({ + + type: 'bar', + + render: function (seriesModel, ecModel, api) { + this._updateDrawMode(seriesModel); + + var coordinateSystemType = seriesModel.get('coordinateSystem'); + + if (coordinateSystemType === 'cartesian2d' + || coordinateSystemType === 'polar' + ) { + this._isLargeDraw + ? this._renderLarge(seriesModel, ecModel, api) + : this._renderNormal(seriesModel, ecModel, api); + } + else if (__DEV__) { + console.warn('Only cartesian2d and polar supported for bar.'); + } + + return this.group; + }, + + incrementalPrepareRender: function (seriesModel, ecModel, api) { + this._clear(); + this._updateDrawMode(seriesModel); + }, + + incrementalRender: function (params, seriesModel, ecModel, api) { + // Do not support progressive in normal mode. + this._incrementalRenderLarge(params, seriesModel); + }, + + _updateDrawMode: function (seriesModel) { + var isLargeDraw = seriesModel.pipelineContext.large; + if (this._isLargeDraw == null || isLargeDraw ^ this._isLargeDraw) { + this._isLargeDraw = isLargeDraw; + this._clear(); + } + }, + + _renderNormal: function (seriesModel, ecModel, api) { + var group = this.group; + var data = seriesModel.getData(); + var oldData = this._data; + + var coord = seriesModel.coordinateSystem; + var baseAxis = coord.getBaseAxis(); + var isHorizontalOrRadial; + + if (coord.type === 'cartesian2d') { + isHorizontalOrRadial = baseAxis.isHorizontal(); + } + else if (coord.type === 'polar') { + isHorizontalOrRadial = baseAxis.dim === 'angle'; + } + + var animationModel = seriesModel.isAnimationEnabled() ? seriesModel : null; + + data.diff(oldData) + .add(function (dataIndex) { + if (!data.hasValue(dataIndex)) { + return; + } + + var itemModel = data.getItemModel(dataIndex); + var layout = getLayout[coord.type](data, dataIndex, itemModel); + var el = elementCreator[coord.type]( + data, dataIndex, itemModel, layout, isHorizontalOrRadial, animationModel + ); + data.setItemGraphicEl(dataIndex, el); + group.add(el); + + updateStyle( + el, data, dataIndex, itemModel, layout, + seriesModel, isHorizontalOrRadial, coord.type === 'polar' + ); + }) + .update(function (newIndex, oldIndex) { + var el = oldData.getItemGraphicEl(oldIndex); + + if (!data.hasValue(newIndex)) { + group.remove(el); + return; + } + + var itemModel = data.getItemModel(newIndex); + var layout = getLayout[coord.type](data, newIndex, itemModel); + + if (el) { + updateProps(el, {shape: layout}, animationModel, newIndex); + } + else { + el = elementCreator[coord.type]( + data, newIndex, itemModel, layout, isHorizontalOrRadial, animationModel, true + ); + } + + data.setItemGraphicEl(newIndex, el); + // Add back + group.add(el); + + updateStyle( + el, data, newIndex, itemModel, layout, + seriesModel, isHorizontalOrRadial, coord.type === 'polar' + ); + }) + .remove(function (dataIndex) { + var el = oldData.getItemGraphicEl(dataIndex); + if (coord.type === 'cartesian2d') { + el && removeRect(dataIndex, animationModel, el); + } + else { + el && removeSector(dataIndex, animationModel, el); + } + }) + .execute(); + + this._data = data; + }, + + _renderLarge: function (seriesModel, ecModel, api) { + this._clear(); + createLarge(seriesModel, this.group); + }, + + _incrementalRenderLarge: function (params, seriesModel) { + createLarge(seriesModel, this.group, true); + }, + + dispose: noop, + + remove: function (ecModel) { + this._clear(ecModel); + }, + + _clear: function (ecModel) { + var group = this.group; + var data = this._data; + if (ecModel && ecModel.get('animation') && data && !this._isLargeDraw) { + data.eachItemGraphicEl(function (el) { + if (el.type === 'sector') { + removeSector(el.dataIndex, ecModel, el); + } + else { + removeRect(el.dataIndex, ecModel, el); + } + }); + } + else { + group.removeAll(); + } + this._data = null; + } + +}); + +var elementCreator = { + + cartesian2d: function ( + data, dataIndex, itemModel, layout, isHorizontal, + animationModel, isUpdate + ) { + var rect = new Rect({shape: extend({}, layout)}); + + // Animation + if (animationModel) { + 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 + }, animationModel, dataIndex); + } + + return rect; + }, + + polar: function ( + data, dataIndex, itemModel, layout, isRadial, + animationModel, isUpdate + ) { + // Keep the same logic with bar in catesion: use end value to control + // direction. Notice that if clockwise is true (by default), the sector + // will always draw clockwisely, no matter whether endAngle is greater + // or less than startAngle. + var clockwise = layout.startAngle < layout.endAngle; + var sector = new Sector({ + shape: defaults({clockwise: clockwise}, layout) + }); + + // Animation + if (animationModel) { + var sectorShape = sector.shape; + var animateProperty = isRadial ? 'r' : 'endAngle'; + var animateTarget = {}; + sectorShape[animateProperty] = isRadial ? 0 : layout.startAngle; + animateTarget[animateProperty] = layout[animateProperty]; + graphic[isUpdate ? 'updateProps' : 'initProps'](sector, { + shape: animateTarget + }, animationModel, dataIndex); + } + + return sector; + } +}; + +function removeRect(dataIndex, animationModel, el) { + // Not show text when animating + el.style.text = null; + updateProps(el, { + shape: { + width: 0 + } + }, animationModel, dataIndex, function () { + el.parent && el.parent.remove(el); + }); +} + +function removeSector(dataIndex, animationModel, el) { + // Not show text when animating + el.style.text = null; + updateProps(el, { + shape: { + r: el.shape.r0 + } + }, animationModel, dataIndex, function () { + el.parent && el.parent.remove(el); + }); +} + +var getLayout = { + cartesian2d: function (data, dataIndex, itemModel) { + var layout = data.getItemLayout(dataIndex); + var fixedLineWidth = getLineWidth(itemModel, layout); + + // fix layout with lineWidth + var signX = layout.width > 0 ? 1 : -1; + var signY = layout.height > 0 ? 1 : -1; + return { + x: layout.x + signX * fixedLineWidth / 2, + y: layout.y + signY * fixedLineWidth / 2, + width: layout.width - signX * fixedLineWidth, + height: layout.height - signY * fixedLineWidth + }; + }, + + polar: function (data, dataIndex, itemModel) { + var layout = data.getItemLayout(dataIndex); + return { + cx: layout.cx, + cy: layout.cy, + r0: layout.r0, + r: layout.r, + startAngle: layout.startAngle, + endAngle: layout.endAngle + }; + } +}; + +function updateStyle( + el, data, dataIndex, itemModel, layout, seriesModel, isHorizontal, isPolar +) { + var color = data.getItemVisual(dataIndex, 'color'); + var opacity = data.getItemVisual(dataIndex, 'opacity'); + var itemStyleModel = itemModel.getModel('itemStyle'); + var hoverStyle = itemModel.getModel('emphasis.itemStyle').getBarItemStyle(); + + if (!isPolar) { + el.setShape('r', itemStyleModel.get('barBorderRadius') || 0); + } + + el.useStyle(defaults( + { + fill: color, + opacity: opacity + }, + itemStyleModel.getBarItemStyle() + )); + + var cursorStyle = itemModel.getShallow('cursor'); + cursorStyle && el.attr('cursor', cursorStyle); + + var labelPositionOutside = isHorizontal + ? (layout.height > 0 ? 'bottom' : 'top') + : (layout.width > 0 ? 'left' : 'right'); + + if (!isPolar) { + setLabel( + el.style, hoverStyle, itemModel, color, + seriesModel, dataIndex, labelPositionOutside + ); + } + + setHoverStyle(el, hoverStyle); +} + +// In case width or height are too small. +function getLineWidth(itemModel, rawLayout) { + var lineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY) || 0; + return Math.min(lineWidth, Math.abs(rawLayout.width), Math.abs(rawLayout.height)); +} + + +var LargePath = Path.extend({ + + type: 'largeBar', + + shape: {points: []}, + + buildPath: function (ctx, shape) { + // Drawing lines is more efficient than drawing + // a whole line or drawing rects. + var points = shape.points; + var startPoint = this.__startPoint; + var valueIdx = this.__valueIdx; + + for (var i = 0; i < points.length; i += 2) { + startPoint[this.__valueIdx] = points[i + valueIdx]; + ctx.moveTo(startPoint[0], startPoint[1]); + ctx.lineTo(points[i], points[i + 1]); + } + } +}); + +function createLarge(seriesModel, group, incremental) { + // TODO support polar + var data = seriesModel.getData(); + var startPoint = []; + var valueIdx = data.getLayout('valueAxisHorizontal') ? 1 : 0; + startPoint[1 - valueIdx] = data.getLayout('valueAxisStart'); + + var el = new LargePath({ + shape: {points: data.getLayout('largePoints')}, + incremental: !!incremental, + __startPoint: startPoint, + __valueIdx: valueIdx + }); + group.add(el); + setLargeStyle(el, seriesModel, data); +} + +function setLargeStyle(el, seriesModel, data) { + var borderColor = data.getVisual('borderColor') || data.getVisual('color'); + var itemStyle = seriesModel.getModel('itemStyle').getItemStyle(['color', 'borderColor']); + + el.useStyle(itemStyle); + el.style.fill = null; + el.style.stroke = borderColor; + el.style.lineWidth = data.getLayout('barWidth'); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// In case developer forget to include grid component +registerLayout(curry(layout, 'bar')); +// Should after normal bar layout, otherwise it is blocked by normal bar layout. +registerLayout(largeLayout); + +registerVisual({ + seriesType: 'bar', + reset: function (seriesModel) { + // Visual coding for legend + seriesModel.getData().setVisual('legendSymbol', 'roundRect'); + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + + +/** + * [Usage]: + * (1) + * createListSimply(seriesModel, ['value']); + * (2) + * createListSimply(seriesModel, { + * coordDimensions: ['value'], + * dimensionsCount: 5 + * }); + * + * @param {module:echarts/model/Series} seriesModel + * @param {Object|Array.} opt opt or coordDimensions + * The options in opt, see `echarts/data/helper/createDimensions` + * @param {Array.} [nameList] + * @return {module:echarts/data/List} + */ +var createListSimply = function (seriesModel, opt, nameList) { + opt = isArray(opt) && {coordDimensions: opt} || extend({}, opt); + + var source = seriesModel.getSource(); + + var dimensionsInfo = createDimensions(source, opt); + + var list = new List(dimensionsInfo, seriesModel); + list.initData(source, nameList); + + return list; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * 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 + */ + +var selectableMixin = { + + /** + * @param {Array.} targetList [{name, value, selected}, ...] + * If targetList is an array, it should like [{name: ..., value: ...}, ...]. + * If targetList is a "List", it must have coordDim: 'value' dimension and name. + */ + updateSelectedMap: function (targetList) { + this._targetList = isArray(targetList) ? targetList.slice() : []; + + this._selectTargetMap = reduce(targetList || [], function (targetMap, target) { + targetMap.set(target.name, target); + return targetMap; + }, createHashMap()); + }, + + /** + * Either name or id should be passed as input here. + * If both of them are defined, id is used. + * + * @param {string|undefined} name name of data + * @param {number|undefined} id dataIndex of data + */ + // PENGING If selectedMode is null ? + select: function (name, id) { + var target = id != null + ? this._targetList[id] + : this._selectTargetMap.get(name); + var selectedMode = this.get('selectedMode'); + if (selectedMode === 'single') { + this._selectTargetMap.each(function (target) { + target.selected = false; + }); + } + target && (target.selected = true); + }, + + /** + * Either name or id should be passed as input here. + * If both of them are defined, id is used. + * + * @param {string|undefined} name name of data + * @param {number|undefined} id dataIndex of data + */ + unSelect: function (name, id) { + var target = id != null + ? this._targetList[id] + : this._selectTargetMap.get(name); + // var selectedMode = this.get('selectedMode'); + // selectedMode !== 'single' && target && (target.selected = false); + target && (target.selected = false); + }, + + /** + * Either name or id should be passed as input here. + * If both of them are defined, id is used. + * + * @param {string|undefined} name name of data + * @param {number|undefined} id dataIndex of data + */ + toggleSelected: function (name, id) { + var target = id != null + ? this._targetList[id] + : this._selectTargetMap.get(name); + if (target != null) { + this[target.selected ? 'unSelect' : 'select'](name, id); + return target.selected; + } + }, + + /** + * Either name or id should be passed as input here. + * If both of them are defined, id is used. + * + * @param {string|undefined} name name of data + * @param {number|undefined} id dataIndex of data + */ + isSelected: function (name, id) { + var target = id != null + ? this._targetList[id] + : this._selectTargetMap.get(name); + return target && target.selected; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 PieSeries = 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.getRawData(); + }; + + this.updateSelectedMap(this._createSelectableList()); + + this._defaultLabelLine(option); + }, + + // Overwrite + mergeOption: function (newOption) { + PieSeries.superCall(this, 'mergeOption', newOption); + + this.updateSelectedMap(this._createSelectableList()); + }, + + getInitialData: function (option, ecModel) { + return createListSimply(this, ['value']); + }, + + _createSelectableList: function () { + var data = this.getRawData(); + var valueDim = data.mapDimension('value'); + var targetList = []; + for (var i = 0, len = data.count(); i < len; i++) { + targetList.push({ + name: data.getName(i), + value: data.get(valueDim, i), + selected: retrieveRawAttr(data, i, 'selected') + }); + } + return targetList; + }, + + // Overwrite + getDataParams: function (dataIndex) { + var data = this.getData(); + var params = PieSeries.superCall(this, 'getDataParams', dataIndex); + // FIXME toFixed? + + var valueList = []; + data.each(data.mapDimension('value'), function (value) { + valueList.push(value); + }); + + params.percent = getPercentWithPrecision( + valueList, + dataIndex, + data.hostModel.get('percentPrecision') + ); + + params.$vars.push('percent'); + return params; + }, + + _defaultLabelLine: function (option) { + // Extend labelLine emphasis + defaultEmphasis(option, 'labelLine', ['show']); + + var labelLineNormalOpt = option.labelLine; + var labelLineEmphasisOpt = option.emphasis.labelLine; + // Not show label line if `label.normal.show = false` + labelLineNormalOpt.show = labelLineNormalOpt.show + && option.label.show; + labelLineEmphasisOpt.show = labelLineEmphasisOpt.show + && option.emphasis.label.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, + // 高亮扇区偏移量 + hoverOffset: 10, + + // If use strategy to avoid label overlapping + avoidLabelOverlap: true, + // 选择模式,默认关闭,可选single,multiple + // selectedMode: false, + // 南丁格尔玫瑰图模式,'radius'(半径) | 'area'(面积) + // roseType: null, + + percentPrecision: 2, + + // If still show when all data zero. + stillShowZeroSum: true, + + // cursor: null, + + label: { + // If rotate around circle + rotate: false, + show: true, + // 'outer', 'inside', 'center' + position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // 默认使用全局文本样式,详见TEXTSTYLE + // distance: 当position为inner时有效,为label位置到圆心的距离与圆半径(环状图为内外半径和)的比例系数 + }, + // Enabled when label.normal.position is 'outer' + labelLine: { + show: true, + // 引导线两段中的第一段长度 + length: 15, + // 引导线两段中的第二段长度 + length2: 15, + smooth: false, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + }, + itemStyle: { + borderWidth: 1 + }, + + // Animation type canbe expansion, scale + animationType: 'expansion', + + animationEasing: 'cubicOut' + } +}); + +mixin(PieSeries, selectableMixin); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @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) { + + Group.call(this); + + var sector = new Sector({ + z2: 2 + }); + var polyline = new Polyline(); + var text = new 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; + +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 = extend({}, layout); + sectorShape.label = null; + + if (firstCreate) { + sector.setShape(sectorShape); + + var animationType = seriesModel.getShallow('animationType'); + if (animationType === 'scale') { + sector.shape.r = layout.r0; + initProps(sector, { + shape: { + r: layout.r + } + }, seriesModel, idx); + } + // Expansion + else { + sector.shape.endAngle = layout.startAngle; + updateProps(sector, { + shape: { + endAngle: layout.endAngle + } + }, seriesModel, idx); + } + + } + else { + updateProps(sector, { + shape: sectorShape + }, seriesModel, idx); + } + + // Update common style + var visualColor = data.getItemVisual(idx, 'color'); + + sector.useStyle( + defaults( + { + lineJoin: 'bevel', + fill: visualColor + }, + itemModel.getModel('itemStyle').getItemStyle() + ) + ); + sector.hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); + + var cursorStyle = itemModel.getShallow('cursor'); + cursorStyle && sector.attr('cursor', cursorStyle); + + // Toggle selected + toggleItemSelected( + this, + data.getItemLayout(idx), + seriesModel.isSelected(null, idx), + 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 + seriesModel.get('hoverOffset') + } + }, 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') && seriesModel.isAnimationEnabled()) { + sector + .on('mouseover', onEmphasis) + .on('mouseout', onNormal) + .on('emphasis', onEmphasis) + .on('normal', onNormal); + } + + this._updateLabel(data, idx); + + 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'); + + updateProps(labelLine, { + shape: { + points: labelLayout.linePoints || [ + [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y], [labelLayout.x, labelLayout.y] + ] + } + }, seriesModel, idx); + + updateProps(labelText, { + style: { + x: labelLayout.x, + y: labelLayout.y + } + }, seriesModel, idx); + labelText.attr({ + rotation: labelLayout.rotation, + origin: [labelLayout.x, labelLayout.y], + z2: 10 + }); + + var labelModel = itemModel.getModel('label'); + var labelHoverModel = itemModel.getModel('emphasis.label'); + var labelLineModel = itemModel.getModel('labelLine'); + var labelLineHoverModel = itemModel.getModel('emphasis.labelLine'); + var visualColor = data.getItemVisual(idx, 'color'); + + setLabelStyle( + labelText.style, labelText.hoverStyle = {}, labelModel, labelHoverModel, + { + labelFetcher: data.hostModel, + labelDataIndex: idx, + defaultText: data.getName(idx), + autoColor: visualColor, + useInsideStyle: !!labelLayout.inside + }, + { + textAlign: labelLayout.textAlign, + textVerticalAlign: labelLayout.verticalAlign, + opacity: data.getItemVisual(idx, 'opacity') + } + ); + + 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, + opacity: data.getItemVisual(idx, 'opacity') + }); + labelLine.setStyle(labelLineModel.getModel('lineStyle').getLineStyle()); + + labelLine.hoverStyle = labelLineHoverModel.getModel('lineStyle').getLineStyle(); + + var smooth = labelLineModel.get('smooth'); + if (smooth && smooth === true) { + smooth = 0.4; + } + labelLine.setShape({ + smooth: smooth + }); +}; + +inherits(PiePiece, Group); + + +// Pie view +var PieView = Chart.extend({ + + type: 'pie', + + init: function () { + var sectorGroup = new 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 animationType = seriesModel.get('animationType'); + + var onSectorClick = curry( + updateDataSelected, this.uid, seriesModel, hasAnimation, api + ); + + var selectedMode = seriesModel.get('selectedMode'); + + data.diff(oldData) + .add(function (idx) { + var piePiece = new PiePiece(data, idx); + // Default expansion animation + if (isFirstRender && animationType !== 'scale') { + 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 + // Default expansion animation + && animationType !== 'scale' + ) { + var shape = data.getItemLayout(0); + var r = Math.max(api.getWidth(), api.getHeight()) / 2; + + var removeClipPath = bind(group.removeClipPath, group); + group.setClipPath(this._createClipPath( + shape.cx, shape.cy, r, shape.startAngle, shape.clockwise, removeClipPath, seriesModel + )); + } + + this._data = data; + }, + + dispose: function () {}, + + _createClipPath: function ( + cx, cy, r, startAngle, clockwise, cb, seriesModel + ) { + var clipPath = new Sector({ + shape: { + cx: cx, + cy: cy, + r0: 0, + r: r, + startAngle: startAngle, + endAngle: startAngle, + clockwise: clockwise + } + }); + + initProps(clipPath, { + shape: { + endAngle: startAngle + (clockwise ? 1 : -1) * Math.PI * 2 + } + }, seriesModel, cb); + + return clipPath; + }, + + /** + * @implement + */ + containPoint: function (point, seriesModel) { + var data = seriesModel.getData(); + var itemLayout = data.getItemLayout(0); + if (itemLayout) { + var dx = point[0] - itemLayout.cx; + var dy = point[1] - itemLayout.cy; + var radius = Math.sqrt(dx * dx + dy * dy); + return radius <= itemLayout.r && radius >= itemLayout.r0; + } + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 createDataSelectAction = function (seriesType, actionInfos) { + each$1(actionInfos, function (actionInfo) { + actionInfo.update = 'updateView'; + /** + * @payload + * @property {string} seriesName + * @property {string} name + */ + 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, + payload.dataIndex + ); + } + 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 + }; + }); + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Pick color from palette for each data item. +// Applicable for charts that require applying color palette +// in data level (like pie, funnel, chord). +var dataColor = function (seriesType) { + return { + getTargetSeries: function (ecModel) { + // Pie and funnel may use diferrent scope + var paletteScope = {}; + var seiresModelMap = createHashMap(); + + ecModel.eachSeriesByType(seriesType, function (seriesModel) { + seriesModel.__paletteScope = paletteScope; + seiresModelMap.set(seriesModel.uid, seriesModel); + }); + + return seiresModelMap; + }, + reset: function (seriesModel, ecModel) { + var dataAll = seriesModel.getRawData(); + var idxMap = {}; + var data = seriesModel.getData(); + + data.each(function (idx) { + var rawIdx = data.getRawIndex(idx); + idxMap[rawIdx] = idx; + }); + + dataAll.each(function (rawIdx) { + var filteredIdx = idxMap[rawIdx]; + + // If series.itemStyle.normal.color is a function. itemVisual may be encoded + var singleDataColor = filteredIdx != null + && data.getItemVisual(filteredIdx, 'color', true); + + if (!singleDataColor) { + // FIXME Performance + var itemModel = dataAll.getItemModel(rawIdx); + + var color = itemModel.get('itemStyle.color') + || seriesModel.getColorFromPalette( + dataAll.getName(rawIdx) || (rawIdx + ''), seriesModel.__paletteScope, + dataAll.count() + ); + // Legend may use the visual info in data before processed + dataAll.setItemVisual(rawIdx, 'color', color); + + // Data is not filtered + if (filteredIdx != null) { + data.setItemVisual(filteredIdx, 'color', color); + } + } + else { + // Set data all color for legend + dataAll.setItemVisual(rawIdx, 'color', singleDataColor); + } + }); + } + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// FIXME emphasis label position is not same with normal label position + +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; + } + } +} + +var labelLayout = 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'); + // Use position in normal or emphasis + var labelPosition = labelModel.get('position') || itemModel.get('emphasis.label.position'); + + var labelLineModel = itemModel.getModel('labelLine'); + 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 + layout.r0) / 2 * dx : layout.r * dx) + cx; + var y1 = (isLabelInside ? (layout.r + layout.r0) / 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.getFont(); + + var labelRotate = labelModel.get('rotate') + ? (dx < 0 ? -midAngle + Math.PI : -midAngle) : 0; + var text = seriesModel.getFormattedLabel(idx, 'normal') + || data.getName(idx); + var textRect = 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', + rotation: labelRotate, + inside: isLabelInside + }; + + // Not layout the inside label + if (!isLabelInside) { + labelLayoutList.push(layout.label); + } + }); + if (!hasLabelRotate && seriesModel.get('avoidLabelOverlap')) { + avoidOverlap(labelLayoutList, cx, cy, r, viewWidth, viewHeight); + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 PI2$4 = Math.PI * 2; +var RADIAN = Math.PI / 180; + +var pieLayout = function (seriesType, ecModel, api, payload) { + ecModel.eachSeriesByType(seriesType, function (seriesModel) { + var data = seriesModel.getData(); + var valueDim = data.mapDimension('value'); + + var center = seriesModel.get('center'); + var radius = seriesModel.get('radius'); + + if (!isArray(radius)) { + radius = [0, radius]; + } + if (!isArray(center)) { + center = [center, center]; + } + + var width = api.getWidth(); + var height = api.getHeight(); + var size = Math.min(width, height); + var cx = parsePercent$1(center[0], width); + var cy = parsePercent$1(center[1], height); + var r0 = parsePercent$1(radius[0], size / 2); + var r = parsePercent$1(radius[1], size / 2); + + var startAngle = -seriesModel.get('startAngle') * RADIAN; + + var minAngle = seriesModel.get('minAngle') * RADIAN; + + var validDataCount = 0; + data.each(valueDim, function (value) { + !isNaN(value) && validDataCount++; + }); + + var sum = data.getSum(valueDim); + // Sum may be 0 + var unitRadian = Math.PI / (sum || validDataCount) * 2; + + var clockwise = seriesModel.get('clockwise'); + + var roseType = seriesModel.get('roseType'); + var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); + + // [0...max] + var extent = data.getDataExtent(valueDim); + extent[0] = 0; + + // In the case some sector angle is smaller than minAngle + var restAngle = PI2$4; + var valueSumLargerThanMinAngle = 0; + + var currentAngle = startAngle; + var dir = clockwise ? 1 : -1; + + data.each(valueDim, function (value, idx) { + var angle; + if (isNaN(value)) { + data.setItemLayout(idx, { + angle: NaN, + startAngle: NaN, + endAngle: NaN, + clockwise: clockwise, + cx: cx, + cy: cy, + r0: r0, + r: roseType + ? NaN + : r + }); + return; + } + + // FIXME 兼容 2.0 但是 roseType 是 area 的时候才是这样? + if (roseType !== 'area') { + angle = (sum === 0 && stillShowZeroSum) + ? unitRadian : (value * unitRadian); + } + else { + angle = PI2$4 / validDataCount; + } + + 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 + ? linearMap(value, extent, [r0, r]) + : r + }); + + currentAngle = endAngle; + }); + + // Some sector is constrained by minAngle + // Rest sectors needs recalculate angle + if (restAngle < PI2$4 && validDataCount) { + // Average the angle if rest angle is not enough after all angles is + // Constrained by minAngle + if (restAngle <= 1e-3) { + var angle = PI2$4 / validDataCount; + data.each(valueDim, function (value, idx) { + if (!isNaN(value)) { + var layout = data.getItemLayout(idx); + layout.angle = angle; + layout.startAngle = startAngle + dir * idx * angle; + layout.endAngle = startAngle + dir * (idx + 1) * angle; + } + }); + } + else { + unitRadian = restAngle / valueSumLargerThanMinAngle; + currentAngle = startAngle; + data.each(valueDim, function (value, idx) { + if (!isNaN(value)) { + var layout = data.getItemLayout(idx); + var angle = layout.angle === minAngle + ? minAngle : value * unitRadian; + layout.startAngle = currentAngle; + layout.endAngle = currentAngle + dir * angle; + currentAngle += dir * angle; + } + }); + } + } + + labelLayout(seriesModel, r, width, height); + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 dataFilter = function (seriesType) { + return { + seriesType: seriesType, + reset: function (seriesModel, ecModel) { + var legendModels = ecModel.findComponents({ + mainType: 'legend' + }); + if (!legendModels || !legendModels.length) { + return; + } + var data = seriesModel.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; + }); + } + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +createDataSelectAction('pie', [{ + type: 'pieToggleSelect', + event: 'pieselectchanged', + method: 'toggleSelected' +}, { + type: 'pieSelect', + event: 'pieselected', + method: 'select' +}, { + type: 'pieUnSelect', + event: 'pieunselected', + method: 'unSelect' +}]); + +registerVisual(dataColor('pie')); +registerLayout(curry(pieLayout, 'pie')); +registerProcessor(dataFilter('pie')); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +SeriesModel.extend({ + + type: 'series.scatter', + + dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'], + + getInitialData: function (option, ecModel) { + return createListFromArray(this.getSource(), this); + }, + + brushSelector: 'point', + + getProgressive: function () { + var progressive = this.option.progressive; + if (progressive == null) { + // PENDING + return this.option.large ? 5e3 : this.get('progressive'); + } + return progressive; + }, + + getProgressiveThreshold: function () { + var progressiveThreshold = this.option.progressiveThreshold; + if (progressiveThreshold == null) { + // PENDING + return this.option.large ? 1e4 : this.get('progressiveThreshold'); + } + return progressiveThreshold; + }, + + 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, + // cursor: null, + + // label: { + // show: false + // distance: 5, + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + // position: 默认自适应,水平布局为'top',垂直布局为'right',可选为 + // 'inside'|'left'|'right'|'top'|'bottom' + // 默认使用全局文本样式,详见TEXTSTYLE + // }, + itemStyle: { + opacity: 0.8 + // color: 各异 + } + + // progressive: null + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// TODO Batch by color + +var BOOST_SIZE_THRESHOLD = 4; + +var LargeSymbolPath = extendShape({ + + shape: { + points: null + }, + + symbolProxy: null, + + buildPath: function (path, shape) { + var points = shape.points; + var size = shape.size; + + var symbolProxy = this.symbolProxy; + var symbolProxyShape = symbolProxy.shape; + var ctx = path.getContext ? path.getContext() : path; + var canBoost = ctx && size[0] < BOOST_SIZE_THRESHOLD; + + // Do draw in afterBrush. + if (canBoost) { + return; + } + + for (var i = 0; i < points.length;) { + var x = points[i++]; + var y = points[i++]; + + if (isNaN(x) || isNaN(y)) { + continue; + } + + symbolProxyShape.x = x - size[0] / 2; + symbolProxyShape.y = y - size[1] / 2; + symbolProxyShape.width = size[0]; + symbolProxyShape.height = size[1]; + + symbolProxy.buildPath(path, symbolProxyShape, true); + } + }, + + afterBrush: function (ctx) { + var shape = this.shape; + var points = shape.points; + var size = shape.size; + var canBoost = size[0] < BOOST_SIZE_THRESHOLD; + + if (!canBoost) { + return; + } + + this.setTransform(ctx); + // PENDING If style or other canvas status changed? + for (var i = 0; i < points.length;) { + var x = points[i++]; + var y = points[i++]; + if (isNaN(x) || isNaN(y)) { + continue; + } + // fillRect is faster than building a rect path and draw. + // And it support light globalCompositeOperation. + ctx.fillRect( + x - size[0] / 2, y - size[1] / 2, + size[0], size[1] + ); + } + + this.restoreTransform(ctx); + }, + + findDataIndex: function (x, y) { + // TODO ??? + // Consider transform + + var shape = this.shape; + var points = shape.points; + var size = shape.size; + + var w = Math.max(size[0], 4); + var h = Math.max(size[1], 4); + + // Not consider transform + // Treat each element as a rect + // top down traverse + for (var idx = points.length / 2 - 1; idx >= 0; idx--) { + var i = idx * 2; + var x0 = points[i] - w / 2; + var y0 = points[i + 1] - h / 2; + if (x >= x0 && y >= y0 && x <= x0 + w && y <= y0 + h) { + return idx; + } + } + + return -1; + } +}); + +function LargeSymbolDraw() { + this.group = new Group(); +} + +var largeSymbolProto = LargeSymbolDraw.prototype; + +largeSymbolProto.isPersistent = function () { + return !this._incremental; +}; + +/** + * Update symbols draw by new data + * @param {module:echarts/data/List} data + */ +largeSymbolProto.updateData = function (data) { + this.group.removeAll(); + var symbolEl = new LargeSymbolPath({ + rectHover: true, + cursor: 'default' + }); + + symbolEl.setShape({ + points: data.getLayout('symbolPoints') + }); + this._setCommon(symbolEl, data); + this.group.add(symbolEl); + + this._incremental = null; +}; + +largeSymbolProto.updateLayout = function (data) { + if (this._incremental) { + return; + } + + var points = data.getLayout('symbolPoints'); + this.group.eachChild(function (child) { + if (child.startIndex != null) { + var len = (child.endIndex - child.startIndex) * 2; + var byteOffset = child.startIndex * 4 * 2; + points = new Float32Array(points.buffer, byteOffset, len); + } + child.setShape('points', points); + }); +}; + +largeSymbolProto.incrementalPrepareUpdate = function (data) { + this.group.removeAll(); + + this._clearIncremental(); + // Only use incremental displayables when data amount is larger than 2 million. + // PENDING Incremental data? + if (data.count() > 2e6) { + if (!this._incremental) { + this._incremental = new IncrementalDisplayble({ + silent: true + }); + } + this.group.add(this._incremental); + } + else { + this._incremental = null; + } +}; + +largeSymbolProto.incrementalUpdate = function (taskParams, data) { + var symbolEl; + if (this._incremental) { + symbolEl = new LargeSymbolPath(); + this._incremental.addDisplayable(symbolEl, true); + } + else { + symbolEl = new LargeSymbolPath({ + rectHover: true, + cursor: 'default', + startIndex: taskParams.start, + endIndex: taskParams.end + }); + symbolEl.incremental = true; + this.group.add(symbolEl); + } + + symbolEl.setShape({ + points: data.getLayout('symbolPoints') + }); + this._setCommon(symbolEl, data, !!this._incremental); +}; + +largeSymbolProto._setCommon = function (symbolEl, data, isIncremental) { + var hostModel = data.hostModel; + + // TODO + // if (data.hasItemVisual.symbolSize) { + // // TODO typed array? + // symbolEl.setShape('sizes', data.mapArray( + // function (idx) { + // var size = data.getItemVisual(idx, 'symbolSize'); + // return (size instanceof Array) ? size : [size, size]; + // } + // )); + // } + // else { + var size = data.getVisual('symbolSize'); + symbolEl.setShape('size', (size instanceof Array) ? size : [size, size]); + // } + + // Create symbolProxy to build path for each data + symbolEl.symbolProxy = createSymbol( + data.getVisual('symbol'), 0, 0, 0, 0 + ); + // Use symbolProxy setColor method + symbolEl.setColor = symbolEl.symbolProxy.setColor; + + var extrudeShadow = symbolEl.shape.size[0] < BOOST_SIZE_THRESHOLD; + symbolEl.useStyle( + // Draw shadow when doing fillRect is extremely slow. + hostModel.getModel('itemStyle').getItemStyle(extrudeShadow ? ['color', 'shadowBlur', 'shadowColor'] : ['color']) + ); + + var visualColor = data.getVisual('color'); + if (visualColor) { + symbolEl.setColor(visualColor); + } + + if (!isIncremental) { + // Enable tooltip + // PENDING May have performance issue when path is extremely large + symbolEl.seriesIndex = hostModel.seriesIndex; + symbolEl.on('mousemove', function (e) { + symbolEl.dataIndex = null; + var dataIndex = symbolEl.findDataIndex(e.offsetX, e.offsetY); + if (dataIndex >= 0) { + // Provide dataIndex for tooltip + symbolEl.dataIndex = dataIndex + (symbolEl.startIndex || 0); + } + }); + } +}; + +largeSymbolProto.remove = function () { + this._clearIncremental(); + this._incremental = null; + this.group.removeAll(); +}; + +largeSymbolProto._clearIncremental = function () { + var incremental = this._incremental; + if (incremental) { + incremental.clearDisplaybles(); + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +extendChartView({ + + type: 'scatter', + + render: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + + var symbolDraw = this._updateSymbolDraw(data, seriesModel); + symbolDraw.updateData(data); + + this._finished = true; + }, + + incrementalPrepareRender: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + var symbolDraw = this._updateSymbolDraw(data, seriesModel); + + symbolDraw.incrementalPrepareUpdate(data); + + this._finished = false; + }, + + incrementalRender: function (taskParams, seriesModel, ecModel) { + this._symbolDraw.incrementalUpdate(taskParams, seriesModel.getData()); + + this._finished = taskParams.end === seriesModel.getData().count(); + }, + + updateTransform: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + // Must mark group dirty and make sure the incremental layer will be cleared + // PENDING + this.group.dirty(); + + if (!this._finished || data.count() > 1e4 || !this._symbolDraw.isPersistent()) { + return { + update: true + }; + } + else { + var res = pointsLayout().reset(seriesModel); + if (res.progress) { + res.progress({ start: 0, end: data.count() }, data); + } + + this._symbolDraw.updateLayout(data); + } + }, + + _updateSymbolDraw: function (data, seriesModel) { + var symbolDraw = this._symbolDraw; + var pipelineContext = seriesModel.pipelineContext; + var isLargeDraw = pipelineContext.large; + + if (!symbolDraw || isLargeDraw !== this._isLargeDraw) { + symbolDraw && symbolDraw.remove(); + symbolDraw = this._symbolDraw = isLargeDraw + ? new LargeSymbolDraw() + : new SymbolDraw(); + this._isLargeDraw = isLargeDraw; + this.group.removeAll(); + } + + this.group.add(symbolDraw.group); + + return symbolDraw; + }, + + remove: function (ecModel, api) { + this._symbolDraw && this._symbolDraw.remove(true); + this._symbolDraw = null; + }, + + dispose: function () {} +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// import * as zrUtil from 'zrender/src/core/util'; + +// In case developer forget to include grid component +registerVisual(visualSymbol('scatter', 'circle')); +registerLayout(pointsLayout('scatter')); + +// echarts.registerProcessor(function (ecModel, api) { +// ecModel.eachSeriesByType('scatter', function (seriesModel) { +// var data = seriesModel.getData(); +// var coordSys = seriesModel.coordinateSystem; +// if (coordSys.type !== 'geo') { +// return; +// } +// var startPt = coordSys.pointToData([0, 0]); +// var endPt = coordSys.pointToData([api.getWidth(), api.getHeight()]); + +// var dims = zrUtil.map(coordSys.dimensions, function (dim) { +// return data.mapDimension(dim); +// }); +// var range = {}; +// range[dims[0]] = [Math.min(startPt[0], endPt[0]), Math.max(startPt[0], endPt[0])]; +// range[dims[1]] = [Math.min(startPt[1], endPt[1]), Math.max(startPt[1], endPt[1])]; + +// data.selectRange(range); +// }); +// }); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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; +} + +inherits(IndicatorAxis, Axis); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// TODO clockwise + +function Radar(radarModel, ecModel, api) { + + this._model = radarModel; + /** + * Radar dimensions + * @type {Array.} + */ + this.dimensions = []; + + this._indicatorAxes = 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.r0; + /** + * @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 = parsePercent$1(center[0], viewWidth); + this.cy = parsePercent$1(center[1], viewHeight); + + this.startAngle = radarModel.get('startAngle') * Math.PI / 180; + + // radius may be single value like `20`, `'80%'`, or array like `[10, '80%']` + var radius = radarModel.get('radius'); + if (typeof radius === 'string' || typeof radius === 'number') { + radius = [0, radius]; + } + this.r0 = parsePercent$1(radius[0], viewSize); + this.r = parsePercent$1(radius[1], viewSize); + + each$1(this._indicatorAxes, function (indicatorAxis, idx) { + indicatorAxis.setExtent(this.r0, 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; + each$1(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(); + each$1(indicatorAxes, function (indicatorAxis) { + indicatorAxis.scale.unionExtentFromData(data, data.mapDimension(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. + each$1(indicatorAxes, function (indicatorAxis, idx) { + var rawExtent = getScaleExtent(indicatorAxis.scale, indicatorAxis.model); + niceScaleExtent(indicatorAxis.scale, indicatorAxis.model); + + var axisModel = indicatorAxis.model; + var scale = indicatorAxis.scale; + var fixedMin = axisModel.getMin(); + var fixedMax = axisModel.getMax(); + var interval = scale.getInterval(); + + if (fixedMin != null && fixedMax != null) { + // User set min, max, divide to get new interval + scale.setExtent(+fixedMin, +fixedMax); + 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( + round$1(center - halfSplitNumber * interval), + round$1(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; +}; + +CoordinateSystemManager.register('radar', Radar); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 valueAxisDefault = axisDefault.valueAxis; + +function defaultsShow(opt, show) { + return defaults({ + show: show + }, opt); +} + +var RadarModel = 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'); + var showName = this.get('name.show'); + var nameFormatter = this.get('name.formatter'); + var nameGap = this.get('nameGap'); + var triggerEvent = this.get('triggerEvent'); + + var indicatorModels = map(this.get('indicator') || [], function (indicatorOpt) { + // PENDING + if (indicatorOpt.max != null && indicatorOpt.max > 0 && !indicatorOpt.min) { + indicatorOpt.min = 0; + } + else if (indicatorOpt.min != null && indicatorOpt.min < 0 && !indicatorOpt.max) { + indicatorOpt.max = 0; + } + var iNameTextStyle = nameTextStyle; + if(indicatorOpt.color != null) { + iNameTextStyle = defaults({color: indicatorOpt.color}, nameTextStyle); + } + // Use same configuration + indicatorOpt = merge(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: iNameTextStyle, + triggerEvent: triggerEvent + }, false); + if (!showName) { + indicatorOpt.name = ''; + } + if (typeof nameFormatter === 'string') { + var indName = indicatorOpt.name; + indicatorOpt.name = nameFormatter.replace('{value}', indName != null ? indName : ''); + } + else if (typeof nameFormatter === 'function') { + indicatorOpt.name = nameFormatter( + indicatorOpt.name, indicatorOpt + ); + } + var model = extend( + new Model(indicatorOpt, null, this.ecModel), + axisModelCommonMixin + ); + + // For triggerEvent. + model.mainType = 'radar'; + model.componentIndex = this.componentIndex; + + return model; + }, 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: 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: [] + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 axisBuilderAttrs$1 = [ + 'axisLine', 'axisTickLabel', 'axisName' +]; + +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 = 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; + }); + + each$1(axisBuilders, function (axisBuilder) { + each$1(axisBuilderAttrs$1, axisBuilder.add, axisBuilder); + this.group.add(axisBuilder.getGroup()); + }, this); + }, + + _buildSplitLineAndArea: function (radarModel) { + var radar = radarModel.coordinateSystem; + 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 = isArray(splitLineColors) ? splitLineColors : [splitLineColors]; + splitAreaColors = 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 Circle({ + shape: { + cx: cx, + cy: cy, + r: ticksRadius[i].coord + } + })); + } + if (showSplitArea && i < ticksRadius.length - 1) { + var colorIndex = getColorIndex(splitAreas, splitAreaColors, i); + splitAreas[colorIndex].push(new Ring({ + shape: { + cx: cx, + cy: cy, + r0: ticksRadius[i].coord, + r: ticksRadius[i + 1].coord + } + })); + } + } + } + // Polyyon + else { + var realSplitNumber; + var axesTicksPoints = map(indicatorAxes, function (indicatorAxis, idx) { + var ticksCoords = indicatorAxis.getTicksCoords(); + realSplitNumber = realSplitNumber == null + ? ticksCoords.length - 1 + : Math.min(ticksCoords.length - 1, realSplitNumber); + return map(ticksCoords, function (tickCoord) { + return radar.coordToPoint(tickCoord.coord, idx); + }); + }); + + var prevPoints = []; + for (var i = 0; i <= realSplitNumber; i++) { + var points = []; + for (var j = 0; j < indicatorAxes.length; j++) { + points.push(axesTicksPoints[j][i]); + } + // Close + if (points[0]) { + points.push(points[0].slice()); + } + else { + if (__DEV__) { + console.error('Can\'t draw value axis ' + i); + } + } + + if (showSplitLine) { + var colorIndex = getColorIndex(splitLines, splitLineColors, i); + splitLines[colorIndex].push(new Polyline({ + shape: { + points: points + } + })); + } + if (showSplitArea && prevPoints) { + var colorIndex = getColorIndex(splitAreas, splitAreaColors, i - 1); + splitAreas[colorIndex].push(new Polygon({ + shape: { + points: points.concat(prevPoints) + } + })); + } + prevPoints = points.slice().reverse(); + } + } + + var lineStyle = lineStyleModel.getLineStyle(); + var areaStyle = areaStyleModel.getAreaStyle(); + // Add splitArea before splitLine + each$1(splitAreas, function (splitAreas, idx) { + this.group.add(mergePath( + splitAreas, { + style: defaults({ + stroke: 'none', + fill: splitAreaColors[idx % splitAreaColors.length] + }, areaStyle), + silent: true + } + )); + }, this); + + each$1(splitLines, function (splitLines, idx) { + this.group.add(mergePath( + splitLines, { + style: defaults({ + fill: 'none', + stroke: splitLineColors[idx % splitLineColors.length] + }, lineStyle), + silent: true + } + )); + }, this); + + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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.getRawData(); + }; + }, + + getInitialData: function (option, ecModel) { + return createListSimply(this, { + generateCoord: 'indicator_', + generateCoordCount: Infinity + }); + }, + + formatTooltip: function (dataIndex) { + var data = this.getData(); + var coordSys = this.coordinateSystem; + var indicatorAxes = coordSys.getIndicatorAxes(); + var name = this.getData().getName(dataIndex); + return encodeHTML(name === '' ? this.name : name) + '
' + + map(indicatorAxes, function (axis, idx) { + var val = data.get(data.mapDimension(axis.dim), dataIndex); + return encodeHTML(axis.name + ' : ' + val); + }).join('
'); + }, + + defaultOption: { + zlevel: 0, + z: 2, + coordinateSystem: 'radar', + legendHoverLink: true, + radarIndex: 0, + lineStyle: { + width: 2, + type: 'solid' + }, + label: { + position: 'top' + }, + // areaStyle: { + // }, + // itemStyle: {} + symbol: 'emptyCircle', + symbolSize: 4 + // symbolRotate: null + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 normalizeSymbolSize(symbolSize) { + if (!isArray(symbolSize)) { + symbolSize = [+symbolSize, +symbolSize]; + } + return symbolSize; +} + +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$$1(data, idx) { + var symbolType = data.getItemVisual(idx, 'symbol') || 'circle'; + var color = data.getItemVisual(idx, 'color'); + if (symbolType === 'none') { + return; + } + var symbolSize = normalizeSymbolSize( + data.getItemVisual(idx, 'symbolSize') + ); + var symbolPath = createSymbol( + symbolType, -1, -1, 2, 2, color + ); + symbolPath.attr({ + style: { + strokeNoScale: true + }, + z2: 100, + scale: [symbolSize[0] / 2, symbolSize[1] / 2] + }); + 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$$1(data, idx); + if (symbolPath) { + symbolPath.__dimIdx = i; + if (oldPoints[i]) { + symbolPath.attr('position', oldPoints[i]); + graphic[isInit ? 'initProps' : 'updateProps']( + symbolPath, { + position: newPoints[i] + }, seriesModel, idx + ); + } + else { + symbolPath.attr('position', newPoints[i]); + } + symbolGroup.add(symbolPath); + } + } + } + + function getInitialPoints(points) { + return 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 Polygon(); + var polyline = new Polyline(); + var target = { + shape: { + points: points + } + }; + polygon.shape.points = getInitialPoints(points); + polyline.shape.points = getInitialPoints(points); + initProps(polygon, target, seriesModel, idx); + initProps(polyline, target, seriesModel, idx); + + var itemGroup = new Group(); + var symbolGroup = new 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 + ); + + updateProps(polyline, target, seriesModel); + 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.useStyle( + defaults( + itemModel.getModel('lineStyle').getLineStyle(), + { + fill: 'none', + stroke: color + } + ) + ); + polyline.hoverStyle = itemModel.getModel('emphasis.lineStyle').getLineStyle(); + + var areaStyleModel = itemModel.getModel('areaStyle'); + var hoverAreaStyleModel = itemModel.getModel('emphasis.areaStyle'); + var polygonIgnore = areaStyleModel.isEmpty() && areaStyleModel.parentModel.isEmpty(); + var hoverPolygonIgnore = hoverAreaStyleModel.isEmpty() && hoverAreaStyleModel.parentModel.isEmpty(); + + hoverPolygonIgnore = hoverPolygonIgnore && polygonIgnore; + polygon.ignore = polygonIgnore; + + polygon.useStyle( + defaults( + areaStyleModel.getAreaStyle(), + { + fill: color, + opacity: 0.7 + } + ) + ); + polygon.hoverStyle = hoverAreaStyleModel.getAreaStyle(); + + var itemStyle = itemModel.getModel('itemStyle').getItemStyle(['color']); + var itemHoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); + var labelModel = itemModel.getModel('label'); + var labelHoverModel = itemModel.getModel('emphasis.label'); + symbolGroup.eachChild(function (symbolPath) { + symbolPath.setStyle(itemStyle); + symbolPath.hoverStyle = clone(itemHoverStyle); + + setLabelStyle( + symbolPath.style, symbolPath.hoverStyle, labelModel, labelHoverModel, + { + labelFetcher: data.hostModel, + labelDataIndex: idx, + labelDimIndex: symbolPath.__dimIdx, + defaultText: data.get(data.dimensions[symbolPath.__dimIdx], idx), + autoColor: color, + isRectText: true + } + ); + }); + + 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); + + setHoverStyle(itemGroup); + }); + + this._data = data; + }, + + remove: function () { + this.group.removeAll(); + this._data = null; + }, + + dispose: function () {} +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 radarLayout = function (ecModel) { + 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); + } + var axes = coordSys.getIndicatorAxes(); + for (var i = 0; i < axes.length; i++) { + data.each(data.mapDimension(axes[i].dim), pointsConverter); + } + + data.each(function (idx) { + // Close polygon + points[idx][0] && points[idx].push(points[idx][0].slice()); + data.setItemLayout(idx, points[idx]); + }); + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Backward compat for radar chart in 2 +var backwardCompat$1 = function (option) { + var polarOptArr = option.polar; + if (polarOptArr) { + if (!isArray(polarOptArr)) { + polarOptArr = [polarOptArr]; + } + var polarNotRadar = []; + each$1(polarOptArr, function (polarOpt, idx) { + if (polarOpt.indicator) { + if (polarOpt.type && !polarOpt.shape) { + polarOpt.shape = polarOpt.type; + } + option.radar = option.radar || []; + if (!isArray(option.radar)) { + option.radar = [option.radar]; + } + option.radar.push(polarOpt); + } + else { + polarNotRadar.push(polarOpt); + } + }); + option.polar = polarNotRadar; + } + each$1(option.series, function (seriesOpt) { + if (seriesOpt && seriesOpt.type === 'radar' && seriesOpt.polarIndex) { + seriesOpt.radarIndex = seriesOpt.polarIndex; + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + + +// Must use radar component +registerVisual(dataColor('radar')); +registerVisual(visualSymbol('radar', 'circle')); +registerLayout(radarLayout); +registerProcessor(dataFilter('radar')); +registerPreprocessor(backwardCompat$1); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Simple view coordinate system + * Mapping given x, y to transformd view x, y + */ + +var v2ApplyTransform$1 = applyTransform; + +// Dummy transform node +function TransformDummy() { + Transformable.call(this); +} +mixin(TransformDummy, Transformable); + +function View(name) { + /** + * @type {string} + */ + this.name = name; + + /** + * @type {Object} + */ + this.zoomLimit; + + Transformable.call(this); + + this._roamTransformable = new TransformDummy(); + + this._rawTransformable = new TransformDummy(); + + this._center; + this._zoom; +} + +View.prototype = { + + constructor: View, + + type: 'view', + + /** + * @param {Array.} + * @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 rawTransform = this._rawTransformable; + + rawTransform.transform = rect.calculateTransform( + new BoundingRect(x, y, width, height) + ); + + rawTransform.decomposeTransform(); + + this._updateTransform(); + }, + + /** + * Set center of view + * @param {Array.} [centerCoord] + */ + setCenter: function (centerCoord) { + if (!centerCoord) { + return; + } + this._center = centerCoord; + + this._updateCenterAndZoom(); + }, + + /** + * @param {number} zoom + */ + setZoom: function (zoom) { + zoom = zoom || 1; + + var zoomLimit = this.zoomLimit; + if (zoomLimit) { + if (zoomLimit.max != null) { + zoom = Math.min(zoomLimit.max, zoom); + } + if (zoomLimit.min != null) { + zoom = Math.max(zoomLimit.min, zoom); + } + } + this._zoom = zoom; + + this._updateCenterAndZoom(); + }, + + /** + * Get default center without roam + */ + getDefaultCenter: function () { + // Rect before any transform + var rawRect = this.getBoundingRect(); + var cx = rawRect.x + rawRect.width / 2; + var cy = rawRect.y + rawRect.height / 2; + + return [cx, cy]; + }, + + getCenter: function () { + return this._center || this.getDefaultCenter(); + }, + + getZoom: function () { + return this._zoom || 1; + }, + + /** + * @return {Array.} data + * @param {boolean} noRoam + * @param {Array.} [out] + * @return {Array.} + */ + dataToPoint: function (data, noRoam, out) { + var transform = noRoam ? this._rawTransform : this.transform; + out = out || []; + return transform + ? v2ApplyTransform$1(out, data, transform) + : copy(out, data); + }, + + /** + * Convert a (x, y) point to (lon, lat) data + * @param {Array.} point + * @return {Array.} + */ + pointToData: function (point) { + var invTransform = this.invTransform; + return invTransform + ? v2ApplyTransform$1([], point, invTransform) + : [point[0], point[1]]; + }, + + /** + * @implements + * see {module:echarts/CoodinateSystem} + */ + convertToPixel: curry(doConvert$1, 'dataToPoint'), + + /** + * @implements + * see {module:echarts/CoodinateSystem} + */ + convertFromPixel: curry(doConvert$1, 'pointToData'), + + /** + * @implements + * see {module:echarts/CoodinateSystem} + */ + containPoint: function (point) { + return this.getViewRectAfterRoam().contain(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; + // } +}; + +mixin(View, Transformable); + +function doConvert$1(methodName, ecModel, finder, value) { + var seriesModel = finder.seriesModel; + var coordSys = seriesModel ? seriesModel.coordinateSystem : null; // e.g., graph. + return coordSys === this ? coordSys[methodName](value) : null; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Fix for 南海诸岛 + +var geoCoord = [126, 25]; + +var points$1 = [ + [[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$1 = 0; i$1 < points$1.length; i$1++) { + for (var k = 0; k < points$1[i$1].length; k++) { + points$1[i$1][k][0] /= 10.5; + points$1[i$1][k][1] /= -10.5 / 0.75; + + points$1[i$1][k][0] += geoCoord[0]; + points$1[i$1][k][1] += geoCoord[1]; + } +} + +var fixNanhai = function (mapType, regions) { + if (mapType === 'china') { + regions.push(new Region( + '南海诸岛', + map(points$1, function (exterior) { + return { + type: 'polygon', + exterior: exterior + }; + }), geoCoord + )); + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 coordsOffsetMap = { + '南海诸岛' : [32, 80], + // 全国 + '广东': [0, -10], + '香港': [10, 5], + '澳门': [-10, 10], + //'北京': [-10, 0], + '天津': [5, 5] +}; + +var fixTextCoord = function (mapType, region) { + if (mapType === 'china') { + 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); + } + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 geoCoordMap = { + 'Russia': [100, 60], + 'United States': [-99, 38], + 'United States of America': [-99, 38] +}; + +var fixGeoCoord = function (mapType, region) { + if (mapType === 'world') { + var geoCoord = geoCoordMap[region.name]; + if (geoCoord) { + var cp = region.center; + cp[0] = geoCoord[0]; + cp[1] = geoCoord[1]; + } + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Fix for 钓鱼岛 + +// var Region = require('../Region'); +// var zrUtil = require('zrender/src/core/util'); + +// var geoCoord = [126, 25]; + +var points$2 = [ + [ + [123.45165252685547, 25.73527164402261], + [123.49731445312499, 25.73527164402261], + [123.49731445312499, 25.750734064600884], + [123.45165252685547, 25.750734064600884], + [123.45165252685547, 25.73527164402261] + ] +]; + +var fixDiaoyuIsland = function (mapType, region) { + if (mapType === 'china' && region.name === '台湾') { + region.geometries.push({ + type: 'polygon', + exterior: points$2[0] + }); + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Built-in GEO fixer. +var inner$7 = makeInner(); + +var geoJSONLoader = { + + /** + * @param {string} mapName + * @param {Object} mapRecord {specialAreas, geoJSON} + * @return {Object} {regions, boundingRect} + */ + load: function (mapName, mapRecord) { + + var parsed = inner$7(mapRecord).parsed; + + if (parsed) { + return parsed; + } + + var specialAreas = mapRecord.specialAreas || {}; + var geoJSON = mapRecord.geoJSON; + var regions; + + // https://jsperf.com/try-catch-performance-overhead + try { + regions = geoJSON ? parseGeoJson$1(geoJSON) : []; + } + catch (e) { + throw new Error('Invalid geoJson format\n' + e.message); + } + + each$1(regions, function (region) { + var regionName = region.name; + + fixTextCoord(mapName, region); + fixGeoCoord(mapName, region); + fixDiaoyuIsland(mapName, region); + + // Some area like Alaska in USA map needs to be tansformed + // to look better + var specialArea = specialAreas[regionName]; + if (specialArea) { + region.transformTo( + specialArea.left, specialArea.top, specialArea.width, specialArea.height + ); + } + }); + + fixNanhai(mapName, regions); + + return (inner$7(mapRecord).parsed = { + regions: regions, + boundingRect: getBoundingRect$1(regions) + }); + } +}; + +function getBoundingRect$1(regions) { + var rect; + for (var i = 0; i < regions.length; i++) { + var regionRect = regions[i].getBoundingRect(); + rect = rect || regionRect.clone(); + rect.union(regionRect); + } + return rect; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 inner$8 = makeInner(); + +var geoSVGLoader = { + + /** + * @param {string} mapName + * @param {Object} mapRecord {specialAreas, geoJSON} + * @return {Object} {root, boundingRect} + */ + load: function (mapName, mapRecord) { + var originRoot = inner$8(mapRecord).originRoot; + if (originRoot) { + return { + root: originRoot, + boundingRect: inner$8(mapRecord).boundingRect + }; + } + + var graphic = buildGraphic(mapRecord); + + inner$8(mapRecord).originRoot = graphic.root; + inner$8(mapRecord).boundingRect = graphic.boundingRect; + + return graphic; + }, + + makeGraphic: function (mapName, mapRecord, hostKey) { + // For performance consideration (in large SVG), graphic only maked + // when necessary and reuse them according to hostKey. + var field = inner$8(mapRecord); + var rootMap = field.rootMap || (field.rootMap = createHashMap()); + + var root = rootMap.get(hostKey); + if (root) { + return root; + } + + var originRoot = field.originRoot; + var boundingRect = field.boundingRect; + + // For performance, if originRoot is not used by a view, + // assign it to a view, but not reproduce graphic elements. + if (!field.originRootHostKey) { + field.originRootHostKey = hostKey; + root = originRoot; + } + else { + root = buildGraphic(mapRecord, boundingRect).root; + } + + return rootMap.set(hostKey, root); + }, + + removeGraphic: function (mapName, mapRecord, hostKey) { + var field = inner$8(mapRecord); + var rootMap = field.rootMap; + rootMap && rootMap.removeKey(hostKey); + if (hostKey === field.originRootHostKey) { + field.originRootHostKey = null; + } + } +}; + +function buildGraphic(mapRecord, boundingRect) { + var svgXML = mapRecord.svgXML; + var result; + var root; + + try { + result = svgXML && parseSVG(svgXML, { + ignoreViewBox: true, + ignoreRootClip: true + }) || {}; + root = result.root; + assert$1(root != null); + } + catch (e) { + throw new Error('Invalid svg format\n' + e.message); + } + + var svgWidth = result.width; + var svgHeight = result.height; + var viewBoxRect = result.viewBoxRect; + + if (!boundingRect) { + boundingRect = (svgWidth == null || svgHeight == null) + // If svg width / height not specified, calculate + // bounding rect as the width / height + ? root.getBoundingRect() + : new BoundingRect(0, 0, 0, 0); + + if (svgWidth != null) { + boundingRect.width = svgWidth; + } + if (svgHeight != null) { + boundingRect.height = svgHeight; + } + } + + if (viewBoxRect) { + var viewBoxTransform = makeViewBoxTransform(viewBoxRect, boundingRect.width, boundingRect.height); + var elRoot = root; + root = new Group(); + root.add(elRoot); + elRoot.scale = viewBoxTransform.scale; + elRoot.position = viewBoxTransform.position; + } + + root.setClipPath(new Rect({ + shape: boundingRect.plain() + })); + + return { + root: root, + boundingRect: boundingRect + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 loaders = { + geoJSON: geoJSONLoader, + svg: geoSVGLoader +}; + +var geoSourceManager = { + + /** + * @param {string} mapName + * @param {Object} nameMap + * @return {Object} source {regions, regionsMap, nameCoordMap, boundingRect} + */ + load: function (mapName, nameMap) { + var regions = []; + var regionsMap = createHashMap(); + var nameCoordMap = createHashMap(); + var boundingRect; + var mapRecords = retrieveMap(mapName); + + each$1(mapRecords, function (record) { + var singleSource = loaders[record.type].load(mapName, record); + + each$1(singleSource.regions, function (region) { + var regionName = region.name; + + // Try use the alias in geoNameMap + if (nameMap && nameMap.hasOwnProperty(regionName)) { + region = region.cloneShallow(regionName = nameMap[regionName]); + } + + regions.push(region); + regionsMap.set(regionName, region); + nameCoordMap.set(regionName, region.center); + }); + + var rect = singleSource.boundingRect; + if (rect) { + boundingRect + ? boundingRect.union(rect) + : (boundingRect = rect.clone()); + } + }); + + return { + regions: regions, + regionsMap: regionsMap, + nameCoordMap: nameCoordMap, + // FIXME Always return new ? + boundingRect: boundingRect || new BoundingRect(0, 0, 0, 0) + }; + }, + + /** + * @param {string} mapName + * @param {string} hostKey For cache. + * @return {Array.} Roots. + */ + makeGraphic: makeInvoker('makeGraphic'), + + /** + * @param {string} mapName + * @param {string} hostKey For cache. + */ + removeGraphic: makeInvoker('removeGraphic') +}; + +function makeInvoker(methodName) { + return function (mapName, hostKey) { + var mapRecords = retrieveMap(mapName); + var results = []; + + each$1(mapRecords, function (record) { + var method = loaders[record.type][methodName]; + method && results.push(method(mapName, record, hostKey)); + }); + + return results; + }; +} + +function mapNotExistsError(mapName) { + if (__DEV__) { + console.error( + 'Map ' + mapName + ' not exists. You can download map file on http://echarts.baidu.com/download-map.html' + ); + } +} + +function retrieveMap(mapName) { + var mapRecords = mapDataStorage.retrieveMap(mapName) || []; + + if (__DEV__) { + if (!mapRecords.length) { + mapNotExistsError(mapName); + } + } + + return mapRecords; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * [Geo description] + * For backward compatibility, the orginal interface: + * `name, map, geoJson, specialAreas, nameMap` is kept. + * + * @param {string|Object} name + * @param {string} map Map type + * Specify the positioned areas by left, top, width, height + * @param {Object.} [nameMap] + * Specify name alias + */ +function Geo(name, map$$1, nameMap) { + + View.call(this, name); + + /** + * Map type + * @type {string} + */ + this.map = map$$1; + + var source = geoSourceManager.load(map$$1, nameMap); + + this._nameCoordMap = source.nameCoordMap; + this._regionsMap = source.nameCoordMap; + + /** + * @readOnly + */ + this.regions = source.regions; + + /** + * @type {module:zrender/src/core/BoundingRect} + */ + this._rect = source.boundingRect; +} + +Geo.prototype = { + + constructor: Geo, + + type: 'geo', + + /** + * @param {Array.} + * @readOnly + */ + dimensions: ['lng', 'lat'], + + /** + * If contain given lng,lat coord + * @param {Array.} + * @readOnly + */ + containCoord: function (coord) { + var regions = this.regions; + for (var i = 0; i < regions.length; i++) { + if (regions[i].contain(coord)) { + return true; + } + } + return false; + }, + + /** + * @override + */ + transformTo: function (x, y, width, height) { + var rect = this.getBoundingRect(); + + // FIXME + // Should not name it as invertLng. + var invertLng = this.invertLng; + + rect = rect.clone(); + + if (invertLng) { + // Longitute is inverted + rect.y = -rect.y - rect.height; + } + + var rawTransformable = this._rawTransformable; + + rawTransformable.transform = rect.calculateTransform( + new BoundingRect(x, y, width, height) + ); + + rawTransformable.decomposeTransform(); + + if (invertLng) { + var scale = rawTransformable.scale; + scale[1] = -scale[1]; + } + + rawTransformable.updateTransform(); + + this._updateTransform(); + }, + + /** + * @param {string} name + * @return {module:echarts/coord/geo/Region} + */ + getRegion: function (name) { + return this._regionsMap.get(name); + }, + + getRegionByCoord: function (coord) { + var regions = this.regions; + for (var i = 0; i < regions.length; i++) { + if (regions[i].contain(coord)) { + return regions[i]; + } + } + }, + + /** + * Add geoCoord for indexing by name + * @param {string} name + * @param {Array.} geoCoord + */ + addGeoCoord: function (name, geoCoord) { + this._nameCoordMap.set(name, geoCoord); + }, + + /** + * Get geoCoord by name + * @param {string} name + * @return {Array.} + */ + getGeoCoord: function (name) { + return this._nameCoordMap.get(name); + }, + + /** + * @override + */ + getBoundingRect: function () { + return this._rect; + }, + + /** + * @param {string|Array.} data + * @param {boolean} noRoam + * @param {Array.} [out] + * @return {Array.} + */ + dataToPoint: function (data, noRoam, out) { + if (typeof data === 'string') { + // Map area name to geoCoord + data = this.getGeoCoord(data); + } + if (data) { + return View.prototype.dataToPoint.call(this, data, noRoam, out); + } + }, + + /** + * @override + */ + convertToPixel: curry(doConvert, 'dataToPoint'), + + /** + * @override + */ + convertFromPixel: curry(doConvert, 'pointToData') + +}; + +mixin(Geo, View); + +function doConvert(methodName, ecModel, finder, value) { + var geoModel = finder.geoModel; + var seriesModel = finder.seriesModel; + + var coordSys = geoModel + ? geoModel.coordinateSystem + : seriesModel + ? ( + seriesModel.coordinateSystem // For map. + || (seriesModel.getReferringComponents('geo')[0] || {}).coordinateSystem + ) + : null; + + return coordSys === this ? coordSys[methodName](value) : null; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * 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 boundingCoords = geoModel.get('boundingCoords'); + if (boundingCoords != null) { + var leftTop = boundingCoords[0]; + var rightBottom = boundingCoords[1]; + if (isNaN(leftTop[0]) || isNaN(leftTop[1]) || isNaN(rightBottom[0]) || isNaN(rightBottom[1])) { + if (__DEV__) { + console.error('Invalid boundingCoords'); + } + } + else { + this.setBoundingRect(leftTop[0], leftTop[1], rightBottom[0] - leftTop[0], rightBottom[1] - leftTop[1]); + } + } + + var rect = this.getBoundingRect(); + + var boxLayoutOption; + + var center = geoModel.get('layoutCenter'); + var size = geoModel.get('layoutSize'); + + var viewWidth = api.getWidth(); + var viewHeight = api.getHeight(); + + var aspect = rect.width / rect.height * this.aspectScale; + + var useCenterAndSize = false; + + if (center && size) { + center = [ + parsePercent$1(center[0], viewWidth), + parsePercent$1(center[1], viewHeight) + ]; + size = parsePercent$1(size, Math.min(viewWidth, viewHeight)); + + if (!isNaN(center[0]) && !isNaN(center[1]) && !isNaN(size)) { + useCenterAndSize = true; + } + else { + if (__DEV__) { + console.warn('Given layoutCenter or layoutSize data are invalid. Use left/top/width/height instead.'); + } + } + } + + var viewRect; + if (useCenterAndSize) { + var viewRect = {}; + if (aspect > 1) { + // Width is same with size + viewRect.width = size; + viewRect.height = size / aspect; + } + else { + viewRect.height = size; + viewRect.width = size * aspect; + } + viewRect.y = center[1] - viewRect.height / 2; + viewRect.x = center[0] - viewRect.width / 2; + } + else { + // Use left/top/width/height + boxLayoutOption = geoModel.getBoxLayoutParams(); + + // 0.75 rate + boxLayoutOption.aspect = aspect; + + viewRect = getLayoutRect(boxLayoutOption, { + width: viewWidth, + height: viewHeight + }); + } + + this.setViewRect(viewRect.x, viewRect.y, viewRect.width, viewRect.height); + + this.setCenter(geoModel.get('center')); + this.setZoom(geoModel.get('zoom')); +} + +/** + * @param {module:echarts/coord/Geo} geo + * @param {module:echarts/model/Model} model + * @inner + */ +function setGeoCoords(geo, model) { + each$1(model.get('geoCoord'), function (geoCoord, name) { + geo.addGeoCoord(name, geoCoord); + }); +} + +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 geo = new Geo(name + idx, name, geoModel.get('nameMap')); + + geo.zoomLimit = geoModel.get('scaleLimit'); + geoList.push(geo); + + setGeoCoords(geo, geoModel); + + geoModel.coordinateSystem = geo; + geo.model = geoModel; + + // FIXME ??? + var aspectScale = geoModel.get('aspectScale'); + var invertLng = true; + var mapRecords = mapDataStorage.retrieveMap(name); + if (mapRecords && mapRecords[0] && mapRecords[0].type === 'svg') { + aspectScale == null && (aspectScale = 1); + invertLng = false; + } + else { + aspectScale == null && (aspectScale = 0.75); + } + geo.aspectScale = aspectScale; + geo.invertLng = invertLng; + + // 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) { + if (!seriesModel.getHostGeoModel()) { + var mapType = seriesModel.getMapType(); + mapModelGroupBySeries[mapType] = mapModelGroupBySeries[mapType] || []; + mapModelGroupBySeries[mapType].push(seriesModel); + } + }); + + each$1(mapModelGroupBySeries, function (mapSeries, mapType) { + var nameMapList = map(mapSeries, function (singleMapSeries) { + return singleMapSeries.get('nameMap'); + }); + var geo = new Geo(mapType, mapType, mergeAll(nameMapList)); + + geo.zoomLimit = retrieve.apply(null, map(mapSeries, function (singleMapSeries) { + return singleMapSeries.get('scaleLimit'); + })); + geoList.push(geo); + + // Inject resize method + geo.resize = resizeGeo; + + geo.resize(mapSeries[0], api); + + each$1(mapSeries, function (singleMapSeries) { + singleMapSeries.coordinateSystem = geo; + + setGeoCoords(geo, singleMapSeries); + }); + }); + + return geoList; + }, + + /** + * Fill given regions array + * @param {Array.} originRegionArr + * @param {string} mapName + * @param {Object} [nameMap] + * @return {Array} + */ + getFilledRegions: function (originRegionArr, mapName, nameMap) { + // Not use the original + var regionsArr = (originRegionArr || []).slice(); + + var dataNameMap = createHashMap(); + for (var i = 0; i < regionsArr.length; i++) { + dataNameMap.set(regionsArr[i].name, regionsArr[i]); + } + + var source = geoSourceManager.load(mapName, nameMap); + each$1(source.regions, function (region) { + var name = region.name; + !dataNameMap.get(name) && regionsArr.push({name: name}); + }); + + return regionsArr; + } +}; + +registerCoordinateSystem('geo', geoCreator); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 MapSeries = SeriesModel.extend({ + + type: 'series.map', + + dependencies: ['geo'], + + layoutMode: 'box', + + /** + * 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) { + + // this._fillOption(option, this.getMapType()); + // this.option = option; + + MapSeries.superApply(this, 'init', arguments); + + this.updateSelectedMap(this._createSelectableList()); + }, + + getInitialData: function (option) { + return createListSimply(this, ['value']); + }, + + mergeOption: function (newOption) { + // this._fillOption(newOption, this.getMapType()); + + MapSeries.superApply(this, 'mergeOption', arguments); + + this.updateSelectedMap(this._createSelectableList()); + }, + + _createSelectableList: function () { + var data = this.getRawData(); + var valueDim = data.mapDimension('value'); + var targetList = []; + for (var i = 0, len = data.count(); i < len; i++) { + targetList.push({ + name: data.getName(i), + value: data.get(valueDim, i), + selected: retrieveRawAttr(data, i, 'selected') + }); + } + + targetList = geoCreator.getFilledRegions(targetList, this.getMapType(), this.option.nameMap); + + return targetList; + }, + + /** + * If no host geo model, return null, which means using a + * inner exclusive geo model. + */ + getHostGeoModel: function () { + var geoIndex = this.option.geoIndex; + return geoIndex != null + ? this.dependentModels.geo[geoIndex] + : null; + }, + + getMapType: function () { + return (this.getHostGeoModel() || this).option.map; + }, + + _fillOption: function (option, mapName) { + // Shallow clone + // option = zrUtil.extend({}, option); + + // option.data = geoCreator.getFilledRegions(option.data, mapName, option.nameMap); + + // return option; + }, + + getRawValue: function (dataIndex) { + // Use value stored in data instead because it is calculated from multiple series + // FIXME Provide all value of multiple series ? + var data = this.getData(); + return data.get(data.mapDimension('value'), dataIndex); + }, + + /** + * Get model of region + * @param {string} name + * @return {module:echarts/model/Model} + */ + getRegionModel: function (regionName) { + var data = this.getData(); + return data.getItemModel(data.indexOfName(regionName)); + }, + + /** + * Map tooltip formatter + * + * @param {number} dataIndex + */ + formatTooltip: function (dataIndex) { + // FIXME orignalData and data is a bit confusing + var data = this.getData(); + 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++) { + var otherIndex = seriesGroup[i].originalData.indexOfName(name); + var valueDim = data.mapDimension('value'); + if (!isNaN(seriesGroup[i].originalData.get(valueDim, otherIndex))) { + seriesNames.push( + encodeHTML(seriesGroup[i].name) + ); + } + } + + return seriesNames.join(', ') + '
' + + encodeHTML(name + ' : ' + formattedValue); + }, + + /** + * @implement + */ + getTooltipPosition: function (dataIndex) { + if (dataIndex != null) { + var name = this.getData().getName(dataIndex); + var geo = this.coordinateSystem; + var region = geo.getRegion(name); + + return region && geo.dataToPoint(region.center); + } + }, + + setZoom: function (zoom) { + this.option.zoom = zoom; + }, + + setCenter: function (center) { + this.option.center = center; + }, + + defaultOption: { + // 一级层叠 + zlevel: 0, + // 二级层叠 + z: 2, + + coordinateSystem: 'geo', + + // map should be explicitly specified since ec3. + map: '', + + // If `geoIndex` is not specified, a exclusive geo will be + // created. Otherwise use the specified geo component, and + // `map` and `mapType` are ignored. + // geoIndex: 0, + + // 'center' | 'left' | 'right' | 'x%' | {number} + left: 'center', + // 'center' | 'top' | 'bottom' | 'x%' | {number} + top: 'center', + // right + // bottom + // width: + // height + + // Aspect is width / height. Inited to be geoJson bbox aspect + // This parameter is used for scale this aspect + aspectScale: 0.75, + + ///// Layout with center and size + // If you wan't to put map in a fixed size box with right aspect ratio + // This two properties may more conveninet + // layoutCenter: [50%, 50%] + // layoutSize: 100 + + + // 数值合并方式,默认加和,可选为: + // 'sum' | 'average' | 'max' | 'min' + // mapValueCalculation: 'sum', + // 地图数值计算结果小数精度 + // mapValuePrecision: 0, + + + // 显示图例颜色标识(系列标识的小圆点),图例开启时有效 + showLegendSymbol: true, + // 选择模式,默认关闭,可选single,multiple + // selectedMode: false, + dataRangeHoverLink: true, + // 是否开启缩放及漫游模式 + // roam: false, + + // Define left-top, right-bottom coords to control view + // For example, [ [180, 90], [-180, -90] ], + // higher priority than center and zoom + boundingCoords: null, + + // Default on center of map + center: null, + + zoom: 1, + + scaleLimit: null, + + label: { + show: false, + color: '#000' + }, + // scaleLimit: null, + itemStyle: { + borderWidth: 0.5, + borderColor: '#444', + areaColor: '#eee' + }, + + emphasis: { + label: { + show: true, + color: 'rgb(100,0,0)' + }, + itemStyle: { + areaColor: 'rgba(255,215,0,0.8)' + } + } + } + +}); + +mixin(MapSeries, selectableMixin); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 ATTR = '\0_ec_interaction_mutex'; + +function take(zr, resourceKey, userKey) { + var store = getStore(zr); + store[resourceKey] = userKey; +} + +function release(zr, resourceKey, userKey) { + var store = getStore(zr); + var uKey = store[resourceKey]; + + if (uKey === userKey) { + store[resourceKey] = null; + } +} + +function isTaken(zr, resourceKey) { + return !!getStore(zr)[resourceKey]; +} + +function getStore(zr) { + return zr[ATTR] || (zr[ATTR] = {}); +} + +/** + * payload: { + * type: 'takeGlobalCursor', + * key: 'dataZoomSelect', or 'brush', or ..., + * If no userKey, release global cursor. + * } + */ +registerAction( + {type: 'takeGlobalCursor', event: 'globalCursorTaken', update: 'update'}, + function () {} +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @alias module:echarts/component/helper/RoamController + * @constructor + * @mixin {module:zrender/mixin/Eventful} + * + * @param {module:zrender/zrender~ZRender} zr + */ +function RoamController(zr) { + + /** + * @type {Function} + */ + this.pointerChecker; + + /** + * @type {module:zrender} + */ + this._zr = zr; + + /** + * @type {Object} + */ + this._opt = {}; + + // Avoid two roamController bind the same handler + var bind$$1 = bind; + var mousedownHandler = bind$$1(mousedown, this); + var mousemoveHandler = bind$$1(mousemove, this); + var mouseupHandler = bind$$1(mouseup, this); + var mousewheelHandler = bind$$1(mousewheel, this); + var pinchHandler = bind$$1(pinch, this); + + Eventful.call(this); + + /** + * @param {Function} pointerChecker + * input: x, y + * output: boolean + */ + this.setPointerChecker = function (pointerChecker) { + this.pointerChecker = pointerChecker; + }; + + /** + * 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' + * @param {Object} [opt] + * @param {Object} [opt.zoomOnMouseWheel=true] The value can be: true / false / 'shift' / 'ctrl' / 'alt'. + * @param {Object} [opt.moveOnMouseMove=true] The value can be: true / false / 'shift' / 'ctrl' / 'alt'. + * @param {Object} [opt.moveOnMouseWheel=false] The value can be: true / false / 'shift' / 'ctrl' / 'alt'. + * @param {Object} [opt.preventDefaultMouseMove=true] When pan. + */ + this.enable = function (controlType, opt) { + + // Disable previous first + this.disable(); + + this._opt = defaults(clone(opt) || {}, { + zoomOnMouseWheel: true, + moveOnMouseMove: true, + // By default, wheel do not trigger move. + moveOnMouseWheel: false, + preventDefaultMouseMove: true + }); + + 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; + }; +} + +mixin(RoamController, Eventful); + + +function mousedown(e) { + if (notLeftMouse(e) + || (e.target && e.target.draggable) + ) { + return; + } + + var x = e.offsetX; + var y = e.offsetY; + + // Only check on mosedown, but not mousemove. + // Mouse can be out of target when mouse moving. + if (this.pointerChecker && this.pointerChecker(e, x, y)) { + this._x = x; + this._y = y; + this._dragging = true; + } +} + +function mousemove(e) { + if (notLeftMouse(e) + || !isAvailableBehavior('moveOnMouseMove', e, this._opt) + || !this._dragging + || e.gestureEvent === 'pinch' + || isTaken(this._zr, 'globalPan') + ) { + return; + } + + var x = e.offsetX; + var y = e.offsetY; + + var oldX = this._x; + var oldY = this._y; + + var dx = x - oldX; + var dy = y - oldY; + + this._x = x; + this._y = y; + + this._opt.preventDefaultMouseMove && stop(e.event); + + trigger(this, 'pan', 'moveOnMouseMove', e, { + dx: dx, dy: dy, oldX: oldX, oldY: oldY, newX: x, newY: y + }); +} + +function mouseup(e) { + if (!notLeftMouse(e)) { + this._dragging = false; + } +} + +function mousewheel(e) { + var shouldZoom = isAvailableBehavior('zoomOnMouseWheel', e, this._opt); + var shouldMove = isAvailableBehavior('moveOnMouseWheel', e, this._opt); + var wheelDelta = e.wheelDelta; + var absWheelDeltaDelta = Math.abs(wheelDelta); + var originX = e.offsetX; + var originY = e.offsetY; + + // wheelDelta maybe -0 in chrome mac. + if (wheelDelta === 0 || (!shouldZoom && !shouldMove)) { + return; + } + // console.log(wheelDelta); + if (shouldZoom) { + // Convenience: + // Mac and VM Windows on Mac: scroll up: zoom out. + // Windows: scroll up: zoom in. + + // FIXME: Should do more test in different environment. + // wheelDelta is too complicated in difference nvironment + // (https://developer.mozilla.org/en-US/docs/Web/Events/mousewheel), + // although it has been normallized by zrender. + // wheelDelta of mouse wheel is bigger than touch pad. + var factor = absWheelDeltaDelta > 3 ? 1.4 : absWheelDeltaDelta > 1 ? 1.2 : 1.1; + var scale = wheelDelta > 0 ? factor : 1 / factor; + checkPointerAndTrigger(this, 'zoom', 'zoomOnMouseWheel', e, { + scale: scale, originX: originX, originY: originY + }); + } + // console.log(shouldMove); + if (shouldMove) { + // FIXME: Should do more test in different environment. + var absDelta = Math.abs(wheelDelta); + // wheelDelta of mouse wheel is bigger than touch pad. + var scrollDelta = (wheelDelta > 0 ? 1 : -1) * (absDelta > 3 ? 0.4 : absDelta > 1 ? 0.15 : 0.05); + checkPointerAndTrigger(this, 'scrollMove', 'moveOnMouseWheel', e, { + scrollDelta: scrollDelta, originX: originX, originY: originY + }); + } +} + +function pinch(e) { + if (isTaken(this._zr, 'globalPan')) { + return; + } + var scale = e.pinchScale > 1 ? 1.1 : 1 / 1.1; + checkPointerAndTrigger(this, 'zoom', null, e, { + scale: scale, originX: e.pinchX, originY: e.pinchY + }); +} + +function checkPointerAndTrigger(controller, eventName, behaviorToCheck, e, contollerEvent) { + if (controller.pointerChecker + && controller.pointerChecker(e, contollerEvent.originX, contollerEvent.originY) + ) { + // When mouse is out of roamController rect, + // default befavoius should not be be disabled, otherwise + // page sliding is disabled, contrary to expectation. + stop(e.event); + + trigger(controller, eventName, behaviorToCheck, e, contollerEvent); + } +} + +function trigger(controller, eventName, behaviorToCheck, e, contollerEvent) { + // Also provide behavior checker for event listener, for some case that + // multiple components share one listener. + contollerEvent.isAvailableBehavior = bind(isAvailableBehavior, null, behaviorToCheck, e); + controller.trigger(eventName, contollerEvent); +} + +// settings: { +// zoomOnMouseWheel +// moveOnMouseMove +// moveOnMouseWheel +// } +// The value can be: true / false / 'shift' / 'ctrl' / 'alt'. +function isAvailableBehavior(behaviorToCheck, e, settings) { + var setting = settings[behaviorToCheck]; + return !behaviorToCheck || ( + setting && (!isString(setting) || e.event[setting + 'Key']) + ); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + + +/** + * For geo and graph. + * + * @param {Object} controllerHost + * @param {module:zrender/Element} controllerHost.target + */ +function updateViewOnPan(controllerHost, dx, dy) { + var target = controllerHost.target; + var pos = target.position; + pos[0] += dx; + pos[1] += dy; + target.dirty(); +} + +/** + * For geo and graph. + * + * @param {Object} controllerHost + * @param {module:zrender/Element} controllerHost.target + * @param {number} controllerHost.zoom + * @param {number} controllerHost.zoomLimit like: {min: 1, max: 2} + */ +function updateViewOnZoom(controllerHost, zoomDelta, zoomX, zoomY) { + var target = controllerHost.target; + var zoomLimit = controllerHost.zoomLimit; + var pos = target.position; + var scale = target.scale; + + var newZoom = controllerHost.zoom = controllerHost.zoom || 1; + newZoom *= zoomDelta; + if (zoomLimit) { + var zoomMin = zoomLimit.min || 0; + var zoomMax = zoomLimit.max || Infinity; + newZoom = Math.max( + Math.min(zoomMax, newZoom), + zoomMin + ); + } + var zoomScale = newZoom / controllerHost.zoom; + controllerHost.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(); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 IRRELEVANT_EXCLUDES = {'axisPointer': 1, 'tooltip': 1, 'brush': 1}; + +/** + * Avoid that: mouse click on a elements that is over geo or graph, + * but roam is triggered. + */ +function onIrrelevantElement(e, api, targetCoordSysModel) { + var model = api.getComponentByElement(e.topTarget); + // If model is axisModel, it works only if it is injected with coordinateSystem. + var coordSys = model && model.coordinateSystem; + return model + && model !== targetCoordSysModel + && !IRRELEVANT_EXCLUDES[model.mainType] + && (coordSys && coordSys.model !== targetCoordSysModel); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 getFixedItemStyle(model, scale) { + var itemStyle = model.getItemStyle(); + var areaColor = model.get('areaColor'); + + // If user want the color not to be changed when hover, + // they should both set areaColor and color to be null. + if (areaColor != null) { + itemStyle.fill = areaColor; + } + + return itemStyle; +} + +function updateMapSelectHandler(mapDraw, mapOrGeoModel, regionsGroup, api, fromView) { + regionsGroup.off('click'); + regionsGroup.off('mousedown'); + + if (mapOrGeoModel.get('selectedMode')) { + + regionsGroup.on('mousedown', function () { + mapDraw._mouseDownFlag = true; + }); + + regionsGroup.on('click', function (e) { + if (!mapDraw._mouseDownFlag) { + return; + } + mapDraw._mouseDownFlag = false; + + var el = e.target; + while (!el.__regions) { + el = el.parent; + } + if (!el) { + return; + } + + var action = { + type: (mapOrGeoModel.mainType === 'geo' ? 'geo' : 'map') + 'ToggleSelect', + batch: map(el.__regions, function (region) { + return { + name: region.name, + from: fromView.uid + }; + }) + }; + action[mapOrGeoModel.mainType + 'Id'] = mapOrGeoModel.id; + + api.dispatchAction(action); + + updateMapSelected(mapOrGeoModel, regionsGroup); + }); + } +} + +function updateMapSelected(mapOrGeoModel, regionsGroup) { + // FIXME + regionsGroup.eachChild(function (otherRegionEl) { + each$1(otherRegionEl.__regions, function (region) { + otherRegionEl.trigger(mapOrGeoModel.isSelected(region.name) ? 'emphasis' : 'normal'); + }); + }); +} + +/** + * @alias module:echarts/component/helper/MapDraw + * @param {module:echarts/ExtensionAPI} api + * @param {boolean} updateGroup + */ +function MapDraw(api, updateGroup) { + + var group = new Group(); + + /** + * @type {string} + * @private + */ + this.uid = getUID('ec_map_draw'); + + /** + * @type {module:echarts/component/helper/RoamController} + * @private + */ + this._controller = new RoamController(api.getZr()); + + /** + * @type {Object} {target, zoom, zoomLimit} + * @private + */ + this._controllerHost = {target: updateGroup ? group : null}; + + /** + * @type {module:zrender/container/Group} + * @readOnly + */ + this.group = group; + + /** + * @type {boolean} + * @private + */ + this._updateGroup = updateGroup; + + /** + * This flag is used to make sure that only one among + * `pan`, `zoom`, `click` can occurs, otherwise 'selected' + * action may be triggered when `pan`, which is unexpected. + * @type {booelan} + */ + this._mouseDownFlag; + + /** + * @type {string} + */ + this._mapName; + + /** + * @type {boolean} + */ + this._initialized; + + /** + * @type {module:zrender/container/Group} + */ + group.add(this._regionsGroup = new Group()); + + /** + * @type {module:zrender/container/Group} + */ + group.add(this._backgroundGroup = new Group()); +} + +MapDraw.prototype = { + + constructor: MapDraw, + + draw: function (mapOrGeoModel, ecModel, api, fromView, payload) { + + var isGeo = mapOrGeoModel.mainType === 'geo'; + + // Map series has data. GEO model that controlled by map series + // will be assigned with map data. Other GEO model has no data. + var data = mapOrGeoModel.getData && mapOrGeoModel.getData(); + isGeo && ecModel.eachComponent({mainType: 'series', subType: 'map'}, function (mapSeries) { + if (!data && mapSeries.getHostGeoModel() === mapOrGeoModel) { + data = mapSeries.getData(); + } + }); + + var geo = mapOrGeoModel.coordinateSystem; + + this._updateBackground(geo); + + var regionsGroup = this._regionsGroup; + var group = this.group; + + var scale = geo.scale; + var transform = { + position: geo.position, + scale: scale + }; + + // No animation when first draw or in action + if (!regionsGroup.childAt(0) || payload) { + group.attr(transform); + } + else { + updateProps(group, transform, mapOrGeoModel); + } + + regionsGroup.removeAll(); + + var itemStyleAccessPath = ['itemStyle']; + var hoverItemStyleAccessPath = ['emphasis', 'itemStyle']; + var labelAccessPath = ['label']; + var hoverLabelAccessPath = ['emphasis', 'label']; + var nameMap = createHashMap(); + + each$1(geo.regions, function (region) { + + // Consider in GeoJson properties.name may be duplicated, for example, + // there is multiple region named "United Kindom" or "France" (so many + // colonies). And it is not appropriate to merge them in geo, which + // will make them share the same label and bring trouble in label + // location calculation. + var regionGroup = nameMap.get(region.name) + || nameMap.set(region.name, new Group()); + + var compoundPath = new CompoundPath({ + shape: { + paths: [] + } + }); + regionGroup.add(compoundPath); + + var regionModel = mapOrGeoModel.getRegionModel(region.name) || mapOrGeoModel; + + var itemStyleModel = regionModel.getModel(itemStyleAccessPath); + var hoverItemStyleModel = regionModel.getModel(hoverItemStyleAccessPath); + var itemStyle = getFixedItemStyle(itemStyleModel, scale); + var hoverItemStyle = getFixedItemStyle(hoverItemStyleModel, scale); + + var labelModel = regionModel.getModel(labelAccessPath); + var hoverLabelModel = regionModel.getModel(hoverLabelAccessPath); + + var dataIdx; + // Use the itemStyle in data if has data + if (data) { + dataIdx = data.indexOfName(region.name); + // 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); + if (visualColor) { + itemStyle.fill = visualColor; + } + } + + each$1(region.geometries, function (geometry) { + if (geometry.type !== 'polygon') { + return; + } + compoundPath.shape.paths.push(new Polygon({ + shape: { + points: geometry.exterior + } + })); + + for (var i = 0; i < (geometry.interiors ? geometry.interiors.length : 0); i++) { + compoundPath.shape.paths.push(new Polygon({ + shape: { + points: geometry.interiors[i] + } + })); + } + }); + + compoundPath.setStyle(itemStyle); + compoundPath.style.strokeNoScale = true; + compoundPath.culling = true; + // Label + var showLabel = labelModel.get('show'); + var hoverShowLabel = hoverLabelModel.get('show'); + + var isDataNaN = data && isNaN(data.get(data.mapDimension('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 ( + (isGeo || isDataNaN && (showLabel || hoverShowLabel)) + || (itemLayout && itemLayout.showLabel) + ) { + var query = !isGeo ? dataIdx : region.name; + var labelFetcher; + + // Consider dataIdx not found. + if (!data || dataIdx >= 0) { + labelFetcher = mapOrGeoModel; + } + + var textEl = new Text({ + position: region.center.slice(), + scale: [1 / scale[0], 1 / scale[1]], + z2: 10, + silent: true + }); + + setLabelStyle( + textEl.style, textEl.hoverStyle = {}, labelModel, hoverLabelModel, + { + labelFetcher: labelFetcher, + labelDataIndex: query, + defaultText: region.name, + useInsideStyle: false + }, + { + textAlign: 'center', + textVerticalAlign: 'middle' + } + ); + + regionGroup.add(textEl); + } + + // setItemGraphicEl, setHoverStyle after all polygons and labels + // are added to the rigionGroup + if (data) { + data.setItemGraphicEl(dataIdx, regionGroup); + } + else { + var regionModel = mapOrGeoModel.getRegionModel(region.name); + // Package custom mouse event for geo component + compoundPath.eventData = { + componentType: 'geo', + geoIndex: mapOrGeoModel.componentIndex, + name: region.name, + region: (regionModel && regionModel.option) || {} + }; + } + + var groupRegions = regionGroup.__regions || (regionGroup.__regions = []); + groupRegions.push(region); + + setHoverStyle( + regionGroup, + hoverItemStyle, + {hoverSilentOnTouch: !!mapOrGeoModel.get('selectedMode')} + ); + + regionsGroup.add(regionGroup); + }); + + this._updateController(mapOrGeoModel, ecModel, api); + + updateMapSelectHandler(this, mapOrGeoModel, regionsGroup, api, fromView); + + updateMapSelected(mapOrGeoModel, regionsGroup); + }, + + remove: function () { + this._regionsGroup.removeAll(); + this._backgroundGroup.removeAll(); + this._controller.dispose(); + this._mapName && geoSourceManager.removeGraphic(this._mapName, this.uid); + this._mapName = null; + this._controllerHost = {}; + }, + + _updateBackground: function (geo) { + var mapName = geo.map; + + if (this._mapName !== mapName) { + each$1(geoSourceManager.makeGraphic(mapName, this.uid), function (root) { + this._backgroundGroup.add(root); + }, this); + } + + this._mapName = mapName; + }, + + _updateController: function (mapOrGeoModel, ecModel, api) { + var geo = mapOrGeoModel.coordinateSystem; + var controller = this._controller; + var controllerHost = this._controllerHost; + + controllerHost.zoomLimit = mapOrGeoModel.get('scaleLimit'); + controllerHost.zoom = geo.getZoom(); + + // roamType is will be set default true if it is null + controller.enable(mapOrGeoModel.get('roam') || false); + var mainType = mapOrGeoModel.mainType; + + function makeActionBase() { + var action = { + type: 'geoRoam', + componentType: mainType + }; + action[mainType + 'Id'] = mapOrGeoModel.id; + return action; + } + + controller.off('pan').on('pan', function (e) { + this._mouseDownFlag = false; + + updateViewOnPan(controllerHost, e.dx, e.dy); + + api.dispatchAction(extend(makeActionBase(), { + dx: e.dx, + dy: e.dy + })); + }, this); + + controller.off('zoom').on('zoom', function (e) { + this._mouseDownFlag = false; + + updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); + + api.dispatchAction(extend(makeActionBase(), { + zoom: e.scale, + originX: e.originX, + originY: e.originY + })); + + if (this._updateGroup) { + var scale = this.group.scale; + this._regionsGroup.traverse(function (el) { + if (el.type === 'text') { + el.attr('scale', [1 / scale[0], 1 / scale[1]]); + } + }); + } + }, this); + + controller.setPointerChecker(function (e, x, y) { + return geo.getViewRectAfterRoam().contain(x, y) + && !onIrrelevantElement(e, api, mapOrGeoModel); + }); + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +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(); + + if (mapModel.getHostGeoModel()) { + return; + } + + // Not update map if it is an roam action from self + if (!(payload && payload.type === 'geoRoam' + && payload.componentType === 'series' + && payload.seriesId === mapModel.id + ) + ) { + if (mapModel.needsDrawMap) { + var mapDraw = this._mapDraw || new MapDraw(api, true); + group.add(mapDraw.group); + + mapDraw.draw(mapModel, ecModel, api, this, payload); + + 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(); + }, + + dispose: function () { + this._mapDraw && this._mapDraw.remove(); + this._mapDraw = null; + }, + + _renderSymbols: function (mapModel, ecModel, api) { + var originalData = mapModel.originalData; + var group = this.group; + + originalData.each(originalData.mapDimension('value'), function (value, idx) { + if (isNaN(value)) { + return; + } + + var layout = originalData.getItemLayout(idx); + + if (!layout || !layout.point) { + // Not exists in map + return; + } + + var point = layout.point; + var offset = layout.offset; + + var circle = new Circle({ + style: { + // Because the special of map draw. + // Which needs statistic of multiple series and draw on one map. + // And each series also need a symbol with legend color + // + // Layout and visual are put one the different data + fill: mapModel.getData().getVisual('color') + }, + shape: { + cx: point[0] + offset * 9, + cy: point[1], + r: 3 + }, + silent: true, + // Do not overlap the first series, on which labels are displayed. + z2: !offset ? 10 : 8 + }); + + // First data on the same region + if (!offset) { + var fullData = mapModel.mainSeries.getData(); + var name = originalData.getName(idx); + + var fullIndex = fullData.indexOfName(name); + + var itemModel = originalData.getItemModel(idx); + var labelModel = itemModel.getModel('label'); + var hoverLabelModel = itemModel.getModel('emphasis.label'); + + var polygonGroups = fullData.getItemGraphicEl(fullIndex); + + var normalText = retrieve2( + mapModel.getFormattedLabel(idx, 'normal'), + name + ); + var emphasisText = retrieve2( + mapModel.getFormattedLabel(idx, 'emphasis'), + normalText + ); + + var onEmphasis = function () { + var hoverStyle = setTextStyle({}, hoverLabelModel, { + text: hoverLabelModel.get('show') ? emphasisText : null + }, {isRectText: true, useInsideStyle: false}, true); + circle.style.extendFrom(hoverStyle); + // Make label upper than others if overlaps. + circle.__mapOriginalZ2 = circle.z2; + circle.z2 += 1; + }; + + var onNormal = function () { + setTextStyle(circle.style, labelModel, { + text: labelModel.get('show') ? normalText : null, + textPosition: labelModel.getShallow('position') || 'bottom' + }, {isRectText: true, useInsideStyle: false}); + + if (circle.__mapOriginalZ2 != null) { + circle.z2 = circle.__mapOriginalZ2; + circle.__mapOriginalZ2 = null; + } + }; + + polygonGroups.on('mouseover', onEmphasis) + .on('mouseout', onNormal) + .on('emphasis', onEmphasis) + .on('normal', onNormal); + + onNormal(); + } + + group.add(circle); + }); + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @param {module:echarts/coord/View} view + * @param {Object} payload + * @param {Object} [zoomLimit] + */ +function updateCenterAndZoom( + view, payload, zoomLimit +) { + var previousZoom = view.getZoom(); + var center = view.getCenter(); + var zoom = payload.zoom; + + var point = view.dataToPoint(center); + + if (payload.dx != null && payload.dy != null) { + point[0] -= payload.dx; + point[1] -= payload.dy; + + var center = view.pointToData(point); + view.setCenter(center); + } + if (zoom != null) { + if (zoomLimit) { + var zoomMin = zoomLimit.min || 0; + var zoomMax = zoomLimit.max || Infinity; + zoom = Math.max( + Math.min(previousZoom * zoom, zoomMax), + zoomMin + ) / previousZoom; + } + + // Zoom on given point(originX, originY) + view.scale[0] *= zoom; + view.scale[1] *= zoom; + var position = view.position; + var fixX = (payload.originX - position[0]) * (zoom - 1); + var fixY = (payload.originY - position[1]) * (zoom - 1); + + position[0] -= fixX; + position[1] -= fixY; + + view.updateTransform(); + // Get the new center + var center = view.pointToData(point); + view.setCenter(center); + view.setZoom(zoom * previousZoom); + } + + return { + center: view.getCenter(), + zoom: view.getZoom() + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @payload + * @property {string} [componentType=series] + * @property {number} [dx] + * @property {number} [dy] + * @property {number} [zoom] + * @property {number} [originX] + * @property {number} [originY] + */ +registerAction({ + type: 'geoRoam', + event: 'geoRoam', + update: 'updateTransform' +}, function (payload, ecModel) { + var componentType = payload.componentType || 'series'; + + ecModel.eachComponent( + { mainType: componentType, query: payload }, + function (componentModel) { + var geo = componentModel.coordinateSystem; + if (geo.type !== 'geo') { + return; + } + + var res = updateCenterAndZoom( + geo, payload, componentModel.get('scaleLimit') + ); + + componentModel.setCenter + && componentModel.setCenter(res.center); + + componentModel.setZoom + && componentModel.setZoom(res.zoom); + + // All map series with same `map` use the same geo coordinate system + // So the center and zoom must be in sync. Include the series not selected by legend + if (componentType === 'series') { + each$1(componentModel.seriesGroup, function (seriesModel) { + seriesModel.setCenter(res.center); + seriesModel.setZoom(res.zoom); + }); + } + } + ); +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 mapSymbolLayout = function (ecModel) { + + var processedMapType = {}; + + ecModel.eachSeriesByType('map', function (mapSeries) { + var mapType = mapSeries.getMapType(); + if (mapSeries.getHostGeoModel() || processedMapType[mapType]) { + return; + } + + var mapSymbolOffsets = {}; + + each$1(mapSeries.seriesGroup, function (subMapSeries) { + var geo = subMapSeries.coordinateSystem; + var data = subMapSeries.originalData; + if (subMapSeries.get('showLegendSymbol') && ecModel.getComponent('legend')) { + data.each(data.mapDimension('value'), function (value, idx) { + var name = data.getName(idx); + var region = geo.getRegion(name); + + // If input series.data is [11, 22, '-'/null/undefined, 44], + // it will be filled with NaN: [11, 22, NaN, 44] and NaN will + // not be drawn. 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; + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 mapVisual = function (ecModel) { + ecModel.eachSeriesByType('map', function (seriesModel) { + var colorList = seriesModel.get('color'); + var itemStyleModel = seriesModel.getModel('itemStyle'); + + var areaColor = itemStyleModel.get('areaColor'); + var color = itemStyleModel.get('color') + || colorList[seriesModel.seriesIndex % colorList.length]; + + seriesModel.getData().setVisual({ + 'areaColor': areaColor, + 'color': color + }); + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// FIXME 公用? +/** + * @param {Array.} datas + * @param {string} statisticType 'average' 'sum' + * @inner + */ +function dataStatistics(datas, statisticType) { + var dataNameMap = {}; + + each$1(datas, function (data) { + data.each(data.mapDimension('value'), function (value, idx) { + // Add prefix to avoid conflict with Object.prototype. + var mapKey = 'ec-' + data.getName(idx); + dataNameMap[mapKey] = dataNameMap[mapKey] || []; + if (!isNaN(value)) { + dataNameMap[mapKey].push(value); + } + }); + }); + + return datas[0].map(datas[0].mapDimension('value'), function (value, idx) { + var mapKey = 'ec-' + datas[0].getName(idx); + var sum = 0; + var min = Infinity; + var max = -Infinity; + var len = dataNameMap[mapKey].length; + for (var i = 0; i < len; i++) { + min = Math.min(min, dataNameMap[mapKey][i]); + max = Math.max(max, dataNameMap[mapKey][i]); + sum += dataNameMap[mapKey][i]; + } + var result; + if (statisticType === 'min') { + result = min; + } + else if (statisticType === 'max') { + result = max; + } + else if (statisticType === 'average') { + result = sum / len; + } + else { + result = sum; + } + return len === 0 ? NaN : result; + }); +} + +var mapDataStatistic = function (ecModel) { + var seriesGroups = {}; + ecModel.eachSeriesByType('map', function (seriesModel) { + var hostGeoModel = seriesModel.getHostGeoModel(); + var key = hostGeoModel ? 'o' + hostGeoModel.id : 'i' + seriesModel.getMapType(); + (seriesGroups[key] = seriesGroups[key] || []).push(seriesModel); + }); + + each$1(seriesGroups, function (seriesList, key) { + var data = dataStatistics( + map(seriesList, function (seriesModel) { + return seriesModel.getData(); + }), + seriesList[0].get('mapValueCalculation') + ); + + for (var i = 0; i < seriesList.length; i++) { + seriesList[i].originalData = seriesList[i].getData(); + } + + // FIXME Put where? + for (var i = 0; i < seriesList.length; i++) { + seriesList[i].seriesGroup = seriesList; + seriesList[i].needsDrawMap = i === 0 && !seriesList[i].getHostGeoModel(); + + seriesList[i].setData(data.cloneShallow()); + seriesList[i].mainSeries = seriesList[0]; + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 backwardCompat$2 = function (option) { + // Save geoCoord + var mapSeries = []; + each$1(option.series, function (seriesOpt) { + if (seriesOpt && seriesOpt.type === 'map') { + mapSeries.push(seriesOpt); + seriesOpt.map = seriesOpt.map || seriesOpt.mapType; + // Put x, y, width, height, x2, y2 in the top level + defaults(seriesOpt, seriesOpt.mapLocation); + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerLayout(mapSymbolLayout); +registerVisual(mapVisual); +registerProcessor(PRIORITY.PROCESSOR.STATISTIC, mapDataStatistic); +registerPreprocessor(backwardCompat$2); + +createDataSelectAction('map', [{ + type: 'mapToggleSelect', + event: 'mapselectchanged', + method: 'toggleSelected' +}, { + type: 'mapSelect', + event: 'mapselected', + method: 'select' +}, { + type: 'mapUnSelect', + event: 'mapunselected', + method: 'unSelect' +}]); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Link lists and struct (graph or tree) + */ + +var each$7 = each$1; + +var DATAS = '\0__link_datas'; +var MAIN_DATA = '\0__link_mainData'; + +// Caution: +// In most case, either list or its shallow clones (see list.cloneShallow) +// is active in echarts process. So 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. + +/** + * @param {Object} opt + * @param {module:echarts/data/List} opt.mainData + * @param {Object} [opt.struct] For example, instance of Graph or Tree. + * @param {string} [opt.structAttr] designation: list[structAttr] = struct; + * @param {Object} [opt.datas] {dataType: data}, + * like: {node: nodeList, edge: edgeList}. + * Should contain mainData. + * @param {Object} [opt.datasAttr] {dataType: attr}, + * designation: struct[datasAttr[dataType]] = list; + */ +function linkList(opt) { + var mainData = opt.mainData; + var datas = opt.datas; + + if (!datas) { + datas = {main: mainData}; + opt.datasAttr = {main: 'data'}; + } + opt.datas = opt.mainData = null; + + linkAll(mainData, datas, opt); + + // Porxy data original methods. + each$7(datas, function (data) { + each$7(mainData.TRANSFERABLE_METHODS, function (methodName) { + data.wrapMethod(methodName, curry(transferInjection, opt)); + }); + + }); + + // Beyond transfer, additional features should be added to `cloneShallow`. + mainData.wrapMethod('cloneShallow', curry(cloneShallowInjection, opt)); + + // Only mainData trigger change, because struct.update may trigger + // another changable methods, which may bring about dead lock. + each$7(mainData.CHANGABLE_METHODS, function (methodName) { + mainData.wrapMethod(methodName, curry(changeInjection, opt)); + }); + + // Make sure datas contains mainData. + assert$1(datas[mainData.dataType] === mainData); +} + +function transferInjection(opt, res) { + if (isMainData(this)) { + // Transfer datas to new main data. + var datas = extend({}, this[DATAS]); + datas[this.dataType] = res; + linkAll(res, datas, opt); + } + else { + // Modify the reference in main data to point newData. + linkSingle(res, this.dataType, this[MAIN_DATA], opt); + } + return res; +} + +function changeInjection(opt, res) { + opt.struct && opt.struct.update(this); + return res; +} + +function cloneShallowInjection(opt, res) { + // cloneShallow, which brings about some fragilities, may be inappropriate + // to be exposed as an API. So for implementation simplicity we can make + // the restriction that cloneShallow of not-mainData should not be invoked + // outside, but only be invoked here. + each$7(res[DATAS], function (data, dataType) { + data !== res && linkSingle(data.cloneShallow(), dataType, res, opt); + }); + return res; +} + +/** + * Supplement method to List. + * + * @public + * @param {string} [dataType] If not specified, return mainData. + * @return {module:echarts/data/List} + */ +function getLinkedData(dataType) { + var mainData = this[MAIN_DATA]; + return (dataType == null || mainData == null) + ? mainData + : mainData[DATAS][dataType]; +} + +function isMainData(data) { + return data[MAIN_DATA] === data; +} + +function linkAll(mainData, datas, opt) { + mainData[DATAS] = {}; + each$7(datas, function (data, dataType) { + linkSingle(data, dataType, mainData, opt); + }); +} + +function linkSingle(data, dataType, mainData, opt) { + mainData[DATAS][dataType] = data; + data[MAIN_DATA] = mainData; + data.dataType = dataType; + + if (opt.struct) { + data[opt.structAttr] = opt.struct; + opt.struct[opt.datasAttr[dataType]] = data; + } + + // Supplement method. + data.getLinkedData = getLinkedData; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Tree data structure + * + * @module echarts/data/Tree + */ + +/** + * @constructor module:echarts/data/Tree~TreeNode + * @param {string} name + * @param {module:echarts/data/Tree} hostTree + */ +var TreeNode = function (name, 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 = -1; + + /** + * @type {Array.} + * @readOnly + */ + this.children = []; + + /** + * @type {Array.} + * @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 (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.} 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$$1) { + this.dataIndex >= 0 + && this.hostTree.data.setItemLayout(this.dataIndex, layout, merge$$1); + }, + + /** + * @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(); + var leavesModel; + if (!levelModel && (this.children.length === 0 || (this.children.length !== 0 && this.isExpand === false))) { + leavesModel = this.getLeavesModel(); + } + return itemModel.getModel(path, (levelModel || leavesModel || hostTree.hostModel).getModel(path)); + }, + + /** + * @return {module:echarts/model/Model} + */ + getLevelModel: function () { + return (this.hostTree.levelModels || [])[this.depth]; + }, + + /** + * @return {module:echarts/model/Model} + */ + getLeavesModel: function () { + return this.hostTree.leavesModel; + }, + + /** + * @example + * setItemVisual('color', color); + * setItemVisual({ + * 'color': color + * }); + */ + setVisual: function (key, value) { + this.dataIndex >= 0 + && this.hostTree.data.setItemVisual(this.dataIndex, key, value); + }, + + /** + * Get item visual + */ + 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); + }, + + /** + * if this is an ancestor of another node + * + * @public + * @param {TreeNode} node another node + * @return {boolean} if is ancestor + */ + isAncestorOf: function (node) { + var parent = node.parentNode; + while (parent) { + if (parent === this) { + return true; + } + parent = parent.parentNode; + } + return false; + }, + + /** + * if this is an descendant of another node + * + * @public + * @param {TreeNode} node another node + * @return {boolean} if is descendant + */ + isDescendantOf: function (node) { + return node !== this && node.isAncestorOf(this); + } +}; + +/** + * @constructor + * @alias module:echarts/data/Tree + * @param {module:echarts/model/Model} hostModel + * @param {Array.} levelOptions + * @param {Object} leavesOption + */ +function Tree(hostModel, levelOptions, leavesOption) { + /** + * @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.} treeOptions.levels + * @param {Array.} treeOptions.leaves + * @return module:echarts/data/Tree + */ +Tree.createTree = function (dataRoot, hostModel, treeOptions) { + + var tree = new Tree(hostModel, treeOptions.levels, treeOptions.leaves); + var listData = []; + var dimMax = 1; + + buildHierarchy(dataRoot); + + function buildHierarchy(dataNode, parentNode) { + var value = dataNode.value; + dimMax = Math.max(dimMax, isArray(value) ? value.length : 1); + + listData.push(dataNode); + + var node = new TreeNode(dataNode.name, tree); + parentNode + ? addChild(node, parentNode) + : (tree.root = node); + + tree._nodes.push(node); + + var children = dataNode.children; + if (children) { + for (var i = 0; i < children.length; i++) { + buildHierarchy(children[i], node); + } + } + } + + tree.root.updateDepthAndHeight(0); + + var dimensionsInfo = createDimensions(listData, { + coordDimensions: ['value'], + dimensionsCount: dimMax + }); + + var list = new List(dimensionsInfo, hostModel); + list.initData(listData); + + linkList({ + mainData: list, + struct: tree, + structAttr: 'tree' + }); + + tree.update(); + + 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; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Create data struct and define tree view's series model + * @author Deqing Li(annong035@gmail.com) + */ + +SeriesModel.extend({ + + type: 'series.tree', + + layoutInfo: null, + + // can support the position parameters 'left', 'top','right','bottom', 'width', + // 'height' in the setOption() with 'merge' mode normal. + layoutMode: 'box', + + /** + * Init a tree data structure from data in option series + * @param {Object} option the object used to config echarts view + * @return {module:echarts/data/List} storage initial data + */ + getInitialData: function (option) { + + //create an virtual root + var root = {name: option.name, children: option.data}; + + var leaves = option.leaves || {}; + + var treeOption = {}; + + treeOption.leaves = leaves; + + var tree = Tree.createTree(root, this, treeOption); + + var treeDepth = 0; + + tree.eachNode('preorder', function (node) { + if (node.depth > treeDepth) { + treeDepth = node.depth; + } + }); + + var expandAndCollapse = option.expandAndCollapse; + var expandTreeDepth = (expandAndCollapse && option.initialTreeDepth >= 0) + ? option.initialTreeDepth : treeDepth; + + tree.root.eachNode('preorder', function (node) { + var item = node.hostTree.data.getRawDataItem(node.dataIndex); + // Add item.collapsed != null, because users can collapse node original in the series.data. + node.isExpand = (item && item.collapsed != null) + ? !item.collapsed + : node.depth <= expandTreeDepth; + }); + + return tree.data; + }, + + /** + * Make the configuration 'orient' backward compatibly, with 'horizontal = LR', 'vertical = TB'. + * @returns {string} orient + */ + getOrient: function () { + var orient = this.get('orient'); + if (orient === 'horizontal') { + orient = 'LR'; + } + else if (orient === 'vertical') { + orient = 'TB'; + } + return orient; + }, + + setZoom: function (zoom) { + this.option.zoom = zoom; + }, + + setCenter: function (center) { + this.option.center = center; + }, + + /** + * @override + * @param {number} dataIndex + */ + formatTooltip: function (dataIndex) { + var tree = this.getData().tree; + var realRoot = tree.root.children[0]; + var node = tree.getNodeByDataIndex(dataIndex); + var value = node.getValue(); + var name = node.name; + while (node && (node !== realRoot)) { + name = node.parentNode.name + '.' + name; + node = node.parentNode; + } + return encodeHTML(name + ( + (isNaN(value) || value == null) ? '' : ' : ' + value + )); + }, + + defaultOption: { + zlevel: 0, + z: 2, + coordinateSystem: 'view', + + // the position of the whole view + left: '12%', + top: '12%', + right: '12%', + bottom: '12%', + + // the layout of the tree, two value can be selected, 'orthogonal' or 'radial' + layout: 'orthogonal', + + roam: false, + // Symbol size scale ratio in roam + nodeScaleRatio: 0.4, + + // Default on center of graph + center: null, + + zoom: 1, + + // The orient of orthoginal layout, can be setted to 'LR', 'TB', 'RL', 'BT'. + // and the backward compatibility configuration 'horizontal = LR', 'vertical = TB'. + orient: 'LR', + + symbol: 'emptyCircle', + + symbolSize: 7, + + expandAndCollapse: true, + + initialTreeDepth: 2, + + lineStyle: { + color: '#ccc', + width: 1.5, + curveness: 0.5 + }, + + itemStyle: { + color: 'lightsteelblue', + borderColor: '#c23531', + borderWidth: 1.5 + }, + + label: { + show: true, + color: '#555' + }, + + leaves: { + label: { + show: true + } + }, + + animationEasing: 'linear', + + animationDuration: 700, + + animationDurationUpdate: 1000 + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* The tree layout implementation references to d3.js +* (https://github.com/d3/d3-hierarchy). The use of the source +* code of this file is also subject to the terms and consitions +* of its license (BSD-3Clause, see ). +*/ + +/** + * @file The layout algorithm of node-link tree diagrams. Here we using Reingold-Tilford algorithm to drawing + * the tree. + * @see https://github.com/d3/d3-hierarchy + */ + +/** + * Initialize all computational message for following algorithm + * @param {module:echarts/data/Tree~TreeNode} root The virtual root of the tree + */ +function init$2(root) { + root.hierNode = { + defaultAncestor: null, + ancestor: root, + prelim: 0, + modifier: 0, + change: 0, + shift: 0, + i: 0, + thread: null + }; + + var nodes = [root]; + var node; + var children; + + while (node = nodes.pop()) { // jshint ignore:line + children = node.children; + if (node.isExpand && children.length) { + var n = children.length; + for (var i = n - 1; i >= 0; i--) { + var child = children[i]; + child.hierNode = { + defaultAncestor: null, + ancestor: child, + prelim: 0, + modifier: 0, + change: 0, + shift: 0, + i: i, + thread: null + }; + nodes.push(child); + } + } + } +} + +/** + * Computes a preliminary x coordinate for node. Before that, this function is + * applied recursively to the children of node, as well as the function + * apportion(). After spacing out the children by calling executeShifts(), the + * node is placed to the midpoint of its outermost children. + * @param {module:echarts/data/Tree~TreeNode} node + * @param {Function} separation + */ +function firstWalk(node, separation) { + var children = node.isExpand ? node.children : []; + var siblings = node.parentNode.children; + var subtreeW = node.hierNode.i ? siblings[node.hierNode.i -1] : null; + if (children.length) { + executeShifts(node); + var midPoint = (children[0].hierNode.prelim + children[children.length - 1].hierNode.prelim) / 2; + if (subtreeW) { + node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); + node.hierNode.modifier = node.hierNode.prelim - midPoint; + } + else { + node.hierNode.prelim = midPoint; + } + } + else if (subtreeW) { + node.hierNode.prelim = subtreeW.hierNode.prelim + separation(node, subtreeW); + } + node.parentNode.hierNode.defaultAncestor = apportion(node, subtreeW, node.parentNode.hierNode.defaultAncestor || siblings[0], separation); +} + + +/** + * Computes all real x-coordinates by summing up the modifiers recursively. + * @param {module:echarts/data/Tree~TreeNode} node + */ +function secondWalk(node) { + var nodeX = node.hierNode.prelim + node.parentNode.hierNode.modifier; + node.setLayout({x: nodeX}, true); + node.hierNode.modifier += node.parentNode.hierNode.modifier; +} + + +function separation(cb) { + return arguments.length ? cb : defaultSeparation; +} + +/** + * Transform the common coordinate to radial coordinate + * @param {number} x + * @param {number} y + * @return {Object} + */ +function radialCoordinate(x, y) { + var radialCoor = {}; + x -= Math.PI / 2; + radialCoor.x = y * Math.cos(x); + radialCoor.y = y * Math.sin(x); + return radialCoor; +} + +/** + * Get the layout position of the whole view + * @param {module:echarts/model/Series} seriesModel the model object of sankey series + * @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call + * @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view + */ +function getViewRect(seriesModel, api) { + return getLayoutRect( + seriesModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + } + ); +} + +/** + * All other shifts, applied to the smaller subtrees between w- and w+, are + * performed by this function. + * @param {module:echarts/data/Tree~TreeNode} node + */ +function executeShifts(node) { + var children = node.children; + var n = children.length; + var shift = 0; + var change = 0; + while (--n >= 0) { + var child = children[n]; + child.hierNode.prelim += shift; + child.hierNode.modifier += shift; + change += child.hierNode.change; + shift += child.hierNode.shift + change; + } +} + +/** + * The core of the algorithm. Here, a new subtree is combined with the + * previous subtrees. Threads are used to traverse the inside and outside + * contours of the left and right subtree up to the highest common level. + * Whenever two nodes of the inside contours conflict, we compute the left + * one of the greatest uncommon ancestors using the function nextAncestor() + * and call moveSubtree() to shift the subtree and prepare the shifts of + * smaller subtrees. Finally, we add a new thread (if necessary). + * @param {module:echarts/data/Tree~TreeNode} subtreeV + * @param {module:echarts/data/Tree~TreeNode} subtreeW + * @param {module:echarts/data/Tree~TreeNode} ancestor + * @param {Function} separation + * @return {module:echarts/data/Tree~TreeNode} + */ +function apportion(subtreeV, subtreeW, ancestor, separation) { + + if (subtreeW) { + var nodeOutRight = subtreeV; + var nodeInRight = subtreeV; + var nodeOutLeft = nodeInRight.parentNode.children[0]; + var nodeInLeft = subtreeW; + + var sumOutRight = nodeOutRight.hierNode.modifier; + var sumInRight = nodeInRight.hierNode.modifier; + var sumOutLeft = nodeOutLeft.hierNode.modifier; + var sumInLeft = nodeInLeft.hierNode.modifier; + + while (nodeInLeft = nextRight(nodeInLeft), nodeInRight = nextLeft(nodeInRight), nodeInLeft && nodeInRight) { + nodeOutRight = nextRight(nodeOutRight); + nodeOutLeft = nextLeft(nodeOutLeft); + nodeOutRight.hierNode.ancestor = subtreeV; + var shift = nodeInLeft.hierNode.prelim + sumInLeft - nodeInRight.hierNode.prelim + - sumInRight + separation(nodeInLeft, nodeInRight); + if (shift > 0) { + moveSubtree(nextAncestor(nodeInLeft, subtreeV, ancestor), subtreeV, shift); + sumInRight += shift; + sumOutRight += shift; + } + sumInLeft += nodeInLeft.hierNode.modifier; + sumInRight += nodeInRight.hierNode.modifier; + sumOutRight += nodeOutRight.hierNode.modifier; + sumOutLeft += nodeOutLeft.hierNode.modifier; + } + if (nodeInLeft && !nextRight(nodeOutRight)) { + nodeOutRight.hierNode.thread = nodeInLeft; + nodeOutRight.hierNode.modifier += sumInLeft - sumOutRight; + + } + if (nodeInRight && !nextLeft(nodeOutLeft)) { + nodeOutLeft.hierNode.thread = nodeInRight; + nodeOutLeft.hierNode.modifier += sumInRight - sumOutLeft; + ancestor = subtreeV; + } + } + return ancestor; +} + +/** + * This function is used to traverse the right contour of a subtree. + * It returns the rightmost child of node or the thread of node. The function + * returns null if and only if node is on the highest depth of its subtree. + * @param {module:echarts/data/Tree~TreeNode} node + * @return {module:echarts/data/Tree~TreeNode} + */ +function nextRight(node) { + var children = node.children; + return children.length && node.isExpand ? children[children.length - 1] : node.hierNode.thread; +} + +/** + * This function is used to traverse the left contour of a subtree (or a subforest). + * It returns the leftmost child of node or the thread of node. The function + * returns null if and only if node is on the highest depth of its subtree. + * @param {module:echarts/data/Tree~TreeNode} node + * @return {module:echarts/data/Tree~TreeNode} + */ +function nextLeft(node) { + var children = node.children; + return children.length && node.isExpand ? children[0] : node.hierNode.thread; +} + +/** + * If nodeInLeft’s ancestor is a sibling of node, returns nodeInLeft’s ancestor. + * Otherwise, returns the specified ancestor. + * @param {module:echarts/data/Tree~TreeNode} nodeInLeft + * @param {module:echarts/data/Tree~TreeNode} node + * @param {module:echarts/data/Tree~TreeNode} ancestor + * @return {module:echarts/data/Tree~TreeNode} + */ +function nextAncestor(nodeInLeft, node, ancestor) { + return nodeInLeft.hierNode.ancestor.parentNode === node.parentNode + ? nodeInLeft.hierNode.ancestor : ancestor; +} + +/** + * Shifts the current subtree rooted at wr. This is done by increasing prelim(w+) and modifier(w+) by shift. + * @param {module:echarts/data/Tree~TreeNode} wl + * @param {module:echarts/data/Tree~TreeNode} wr + * @param {number} shift [description] + */ +function moveSubtree(wl, wr, shift) { + var change = shift / (wr.hierNode.i - wl.hierNode.i); + wr.hierNode.change -= change; + wr.hierNode.shift += shift; + wr.hierNode.modifier += shift; + wr.hierNode.prelim += shift; + wl.hierNode.change += change; +} + +function defaultSeparation(node1, node2) { + return node1.parentNode === node2.parentNode ? 1 : 2; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file This file used to draw tree view. + * @author Deqing Li(annong035@gmail.com) + */ + +extendChartView({ + + type: 'tree', + + /** + * Init the chart + * @override + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + */ + init: function (ecModel, api) { + + /** + * @private + * @type {module:echarts/data/Tree} + */ + this._oldTree; + + /** + * @private + * @type {module:zrender/container/Group} + */ + this._mainGroup = new Group(); + + /** + * @private + * @type {module:echarts/componet/helper/RoamController} + */ + this._controller = new RoamController(api.getZr()); + + this._controllerHost = {target: this.group}; + + this.group.add(this._mainGroup); + }, + + render: function (seriesModel, ecModel, api, payload) { + var data = seriesModel.getData(); + + var layoutInfo = seriesModel.layoutInfo; + + var group = this._mainGroup; + + var layout = seriesModel.get('layout'); + + if (layout === 'radial') { + group.attr('position', [layoutInfo.x + layoutInfo.width / 2, layoutInfo.y + layoutInfo.height / 2]); + } + else { + group.attr('position', [layoutInfo.x, layoutInfo.y]); + } + + this._updateViewCoordSys(seriesModel); + this._updateController(seriesModel, ecModel, api); + + var oldData = this._data; + + var seriesScope = { + expandAndCollapse: seriesModel.get('expandAndCollapse'), + layout: layout, + orient: seriesModel.getOrient(), + curvature: seriesModel.get('lineStyle.curveness'), + symbolRotate: seriesModel.get('symbolRotate'), + symbolOffset: seriesModel.get('symbolOffset'), + hoverAnimation: seriesModel.get('hoverAnimation'), + useNameLabel: true, + fadeIn: true + }; + + data.diff(oldData) + .add(function (newIdx) { + if (symbolNeedsDraw$1(data, newIdx)) { + // Create node and edge + updateNode(data, newIdx, null, group, seriesModel, seriesScope); + } + }) + .update(function (newIdx, oldIdx) { + var symbolEl = oldData.getItemGraphicEl(oldIdx); + if (!symbolNeedsDraw$1(data, newIdx)) { + symbolEl && removeNode(oldData, oldIdx, symbolEl, group, seriesModel, seriesScope); + return; + } + // Update node and edge + updateNode(data, newIdx, symbolEl, group, seriesModel, seriesScope); + }) + .remove(function (oldIdx) { + var symbolEl = oldData.getItemGraphicEl(oldIdx); + // When remove a collapsed node of subtree, since the collapsed + // node haven't been initialized with a symbol element, + // you can't found it's symbol element through index. + // so if we want to remove the symbol element we should insure + // that the symbol element is not null. + if (symbolEl) { + removeNode(oldData, oldIdx, symbolEl, group, seriesModel, seriesScope); + } + }) + .execute(); + + this._nodeScaleRatio = seriesModel.get('nodeScaleRatio'); + + this._updateNodeAndLinkScale(seriesModel); + + if (seriesScope.expandAndCollapse === true) { + data.eachItemGraphicEl(function (el, dataIndex) { + el.off('click').on('click', function () { + api.dispatchAction({ + type: 'treeExpandAndCollapse', + seriesId: seriesModel.id, + dataIndex: dataIndex + }); + }); + }); + } + this._data = data; + }, + + _updateViewCoordSys: function (seriesModel) { + var data = seriesModel.getData(); + var points = []; + data.each(function (idx) { + var layout = data.getItemLayout(idx); + if (layout && !isNaN(layout.x) && !isNaN(layout.y)) { + points.push([+layout.x, +layout.y]); + } + }); + var min = []; + var max = []; + fromPoints(points, min, max); + // If width or height is 0 + if (max[0] - min[0] === 0) { + max[0] += 1; + min[0] -= 1; + } + if (max[1] - min[1] === 0) { + max[1] += 1; + min[1] -= 1; + } + + var viewCoordSys = seriesModel.coordinateSystem = new View(); + viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); + + viewCoordSys.setBoundingRect(min[0], min[1], max[0] - min[0], max[1] - min[1]); + + viewCoordSys.setCenter(seriesModel.get('center')); + viewCoordSys.setZoom(seriesModel.get('zoom')); + + // Here we use viewCoordSys just for computing the 'position' and 'scale' of the group + this.group.attr({ + position: viewCoordSys.position, + scale: viewCoordSys.scale + }); + + this._viewCoordSys = viewCoordSys; + }, + + _updateController: function (seriesModel, ecModel, api) { + var controller = this._controller; + var controllerHost = this._controllerHost; + var group = this.group; + controller.setPointerChecker(function (e, x, y) { + var rect = group.getBoundingRect(); + rect.applyTransform(group.transform); + return rect.contain(x, y) + && !onIrrelevantElement(e, api, seriesModel); + }); + + controller.enable(seriesModel.get('roam')); + controllerHost.zoomLimit = seriesModel.get('scaleLimit'); + controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); + + controller + .off('pan') + .off('zoom') + .on('pan', function (e) { + updateViewOnPan(controllerHost, e.dx, e.dy); + api.dispatchAction({ + seriesId: seriesModel.id, + type: 'treeRoam', + dx: e.dx, + dy: e.dy + }); + }, this) + .on('zoom', function (e) { + updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); + api.dispatchAction({ + seriesId: seriesModel.id, + type: 'treeRoam', + zoom: e.scale, + originX: e.originX, + originY: e.originY + }); + this._updateNodeAndLinkScale(seriesModel); + }, this); + }, + + _updateNodeAndLinkScale: function (seriesModel) { + var data = seriesModel.getData(); + + var nodeScale = this._getNodeGlobalScale(seriesModel); + var invScale = [nodeScale, nodeScale]; + + data.eachItemGraphicEl(function (el, idx) { + el.attr('scale', invScale); + }); + }, + + _getNodeGlobalScale: function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + if (coordSys.type !== 'view') { + return 1; + } + + var nodeScaleRatio = this._nodeScaleRatio; + + var groupScale = coordSys.scale; + var groupZoom = (groupScale && groupScale[0]) || 1; + // Scale node when zoom changes + var roamZoom = coordSys.getZoom(); + var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; + + return nodeScale / groupZoom; + }, + + dispose: function () { + this._controller && this._controller.dispose(); + this._controllerHost = {}; + }, + + remove: function () { + this._mainGroup.removeAll(); + this._data = null; + } + +}); + +function symbolNeedsDraw$1(data, dataIndex) { + var layout = data.getItemLayout(dataIndex); + + return layout + && !isNaN(layout.x) && !isNaN(layout.y) + && data.getItemVisual(dataIndex, 'symbol') !== 'none'; +} + +function getTreeNodeStyle(node, itemModel, seriesScope) { + seriesScope.itemModel = itemModel; + seriesScope.itemStyle = itemModel.getModel('itemStyle').getItemStyle(); + seriesScope.hoverItemStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); + seriesScope.lineStyle = itemModel.getModel('lineStyle').getLineStyle(); + seriesScope.labelModel = itemModel.getModel('label'); + seriesScope.hoverLabelModel = itemModel.getModel('emphasis.label'); + + if (node.isExpand === false && node.children.length !== 0) { + seriesScope.symbolInnerColor = seriesScope.itemStyle.fill; + } + else { + seriesScope.symbolInnerColor = '#fff'; + } + + return seriesScope; +} + +function updateNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) { + var isInit = !symbolEl; + var node = data.tree.getNodeByDataIndex(dataIndex); + var itemModel = node.getModel(); + var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope); + var virtualRoot = data.tree.root; + + var source = node.parentNode === virtualRoot ? node : node.parentNode || node; + var sourceSymbolEl = data.getItemGraphicEl(source.dataIndex); + var sourceLayout = source.getLayout(); + var sourceOldLayout = sourceSymbolEl + ? { + x: sourceSymbolEl.position[0], + y: sourceSymbolEl.position[1], + rawX: sourceSymbolEl.__radialOldRawX, + rawY: sourceSymbolEl.__radialOldRawY + } + : sourceLayout; + var targetLayout = node.getLayout(); + + if (isInit) { + symbolEl = new SymbolClz$1(data, dataIndex, seriesScope); + symbolEl.attr('position', [sourceOldLayout.x, sourceOldLayout.y]); + } + else { + symbolEl.updateData(data, dataIndex, seriesScope); + } + + symbolEl.__radialOldRawX = symbolEl.__radialRawX; + symbolEl.__radialOldRawY = symbolEl.__radialRawY; + symbolEl.__radialRawX = targetLayout.rawX; + symbolEl.__radialRawY = targetLayout.rawY; + + group.add(symbolEl); + data.setItemGraphicEl(dataIndex, symbolEl); + updateProps(symbolEl, { + position: [targetLayout.x, targetLayout.y] + }, seriesModel); + + var symbolPath = symbolEl.getSymbolPath(); + + if (seriesScope.layout === 'radial') { + var realRoot = virtualRoot.children[0]; + var rootLayout = realRoot.getLayout(); + var length = realRoot.children.length; + var rad; + var isLeft; + + if (targetLayout.x === rootLayout.x && node.isExpand === true) { + var center = {}; + center.x = (realRoot.children[0].getLayout().x + realRoot.children[length - 1].getLayout().x) / 2; + center.y = (realRoot.children[0].getLayout().y + realRoot.children[length - 1].getLayout().y) / 2; + rad = Math.atan2(center.y - rootLayout.y, center.x - rootLayout.x); + if (rad < 0) { + rad = Math.PI * 2 + rad; + } + isLeft = center.x < rootLayout.x; + if (isLeft) { + rad = rad - Math.PI; + } + } + else { + rad = Math.atan2(targetLayout.y - rootLayout.y, targetLayout.x - rootLayout.x); + if (rad < 0) { + rad = Math.PI * 2 + rad; + } + if (node.children.length === 0 || (node.children.length !== 0 && node.isExpand === false)) { + isLeft = targetLayout.x < rootLayout.x; + if (isLeft) { + rad = rad - Math.PI; + } + } + else { + isLeft = targetLayout.x > rootLayout.x; + if (!isLeft) { + rad = rad - Math.PI; + } + } + } + + var textPosition = isLeft ? 'left' : 'right'; + symbolPath.setStyle({ + textPosition: textPosition, + textRotation: -rad, + textOrigin: 'center', + verticalAlign: 'middle' + }); + } + + if (node.parentNode && node.parentNode !== virtualRoot) { + var edge = symbolEl.__edge; + if (!edge) { + edge = symbolEl.__edge = new BezierCurve({ + shape: getEdgeShape(seriesScope, sourceOldLayout, sourceOldLayout), + style: defaults({opacity: 0, strokeNoScale: true}, seriesScope.lineStyle) + }); + } + + updateProps(edge, { + shape: getEdgeShape(seriesScope, sourceLayout, targetLayout), + style: {opacity: 1} + }, seriesModel); + + group.add(edge); + } +} + +function removeNode(data, dataIndex, symbolEl, group, seriesModel, seriesScope) { + var node = data.tree.getNodeByDataIndex(dataIndex); + var virtualRoot = data.tree.root; + var itemModel = node.getModel(); + var seriesScope = getTreeNodeStyle(node, itemModel, seriesScope); + + var source = node.parentNode === virtualRoot ? node : node.parentNode || node; + var sourceLayout; + while (sourceLayout = source.getLayout(), sourceLayout == null) { + source = source.parentNode === virtualRoot ? source : source.parentNode || source; + } + + updateProps(symbolEl, { + position: [sourceLayout.x + 1, sourceLayout.y + 1] + }, seriesModel, function () { + group.remove(symbolEl); + data.setItemGraphicEl(dataIndex, null); + }); + + symbolEl.fadeOut(null, {keepLabel: true}); + + var edge = symbolEl.__edge; + if (edge) { + updateProps(edge, { + shape: getEdgeShape(seriesScope, sourceLayout, sourceLayout), + style: { + opacity: 0 + } + }, seriesModel, function () { + group.remove(edge); + }); + } +} + +function getEdgeShape(seriesScope, sourceLayout, targetLayout) { + var cpx1; + var cpy1; + var cpx2; + var cpy2; + var orient = seriesScope.orient; + + if (seriesScope.layout === 'radial') { + var x1 = sourceLayout.rawX; + var y1 = sourceLayout.rawY; + var x2 = targetLayout.rawX; + var y2 = targetLayout.rawY; + + var radialCoor1 = radialCoordinate(x1, y1); + var radialCoor2 = radialCoordinate(x1, y1 + (y2 - y1) * seriesScope.curvature); + var radialCoor3 = radialCoordinate(x2, y2 + (y1 - y2) * seriesScope.curvature); + var radialCoor4 = radialCoordinate(x2, y2); + + return { + x1: radialCoor1.x, + y1: radialCoor1.y, + x2: radialCoor4.x, + y2: radialCoor4.y, + cpx1: radialCoor2.x, + cpy1: radialCoor2.y, + cpx2: radialCoor3.x, + cpy2: radialCoor3.y + }; + } + else { + var x1 = sourceLayout.x; + var y1 = sourceLayout.y; + var x2 = targetLayout.x; + var y2 = targetLayout.y; + + if (orient === 'LR' || orient === 'RL') { + cpx1 = x1 + (x2 - x1) * seriesScope.curvature; + cpy1 = y1; + cpx2 = x2 + (x1 - x2) * seriesScope.curvature; + cpy2 = y2; + } + if (orient === 'TB' || orient === 'BT') { + cpx1 = x1; + cpy1 = y1 + (y2 - y1) * seriesScope.curvature; + cpx2 = x2; + cpy2 = y2 + (y1 - y2) * seriesScope.curvature; + } + return { + x1: x1, + y1: y1, + x2: x2, + y2: y2, + cpx1: cpx1, + cpy1: cpy1, + cpx2: cpx2, + cpy2: cpy2 + }; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Register the actions of the tree + * @author Deqing Li(annong035@gmail.com) + */ + +registerAction({ + type: 'treeExpandAndCollapse', + event: 'treeExpandAndCollapse', + update: 'update' +}, function (payload, ecModel) { + ecModel.eachComponent({mainType: 'series', subType: 'tree', query: payload}, function (seriesModel) { + var dataIndex = payload.dataIndex; + var tree = seriesModel.getData().tree; + var node = tree.getNodeByDataIndex(dataIndex); + node.isExpand = !node.isExpand; + + }); +}); + +registerAction({ + type: 'treeRoam', + event: 'treeRoam', + // Here we set 'none' instead of 'update', because roam action + // just need to update the transform matrix without having to recalculate + // the layout. So don't need to go through the whole update process, such + // as 'dataPrcocess', 'coordSystemUpdate', 'layout' and so on. + update: 'none' +}, function (payload, ecModel) { + ecModel.eachComponent({mainType: 'series', subType: 'tree', query: payload}, function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + var res = updateCenterAndZoom(coordSys, payload); + + seriesModel.setCenter + && seriesModel.setCenter(res.center); + + seriesModel.setZoom + && seriesModel.setZoom(res.zoom); + }); +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + + +/** + * Traverse the tree from bottom to top and do something + * @param {module:echarts/data/Tree~TreeNode} root The real root of the tree + * @param {Function} callback + */ +function eachAfter (root, callback, separation) { + var nodes = [root]; + var next = []; + var node; + + while (node = nodes.pop()) { // jshint ignore:line + next.push(node); + if (node.isExpand) { + var children = node.children; + if (children.length) { + for (var i = 0; i < children.length; i++) { + nodes.push(children[i]); + } + } + } + } + + while (node = next.pop()) { // jshint ignore:line + callback(node, separation); + } +} + +/** + * Traverse the tree from top to bottom and do something + * @param {module:echarts/data/Tree~TreeNode} root The real root of the tree + * @param {Function} callback + */ +function eachBefore (root, callback) { + var nodes = [root]; + var node; + while (node = nodes.pop()) { // jshint ignore:line + callback(node); + if (node.isExpand) { + var children = node.children; + if (children.length) { + for (var i = children.length - 1; i >= 0; i--) { + nodes.push(children[i]); + } + } + } + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 treeLayout = function (ecModel, api) { + ecModel.eachSeriesByType('tree', function (seriesModel) { + commonLayout(seriesModel, api); + }); +}; + +function commonLayout(seriesModel, api) { + var layoutInfo = getViewRect(seriesModel, api); + seriesModel.layoutInfo = layoutInfo; + var layout = seriesModel.get('layout'); + var width = 0; + var height = 0; + var separation$$1 = null; + + if (layout === 'radial') { + width = 2 * Math.PI; + height = Math.min(layoutInfo.height, layoutInfo.width) / 2; + separation$$1 = separation(function (node1, node2) { + return (node1.parentNode === node2.parentNode ? 1 : 2) / node1.depth; + }); + } + else { + width = layoutInfo.width; + height = layoutInfo.height; + separation$$1 = separation(); + } + + var virtualRoot = seriesModel.getData().tree.root; + var realRoot = virtualRoot.children[0]; + + if (realRoot) { + init$2(virtualRoot); + eachAfter(realRoot, firstWalk, separation$$1); + virtualRoot.hierNode.modifier = - realRoot.hierNode.prelim; + eachBefore(realRoot, secondWalk); + + var left = realRoot; + var right = realRoot; + var bottom = realRoot; + eachBefore(realRoot, function (node) { + var x = node.getLayout().x; + if (x < left.getLayout().x) { + left = node; + } + if (x > right.getLayout().x) { + right = node; + } + if (node.depth > bottom.depth) { + bottom = node; + } + }); + + var delta = left === right ? 1 : separation$$1(left, right) / 2; + var tx = delta - left.getLayout().x; + var kx = 0; + var ky = 0; + var coorX = 0; + var coorY = 0; + if (layout === 'radial') { + kx = width / (right.getLayout().x + delta + tx); + // here we use (node.depth - 1), bucause the real root's depth is 1 + ky = height / ((bottom.depth - 1) || 1); + eachBefore(realRoot, function (node) { + coorX = (node.getLayout().x + tx) * kx; + coorY = (node.depth - 1) * ky; + var finalCoor = radialCoordinate(coorX, coorY); + node.setLayout({x: finalCoor.x, y: finalCoor.y, rawX: coorX, rawY: coorY}, true); + }); + } + else { + var orient = seriesModel.getOrient(); + if (orient === 'RL' || orient === 'LR') { + ky = height / (right.getLayout().x + delta + tx); + kx = width / ((bottom.depth - 1) || 1); + eachBefore(realRoot, function (node) { + coorY = (node.getLayout().x + tx) * ky; + coorX = orient === 'LR' + ? (node.depth - 1) * kx + : width - (node.depth - 1) * kx; + node.setLayout({x: coorX, y: coorY}, true); + }); + } + else if (orient === 'TB' || orient === 'BT') { + kx = width / (right.getLayout().x + delta + tx); + ky = height / ((bottom.depth - 1) || 1); + eachBefore(realRoot, function (node) { + coorX = (node.getLayout().x + tx) * kx; + coorY = orient === 'TB' + ? (node.depth - 1) * ky + : height - (node.depth - 1) * ky; + node.setLayout({x: coorX, y: coorY}, true); + }); + } + } + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerVisual(visualSymbol('tree', 'circle')); +registerLayout(treeLayout); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 retrieveTargetInfo(payload, validPayloadTypes, seriesModel) { + if (payload && indexOf(validPayloadTypes, payload.type) >= 0) { + var root = seriesModel.getData().tree.root; + var targetNode = payload.targetNode; + + if (typeof targetNode === 'string') { + targetNode = root.getNodeById(targetNode); + } + + if (targetNode && root.contains(targetNode)) { + return {node: targetNode}; + } + + var targetNodeId = payload.targetNodeId; + if (targetNodeId != null && (targetNode = root.getNodeById(targetNodeId))) { + return {node: targetNode}; + } + } +} + +// Not includes the given node at the last item. +function getPathToRoot(node) { + var path = []; + while (node) { + node = node.parentNode; + node && path.push(node); + } + return path.reverse(); +} + +function aboveViewRoot(viewRoot, node) { + var viewPath = getPathToRoot(viewRoot); + return indexOf(viewPath, node) >= 0; +} + +// From root to the input node (the input node will be included). +function wrapTreePathInfo(node, seriesModel) { + var treePathInfo = []; + + while (node) { + var nodeDataIndex = node.dataIndex; + treePathInfo.push({ + name: node.name, + dataIndex: nodeDataIndex, + value: seriesModel.getRawValue(nodeDataIndex) + }); + node = node.parentNode; + } + + treePathInfo.reverse(); + + return treePathInfo; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +SeriesModel.extend({ + + type: 'series.treemap', + + layoutMode: 'box', + + dependencies: ['grid', 'polar'], + + /** + * @type {module:echarts/data/Tree~Node} + */ + _viewRoot: null, + + defaultOption: { + // Disable progressive rendering + progressive: 0, + hoverLayerThreshold: Infinity, + // 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). + drillDownIcon: '▶', // Use html character temporarily because it is complicated + // to align specialized icon. ▷▶❒❐▼✚ + + 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: { + 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: { + show: true, + // Do not use textDistance, for ellipsis rect just the same as treemap node rect. + distance: 0, + padding: 5, + position: 'inside', // Can be [5, '5%'] or position stirng like 'insideTopLeft', ... + // formatter: null, + color: '#fff', + ellipsis: true + // align + // verticalAlign + }, + upperLabel: { // Label when node is parent. + show: false, + position: [0, '50%'], + height: 20, + // formatter: null, + color: '#fff', + ellipsis: true, + // align: null, + verticalAlign: 'middle' + }, + itemStyle: { + 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: { + upperLabel: { + show: true, + position: [0, '50%'], + color: '#fff', + ellipsis: true, + verticalAlign: 'middle' + } + }, + + visualDimension: 0, // Can be 0, 1, 2, 3. + visualMin: null, + visualMax: null, + + color: [], // + treemapSeries.color should not be modified. Please only modified + // level[n].color (if necessary). + // + Specify color list of each level. level[0].color would be global + // color list if not specified. (see method `setDefault`). + // + But set as a empty array to forbid fetch color from global palette + // when using nodeModel.get('color'), otherwise nodes on deep level + // will always has color palette set and are not able to inherit color + // from parent node. + // + TreemapSeries.color can not be set as 'none', otherwise effect + // legend color fetching (see seriesColor.js). + 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) { + // Create a virtual root. + var root = {name: option.name, children: option.data}; + + completeTreeValue(root); + + var levels = option.levels || []; + + levels = option.levels = setDefault(levels, ecModel); + + var treeOption = {}; + + treeOption.levels = levels; + + // 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, treeOption).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 = 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 node = this.getData().tree.getNodeByDataIndex(dataIndex); + params.treePathInfo = wrapTreePathInfo(node, this); + + 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 || {}; + 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 = createHashMap(); + /** + * @private + * @type {number} + */ + this._idIndexMapCount = 0; + } + + var index = idIndexMap.get(id); + if (index == null) { + idIndexMap.set(id, index = this._idIndexMapCount++); + } + + return index; + }, + + getViewRoot: function () { + return this._viewRoot; + }, + + /** + * @param {module:echarts/data/Tree~Node} [viewRoot] + */ + resetViewRoot: function (viewRoot) { + viewRoot + ? (this._viewRoot = viewRoot) + : (viewRoot = this._viewRoot); + + var root = this.getRawData().tree.root; + + if (!viewRoot + || (viewRoot !== root && !root.contains(viewRoot)) + ) { + this._viewRoot = root; + } + } +}); + +/** + * @param {Object} dataNode + */ +function completeTreeValue(dataNode) { + // 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; + + each$1(dataNode.children, function (child) { + + completeTreeValue(child); + + var childValue = child.value; + isArray(childValue) && (childValue = childValue[0]); + + sum += childValue; + }); + + var thisValue = dataNode.value; + if (isArray(thisValue)) { + thisValue = thisValue[0]; + } + + if (thisValue == null || isNaN(thisValue)) { + thisValue = sum; + } + // Value should not less than 0. + if (thisValue < 0) { + thisValue = 0; + } + + isArray(dataNode.value) + ? (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; + each$1(levels, function (levelDefine) { + var model = new Model(levelDefine); + var modelColor = model.get('color'); + + if (model.get('itemStyle.color') + || (modelColor && modelColor !== 'none') + ) { + hasColorDefine = true; + } + }); + + if (!hasColorDefine) { + var level0 = levels[0] || (levels[0] = {}); + level0.color = globalColorList.slice(); + } + + return levels; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 TEXT_PADDING = 8; +var ITEM_GAP = 8; +var ARRAY_LENGTH = 5; + +function Breadcrumb(containerGroup) { + /** + * @private + * @type {module:zrender/container/Group} + */ + this.group = new Group(); + + containerGroup.add(this.group); +} + +Breadcrumb.prototype = { + + constructor: Breadcrumb, + + render: function (seriesModel, api, targetNode, onSelect) { + var model = seriesModel.getModel('breadcrumb'); + var thisGroup = this.group; + + thisGroup.removeAll(); + + if (!model.get('show') || !targetNode) { + return; + } + + var normalStyleModel = model.getModel('itemStyle'); + // var emphasisStyleModel = model.getModel('emphasis.itemStyle'); + 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(targetNode, layoutParam, textStyleModel); + this._renderContent(seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect); + + positionElement(thisGroup, layoutParam.pos, layoutParam.box); + }, + + /** + * Prepare render list and total width + * @private + */ + _prepare: function (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 ( + seriesModel, layoutParam, normalStyleModel, textStyleModel, onSelect + ) { + // Start rendering. + var lastX = 0; + var emptyItemWidth = layoutParam.emptyItemWidth; + var height = seriesModel.get('breadcrumb.height'); + var availableSize = 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 itemNode = item.node; + 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 = null; + } + + var el = new Polygon({ + shape: { + points: makeItemPoints( + lastX, 0, itemWidth, height, + i === renderList.length - 1, i === 0 + ) + }, + style: defaults( + normalStyleModel.getItemStyle(), + { + lineJoin: 'bevel', + text: text, + textFill: textStyleModel.getTextColor(), + textFont: textStyleModel.getFont() + } + ), + z: 10, + onclick: curry(onSelect, itemNode) + }); + this.group.add(el); + + packEventData(el, seriesModel, itemNode); + + 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; +} + +// Package custom mouse event. +function packEventData(el, seriesModel, itemNode) { + el.eventData = { + componentType: 'series', + componentSubType: 'treemap', + seriesIndex: seriesModel.componentIndex, + seriesName: seriesModel.name, + seriesType: 'treemap', + selfType: 'breadcrumb', // Distinguish with click event on treemap node. + nodeData: { + dataIndex: itemNode && itemNode.dataIndex, + name: itemNode && itemNode.name + }, + treePathInfo: itemNode && wrapTreePathInfo(itemNode, seriesModel) + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @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 (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(); + } + } + } + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 bind$1 = bind; +var Group$2 = Group; +var Rect$1 = Rect; +var each$8 = each$1; + +var DRAG_THRESHOLD = 3; +var PATH_LABEL_NOAMAL = ['label']; +var PATH_LABEL_EMPHASIS = ['emphasis', 'label']; +var PATH_UPPERLABEL_NORMAL = ['upperLabel']; +var PATH_UPPERLABEL_EMPHASIS = ['emphasis', 'upperLabel']; +var Z_BASE = 10; // Should bigger than every z. +var Z_BG = 1; +var Z_CONTENT = 2; + +var getItemStyleEmphasis = makeStyleMapper([ + ['fill', 'color'], + // `borderColor` and `borderWidth` has been occupied, + // so use `stroke` to indicate the stroke of the rect. + ['stroke', 'strokeColor'], + ['lineWidth', 'strokeWidth'], + ['shadowBlur'], + ['shadowOffsetX'], + ['shadowOffsetY'], + ['shadowColor'] +]); +var getItemStyleNormal = function (model) { + // Normal style props should include emphasis style props. + var itemStyle = getItemStyleEmphasis(model); + // Clear styles set by emphasis. + itemStyle.stroke = itemStyle.fill = itemStyle.lineWidth = null; + return itemStyle; +}; + +extendChartView({ + + type: 'treemap', + + /** + * @override + */ + init: function (o, api) { + + /** + * @private + * @type {module:zrender/container/Group} + */ + this._containerGroup; + + /** + * @private + * @type {Object.>} + */ + 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'; + }, + + /** + * @override + */ + render: function (seriesModel, ecModel, api, payload) { + + var models = ecModel.findComponents({ + mainType: 'series', subType: 'treemap', query: payload + }); + if (indexOf(models, seriesModel) < 0) { + return; + } + + this.seriesModel = seriesModel; + this.api = api; + this.ecModel = ecModel; + + var types = ['treemapZoomToNode', 'treemapRootToNode']; + var targetInfo = retrieveTargetInfo(payload, types, 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$2(); + this._initEvents(containerGroup); + this.group.add(containerGroup); + } + containerGroup.attr('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 doRenderNode = curry( + renderNode, seriesModel, + thisStorage, oldStorage, reRoot, + lastsForAnimation, willInvisibleEls + ); + + // Notice: when thisTree and oldTree are the same tree (see list.cloneShallow), + // 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, depth) { + // 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$8(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(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; + + var group = doRenderNode(thisNode, oldNode, parentGroup, depth); + + group && dualTravel( + thisNode && thisNode.viewChildren || [], + oldNode && oldNode.viewChildren || [], + group, + sameTree, + depth + 1 + ); + } + } + + function clearStorage(storage) { + var willDeleteEls = createStorage(); + storage && each$8(storage, function (store, storageName) { + var delEls = willDeleteEls[storageName]; + each$8(store, function (el) { + el && (delEls.push(el), el.__tmWillDelete = 1); + }); + }); + return willDeleteEls; + } + + function renderFinally() { + each$8(willDeleteEls, function (els) { + each$8(els, function (el) { + el.parent && el.parent.remove(el); + }); + }); + each$8(willInvisibleEls, function (el) { + el.invisible = true; + // Setting invisible is for optimizing, so no need to set dirty, + // just mark as invisible. + el.dirty(); + }); + } + }, + + /** + * @private + */ + _doAnimation: function (containerGroup, renderResult, seriesModel, reRoot) { + if (!seriesModel.get('animation')) { + return; + } + + var duration = seriesModel.get('animationDurationUpdate'); + var easing = seriesModel.get('animationEasing'); + var animationWrap = createWrap(); + + // Make delete animations. + each$8(renderResult.willDeleteEls, function (store, storageName) { + each$8(store, function (el, rawIndex) { + if (el.invisible) { + return; + } + + var parent = el.parent; // Always has parent, and parent is nodeGroup. + var target; + + if (reRoot && reRoot.direction === 'drillDown') { + target = parent === reRoot.rootNodeGroup + // This is the content element of view root. + // Only `content` will enter this branch, because + // `background` and `nodeGroup` will not be deleted. + ? { + shape: { + x: 0, + y: 0, + width: parent.__tmNodeWidth, + height: parent.__tmNodeHeight + }, + style: { + opacity: 0 + } + } + // Others. + : {style: {opacity: 0}}; + } + 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 rolling up 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$8(this._storage, function (store, storageName) { + each$8(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.attr('position', last.old); + } + } + else { + if (last.old) { + target.shape = 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$1(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$1(this._onPan, this)); + controller.on('zoom', bind$1(this._onZoom, this)); + } + + var rect = new BoundingRect(0, 0, api.getWidth(), api.getHeight()); + controller.setPointerChecker(function (e, x, y) { + return rect.contain(x, y); + }); + }, + + /** + * @private + */ + _clearController: function () { + var controller = this._controller; + if (controller) { + controller.dispose(); + controller = null; + } + }, + + /** + * @private + */ + _onPan: function (e) { + if (this._state !== 'animating' + && (Math.abs(e.dx) > DRAG_THRESHOLD || Math.abs(e.dy) > DRAG_THRESHOLD) + ) { + // These param must not be cached. + var root = this.seriesModel.getData().tree.root; + + if (!root) { + return; + } + + var rootLayout = root.getLayout(); + + if (!rootLayout) { + return; + } + + this.api.dispatchAction({ + type: 'treemapMove', + from: this.uid, + seriesId: this.seriesModel.id, + rootRect: { + x: rootLayout.x + e.dx, y: rootLayout.y + e.dy, + width: rootLayout.width, height: rootLayout.height + } + }); + } + }, + + /** + * @private + */ + _onZoom: function (e) { + var mouseX = e.originX; + var mouseY = e.originY; + + if (this._state !== 'animating') { + // These param must not be cached. + var root = this.seriesModel.getData().tree.root; + + if (!root) { + return; + } + + var rootLayout = root.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 = create$1(); + translate(m, m, [-mouseX, -mouseY]); + scale$1(m, m, [e.scale, e.scale]); + 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) { + containerGroup.on('click', function (e) { + if (this._state !== 'ready') { + return; + } + + 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); + } + } + + }, this); + }, + + /** + * @private + */ + _renderBreadcrumb: function (seriesModel, api, targetInfo) { + if (!targetInfo) { + targetInfo = seriesModel.get('leafDepth', true) != null + ? {node: seriesModel.getViewRoot()} + // FIXME + // better way? + // Find breadcrumb tail on center of containerGroup. + : this.findTarget(api.getWidth() / 2, api.getHeight() / 2); + + if (!targetInfo) { + targetInfo = {node: seriesModel.getData().tree.root}; + } + } + + (this._breadcrumb || (this._breadcrumb = new Breadcrumb(this.group))) + .render(seriesModel, api, targetInfo.node, bind$1(onSelect, this)); + + function onSelect(node) { + if (this._state !== 'animating') { + 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; + } + +}); + +/** + * @inner + */ +function createStorage() { + return {nodeGroup: [], background: [], content: []}; +} + +/** + * @inner + * @return Return undefined means do not travel further. + */ +function renderNode( + seriesModel, thisStorage, oldStorage, reRoot, + lastsForAnimation, willInvisibleEls, + thisNode, oldNode, parentGroup, depth +) { + // Whether under viewRoot. + if (!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; + } + + // ------------------------------------------------------------------- + // Start of closure variables available in "Procedures in renderNode". + + var thisLayout = thisNode.getLayout(); + + if (!thisLayout || !thisLayout.isInView) { + return; + } + + var thisWidth = thisLayout.width; + var thisHeight = thisLayout.height; + var borderWidth = thisLayout.borderWidth; + var thisInvisible = thisLayout.invisible; + + var thisRawIndex = thisNode.getRawIndex(); + var oldRawIndex = oldNode && oldNode.getRawIndex(); + + var thisViewChildren = thisNode.viewChildren; + var upperHeight = thisLayout.upperHeight; + var isParent = thisViewChildren && thisViewChildren.length; + var itemStyleNormalModel = thisNode.getModel('itemStyle'); + var itemStyleEmphasisModel = thisNode.getModel('emphasis.itemStyle'); + + // End of closure ariables available in "Procedures in renderNode". + // ----------------------------------------------------------------- + + // Node group + var group = giveGraphic('nodeGroup', Group$2); + + if (!group) { + return; + } + + parentGroup.add(group); + // x,y are not set when el is above view root. + group.attr('position', [thisLayout.x || 0, thisLayout.y || 0]); + group.__tmNodeWidth = thisWidth; + group.__tmNodeHeight = thisHeight; + + if (thisLayout.isAboveViewRoot) { + return group; + } + + // Background + var bg = giveGraphic('background', Rect$1, depth, Z_BG); + bg && renderBackground(group, bg, isParent && thisLayout.upperHeight); + + // No children, render content. + if (!isParent) { + var content = giveGraphic('content', Rect$1, depth, Z_CONTENT); + content && renderContent(group, content); + } + + return group; + + // ---------------------------- + // | Procedures in renderNode | + // ---------------------------- + + function renderBackground(group, bg, useUpperLabel) { + // For tooltip. + bg.dataIndex = thisNode.dataIndex; + bg.seriesIndex = seriesModel.seriesIndex; + + bg.setShape({x: 0, y: 0, width: thisWidth, height: thisHeight}); + var visualBorderColor = thisNode.getVisual('borderColor', true); + var emphasisBorderColor = itemStyleEmphasisModel.get('borderColor'); + + updateStyle(bg, function () { + var normalStyle = getItemStyleNormal(itemStyleNormalModel); + normalStyle.fill = visualBorderColor; + var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel); + emphasisStyle.fill = emphasisBorderColor; + + if (useUpperLabel) { + var upperLabelWidth = thisWidth - 2 * borderWidth; + + prepareText( + normalStyle, emphasisStyle, visualBorderColor, upperLabelWidth, upperHeight, + {x: borderWidth, y: 0, width: upperLabelWidth, height: upperHeight} + ); + } + // For old bg. + else { + normalStyle.text = emphasisStyle.text = null; + } + + bg.setStyle(normalStyle); + setHoverStyle(bg, emphasisStyle); + }); + + group.add(bg); + } + + function renderContent(group, content) { + // For tooltip. + content.dataIndex = thisNode.dataIndex; + content.seriesIndex = seriesModel.seriesIndex; + + var contentWidth = Math.max(thisWidth - 2 * borderWidth, 0); + var contentHeight = Math.max(thisHeight - 2 * borderWidth, 0); + + content.culling = true; + content.setShape({ + x: borderWidth, + y: borderWidth, + width: contentWidth, + height: contentHeight + }); + + var visualColor = thisNode.getVisual('color', true); + updateStyle(content, function () { + var normalStyle = getItemStyleNormal(itemStyleNormalModel); + normalStyle.fill = visualColor; + var emphasisStyle = getItemStyleEmphasis(itemStyleEmphasisModel); + + prepareText(normalStyle, emphasisStyle, visualColor, contentWidth, contentHeight); + + content.setStyle(normalStyle); + setHoverStyle(content, emphasisStyle); + }); + + group.add(content); + } + + function updateStyle(element, cb) { + if (!thisInvisible) { + // 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. + cb(); + + if (!element.__tmWillVisible) { + element.invisible = false; + } + } + else { + // Delay invisible setting utill animation finished, + // avoid element vanish suddenly before animation. + !element.invisible && willInvisibleEls.push(element); + } + } + + function prepareText(normalStyle, emphasisStyle, visualColor, width, height, upperLabelRect) { + var nodeModel = thisNode.getModel(); + var text = retrieve( + seriesModel.getFormattedLabel( + thisNode.dataIndex, 'normal', null, null, upperLabelRect ? 'upperLabel' : 'label' + ), + nodeModel.get('name') + ); + if (!upperLabelRect && thisLayout.isLeafRoot) { + var iconChar = seriesModel.get('drillDownIcon', true); + text = iconChar ? iconChar + ' ' + text : text; + } + + var normalLabelModel = nodeModel.getModel( + upperLabelRect ? PATH_UPPERLABEL_NORMAL : PATH_LABEL_NOAMAL + ); + var emphasisLabelModel = nodeModel.getModel( + upperLabelRect ? PATH_UPPERLABEL_EMPHASIS : PATH_LABEL_EMPHASIS + ); + + var isShow = normalLabelModel.getShallow('show'); + + setLabelStyle( + normalStyle, emphasisStyle, normalLabelModel, emphasisLabelModel, + { + defaultText: isShow ? text : null, + autoColor: visualColor, + isRectText: true + } + ); + + upperLabelRect && (normalStyle.textRect = clone(upperLabelRect)); + + normalStyle.truncate = (isShow && normalLabelModel.get('ellipsis')) + ? { + outerWidth: width, + outerHeight: height, + minChar: 2 + } + : null; + } + + function giveGraphic(storageName, Ctor, depth, 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 (!thisInvisible) { + element = new Ctor({z: calculateZ(depth, z)}); + element.__tmDepth = depth; + element.__tmStorageName = storageName; + 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() + : 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) { + var lastCfg = lasts[thisRawIndex] = {}; + var parentNode = thisNode.parentNode; + + if (parentNode && (!reRoot || reRoot.direction === 'drillDown')) { + var parentOldX = 0; + var parentOldY = 0; + + // New nodes appear from right-bottom corner in 'zoomToNode' animation. + // For convenience, get old bounding rect from background. + var parentOldBg = lastsForAnimation.background[parentNode.getRawIndex()]; + if (!reRoot && parentOldBg && parentOldBg.old) { + parentOldX = parentOldBg.old.width; + parentOldY = parentOldBg.old.height; + } + + // When no parent old shape found, its parent is new too, + // so we can just use {x:0, y:0}. + lastCfg.old = storageName === 'nodeGroup' + ? [0, parentOldY] + : {x: parentOldX, y: parentOldY, width: 0, height: 0}; + } + + // Fade in, user can be aware that these nodes are new. + lastCfg.fadein = storageName !== 'nodeGroup'; + } +} + +// We can not set all backgroud with the same z, Because the behaviour of +// drill down and roll up differ background creation sequence from tree +// hierarchy sequence, which cause that lowser background element overlap +// upper ones. So we calculate z based on depth. +// Moreover, we try to shrink down z interval to [0, 1] to avoid that +// treemap with large z overlaps other components. +function calculateZ(depth, zInLevel) { + var zb = depth * Z_BASE + zInLevel; + return (zb - 1) / zb; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Treemap action + */ + +var noop$1 = function () {}; + +var actionTypes = [ + 'treemapZoomToNode', + 'treemapRender', + 'treemapMove' +]; + +for (var i$2 = 0; i$2 < actionTypes.length; i$2++) { + registerAction({type: actionTypes[i$2], update: 'updateView'}, noop$1); +} + +registerAction( + {type: 'treemapRootToNode', update: 'updateView'}, + function (payload, ecModel) { + + ecModel.eachComponent( + {mainType: 'series', subType: 'treemap', query: payload}, + handleRootToNode + ); + + function handleRootToNode(model, index) { + var types = ['treemapZoomToNode', 'treemapRootToNode']; + var targetInfo = retrieveTargetInfo(payload, types, model); + + if (targetInfo) { + var originViewRoot = model.getViewRoot(); + if (originViewRoot) { + payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) + ? 'rollUp' : 'drillDown'; + } + model.resetViewRoot(targetInfo.node); + } + } + } +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$9 = each$1; +var isObject$5 = isObject$1; + +var CATEGORY_DEFAULT_VISUAL_INDEX = -1; + +/** + * @param {Object} option + * @param {string} [option.type] See visualHandlers. + * @param {string} [option.mappingMethod] 'linear' or 'piecewise' or 'category' or 'fixed' + * @param {Array.=} [option.dataExtent] [minExtent, maxExtent], + * required when mappingMethod is 'linear' + * @param {Array.=} [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.=} [option.categories] ['cate1', 'cate2'] + * required when mappingMethod is 'category'. + * If no option.categories, categories is set + * as [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 be array or primary (which will be + * normalized to array). + * + */ +var VisualMapping = function (option) { + var mappingMethod = option.mappingMethod; + var visualType = option.type; + + /** + * @readOnly + * @type {Object} + */ + var thisOption = this.option = clone(option); + + /** + * @readOnly + * @type {string} + */ + this.type = visualType; + + /** + * @readOnly + * @type {string} + */ + this.mappingMethod = mappingMethod; + + /** + * @private + * @type {Function} + */ + this._normalizeData = normalizers[mappingMethod]; + + var visualHandler = visualHandlers[visualType]; + + /** + * @public + * @type {Function} + */ + this.applyVisual = visualHandler.applyVisual; + + /** + * @public + * @type {Function} + */ + this.getColorMapper = visualHandler.getColorMapper; + + /** + * @private + * @type {Function} + */ + this._doMap = visualHandler._doMap[mappingMethod]; + + if (mappingMethod === 'piecewise') { + normalizeVisualRange(thisOption); + preprocessForPiecewise(thisOption); + } + else if (mappingMethod === 'category') { + thisOption.categories + ? preprocessForSpecifiedCategory(thisOption) + // categories is ordinal when thisOption.categories not specified, + // which need no more preprocess except normalize visual. + : normalizeVisualRange(thisOption, true); + } + else { // mappingMethod === 'linear' or 'fixed' + assert$1(mappingMethod !== 'linear' || thisOption.dataExtent); + normalizeVisualRange(thisOption); + } +}; + +VisualMapping.prototype = { + + constructor: VisualMapping, + + mapValueToVisual: function (value) { + var normalized = this._normalizeData(value); + return this._doMap(normalized, value); + }, + + getNormalizer: function () { + return bind(this._normalizeData, this); + } +}; + +var visualHandlers = VisualMapping.visualHandlers = { + + color: { + + applyVisual: makeApplyVisual('color'), + + /** + * Create a mapper function + * @return {Function} + */ + getColorMapper: function () { + var thisOption = this.option; + + return bind( + thisOption.mappingMethod === 'category' + ? function (value, isNormalized) { + !isNormalized && (value = this._normalizeData(value)); + return doMapCategory.call(this, 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 = fastLerp(value, thisOption.parsedVisual, out); + return returnRGBArray ? out : stringify(out, 'rgba'); + }, + this + ); + }, + + _doMap: { + linear: function (normalized) { + return stringify( + fastLerp(normalized, this.option.parsedVisual), + 'rgba' + ); + }, + category: doMapCategory, + piecewise: function (normalized, value) { + var result = getSpecifiedVisual.call(this, value); + if (result == null) { + result = stringify( + fastLerp(normalized, this.option.parsedVisual), + 'rgba' + ); + } + return result; + }, + fixed: doMapFixed + } + }, + + colorHue: makePartialColorVisualHandler(function (color, value) { + return modifyHSL(color, value); + }), + + colorSaturation: makePartialColorVisualHandler(function (color, value) { + return modifyHSL(color, null, value); + }), + + colorLightness: makePartialColorVisualHandler(function (color, value) { + return modifyHSL(color, null, null, value); + }), + + colorAlpha: makePartialColorVisualHandler(function (color, value) { + return modifyAlpha(color, value); + }), + + opacity: { + applyVisual: makeApplyVisual('opacity'), + _doMap: makeDoMap([0, 1]) + }, + + liftZ: { + applyVisual: makeApplyVisual('liftZ'), + _doMap: { + linear: doMapFixed, + category: doMapFixed, + piecewise: doMapFixed, + fixed: doMapFixed + } + }, + + symbol: { + applyVisual: function (value, getter, setter) { + var symbolCfg = this.mapValueToVisual(value); + if (isString(symbolCfg)) { + setter('symbol', symbolCfg); + } + else if (isObject$5(symbolCfg)) { + for (var name in symbolCfg) { + if (symbolCfg.hasOwnProperty(name)) { + setter(name, symbolCfg[name]); + } + } + } + }, + _doMap: { + linear: doMapToArray, + category: doMapCategory, + piecewise: function (normalized, value) { + var result = getSpecifiedVisual.call(this, value); + if (result == null) { + result = doMapToArray.call(this, normalized); + } + return result; + }, + fixed: doMapFixed + } + }, + + symbolSize: { + applyVisual: makeApplyVisual('symbolSize'), + _doMap: makeDoMap([0, 1]) + } +}; + + +function preprocessForPiecewise(thisOption) { + var pieceList = thisOption.pieceList; + thisOption.hasSpecialVisual = false; + + each$1(pieceList, function (piece, index) { + piece.originIndex = index; + // piece.visual is "result visual value" but not + // a visual range, so it does not need to be normalized. + if (piece.visual != null) { + thisOption.hasSpecialVisual = true; + } + }); +} + +function preprocessForSpecifiedCategory(thisOption) { + // Hash categories. + var categories = thisOption.categories; + var visual = thisOption.visual; + + var categoryMap = thisOption.categoryMap = {}; + each$9(categories, function (cate, index) { + categoryMap[cate] = index; + }); + + // Process visual map input. + if (!isArray(visual)) { + var visualArr = []; + + if (isObject$1(visual)) { + each$9(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 = setVisualToOption(thisOption, 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 normalizeVisualRange(thisOption, isCategory) { + var visual = thisOption.visual; + var visualArr = []; + + if (isObject$1(visual)) { + each$9(visual, function (v) { + visualArr.push(v); + }); + } + else if (visual != null) { + visualArr.push(visual); + } + + var doNotNeedPair = {color: 1, symbol: 1}; + + if (!isCategory + && visualArr.length === 1 + && !doNotNeedPair.hasOwnProperty(thisOption.type) + ) { + // Do not care visualArr.length === 0, which is illegal. + visualArr[1] = visualArr[0]; + } + + setVisualToOption(thisOption, visualArr); +} + +function makePartialColorVisualHandler(applyValue) { + return { + applyVisual: function (value, getter, setter) { + value = this.mapValueToVisual(value); + // Must not be array value + setter('color', applyValue(getter('color'), value)); + }, + _doMap: makeDoMap([0, 1]) + }; +} + +function doMapToArray(normalized) { + var visual = this.option.visual; + return visual[ + Math.round(linearMap(normalized, [0, 1], [0, visual.length - 1], true)) + ] || {}; +} + +function makeApplyVisual(visualType) { + return function (value, getter, setter) { + setter(visualType, this.mapValueToVisual(value)); + }; +} + +function doMapCategory(normalized) { + var visual = this.option.visual; + return visual[ + (this.option.loop && normalized !== CATEGORY_DEFAULT_VISUAL_INDEX) + ? normalized % visual.length + : normalized + ]; +} + +function doMapFixed() { + return this.option.visual[0]; +} + +function makeDoMap(sourceExtent) { + return { + linear: function (normalized) { + return linearMap(normalized, sourceExtent, this.option.visual, true); + }, + category: doMapCategory, + piecewise: function (normalized, value) { + var result = getSpecifiedVisual.call(this, value); + if (result == null) { + result = linearMap(normalized, sourceExtent, this.option.visual, true); + } + return result; + }, + fixed: doMapFixed + }; +} + +function getSpecifiedVisual(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[this.type]; + } + } +} + +function setVisualToOption(thisOption, visualArr) { + thisOption.visual = visualArr; + if (thisOption.type === 'color') { + thisOption.parsedVisual = map(visualArr, function (item) { + return parse(item); + }); + } + return visualArr; +} + + +/** + * Normalizers by mapping methods. + */ +var normalizers = { + + linear: function (value) { + return linearMap(value, this.option.dataExtent, [0, 1], true); + }, + + piecewise: function (value) { + var pieceList = this.option.pieceList; + var pieceIndex = VisualMapping.findPieceIndex(value, pieceList, true); + if (pieceIndex != null) { + return linearMap(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; + }, + + fixed: noop +}; + + + +/** + * List available visual types. + * + * @public + * @return {Array.} + */ +VisualMapping.listVisualTypes = function () { + var visualTypes = []; + each$1(visualHandlers, function (handler, key) { + visualTypes.push(key); + }); + return visualTypes; +}; + +/** + * @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 (isObject$1(visual)) { + each$1(visual, callback, context); + } + else { + callback.call(context, visual); + } +}; + +VisualMapping.mapVisual = function (visual, callback, context) { + var isPrimary; + var newVisual = isArray(visual) + ? [] + : isObject$1(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; +}; + +/** + * @public + * @param {Object} obj + * @return {Object} new object containers visual values. + * If no visuals, return null. + */ +VisualMapping.retrieveVisuals = function (obj) { + var ret = {}; + var hasVisual; + + obj && each$9(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.} Sorted visual types. + */ +VisualMapping.prepareVisualTypes = function (visualTypes) { + if (isObject$5(visualTypes)) { + var types = []; + each$9(visualTypes, function (item, type) { + types.push(type); + }); + visualTypes = types; + } + else if (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; +}; + +/** + * 'color', 'colorSaturation', 'colorAlpha', ... are depends on 'color'. + * Other visuals are only depends on themself. + * + * @public + * @param {string} visualType1 + * @param {string} visualType2 + * @return {boolean} + */ +VisualMapping.dependsOn = function (visualType1, visualType2) { + return visualType2 === 'color' + ? !!(visualType1 && visualType1.indexOf(visualType2) === 0) + : visualType1 === visualType2; +}; + +/** + * @param {number} value + * @param {Array.} pieceList [{value: ..., interval: [min, max]}, ...] + * Always from small to big. + * @param {boolean} [findClosestWhenOutside=false] + * @return {number} index + */ +VisualMapping.findPieceIndex = function (value, pieceList, findClosestWhenOutside) { + var possibleI; + var abs = Infinity; + + // value has the higher priority. + for (var i = 0, len = pieceList.length; i < len; i++) { + var pieceValue = pieceList[i].value; + if (pieceValue != null) { + if (pieceValue === value + // FIXME + // It is supposed to compare value according to value type of dimension, + // but currently value type can exactly be string or number. + // Compromise for numeric-like string (like '12'), especially + // in the case that visualMap.categories is ['22', '33']. + || (typeof pieceValue === 'string' && pieceValue === value + '') + ) { + return i; + } + findClosestWhenOutside && updatePossible(pieceValue, i); + } + } + + for (var i = 0, len = pieceList.length; i < len; i++) { + var piece = pieceList[i]; + var interval = piece.interval; + var close = piece.close; + + if (interval) { + if (interval[0] === -Infinity) { + if (littleThan(close[1], value, interval[1])) { + return i; + } + } + else if (interval[1] === Infinity) { + if (littleThan(close[0], interval[0], value)) { + return i; + } + } + else if ( + littleThan(close[0], interval[0], value) + && littleThan(close[1], value, interval[1]) + ) { + return i; + } + findClosestWhenOutside && updatePossible(interval[0], i); + findClosestWhenOutside && updatePossible(interval[1], i); + } + } + + if (findClosestWhenOutside) { + return value === Infinity + ? pieceList.length - 1 + : value === -Infinity + ? 0 + : possibleI; + } + + function updatePossible(val, index) { + var newAbs = Math.abs(val - value); + if (newAbs < abs) { + abs = newAbs; + possibleI = index; + } + } + +}; + +function littleThan(close, a, b) { + return close ? a <= b : a < b; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 isArray$2 = isArray; + +var ITEM_STYLE_NORMAL = 'itemStyle'; + +var treemapVisual = { + seriesType: 'treemap', + reset: function (seriesModel, ecModel, api, payload) { + var tree = seriesModel.getData().tree; + var root = tree.root; + var seriesItemStyleModel = seriesModel.getModel(ITEM_STYLE_NORMAL); + + if (root.isRemoved()) { + return; + } + + var levelItemStyles = map(tree.levelModels, function (levelModel) { + return levelModel ? levelModel.get(ITEM_STYLE_NORMAL) : null; + }); + + travelTree( + root, // Visual should calculate from tree root but not view 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 || nodeLayout.invisible || !nodeLayout.isInView) { + 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. + each$1(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$1( + nodeModel, visuals, child, index, mapping, seriesModel + ); + travelTree( + child, childVisual, levelItemStyles, seriesItemStyleModel, + viewRootAncestors, seriesModel + ); + } + }); + } +} + +function buildVisuals( + nodeItemStyleModel, designatedVisual, levelItemStyle, seriesItemStyleModel +) { + var visuals = extend({}, designatedVisual); + + each$1(['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 = modifyHSL(color, null, null, colorSaturation); + } + if (colorAlpha) { + color = modifyAlpha(color, colorAlpha); + } + + return color; + } +} + +function calculateBorderColor(borderColorSaturation, thisNodeColor) { + return thisNodeColor != null + ? 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 visualMin = nodeModel.get('visualMin'); + var visualMax = nodeModel.get('visualMax'); + var dataExtent = nodeLayout.dataExtent.slice(); + visualMin != null && visualMin < dataExtent[0] && (dataExtent[0] = visualMin); + visualMax != null && visualMax > dataExtent[1] && (dataExtent[1] = visualMax); + + var colorMappingBy = nodeModel.get('colorMappingBy'); + var opt = { + type: rangeVisual.name, + dataExtent: 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$2(range) && range.length) ? {name: name, range: range} : null; +} + +function mapVisual$1(nodeModel, visuals, child, index, mapping, seriesModel) { + var childVisuals = 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; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* The treemap layout implementation references to the treemap +* layout of d3.js (d3/src/layout/treemap.js in v3). The use of +* the source code of this file is also subject to the terms +* and consitions of its license (BSD-3Clause, see +* ). +*/ + +var mathMax$4 = Math.max; +var mathMin$4 = Math.min; +var retrieveValue = retrieve; +var each$10 = each$1; + +var PATH_BORDER_WIDTH = ['itemStyle', 'borderWidth']; +var PATH_GAP_WIDTH = ['itemStyle', 'gapWidth']; +var PATH_UPPER_LABEL_SHOW = ['upperLabel', 'show']; +var PATH_UPPER_LABEL_HEIGHT = ['upperLabel', 'height']; + +/** + * @public + */ +var treemapLayout = { + seriesType: 'treemap', + reset: function (seriesModel, ecModel, api, payload) { + // Layout result in each node: + // {x, y, width, height, area, borderWidth} + var ecWidth = api.getWidth(); + var ecHeight = api.getHeight(); + var seriesOption = seriesModel.option; + + var layoutInfo = getLayoutRect( + seriesModel.getBoxLayoutParams(), + { + width: api.getWidth(), + height: api.getHeight() + } + ); + + var size = seriesOption.size || []; // Compatible with ec2. + var containerWidth = parsePercent$1( + retrieveValue(layoutInfo.width, size[0]), + ecWidth + ); + var containerHeight = parsePercent$1( + retrieveValue(layoutInfo.height, size[1]), + ecHeight + ); + + // Fetch payload info. + var payloadType = payload && payload.type; + var types = ['treemapZoomToNode', 'treemapRootToNode']; + var targetInfo = retrieveTargetInfo(payload, types, seriesModel); + var rootRect = (payloadType === 'treemapRender' || payloadType === 'treemapMove') + ? payload.rootRect : null; + var viewRoot = seriesModel.getViewRoot(); + var viewAbovePath = getPathToRoot(viewRoot); + + 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 + }; + + // layout should be cleared because using updateView but not update. + viewRoot.hostTree.clearLayouts(); + + // TODO + // optimize: if out of view clip, do not layout. + // But take care that if do not render node out of view clip, + // how to calculate start po + + var viewRootLayout = { + x: 0, y: 0, + width: rootSize[0], height: rootSize[1], + area: rootSize[0] * rootSize[1] + }; + viewRoot.setLayout(viewRootLayout); + + squarify(viewRoot, options, false, 0); + // Supplement layout. + var viewRootLayout = viewRoot.getLayout(); + each$10(viewAbovePath, function (node, index) { + var childValue = (viewAbovePath[index + 1] || viewRoot).getValue(); + node.setLayout(extend( + {dataExtent: [childValue, childValue], borderWidth: 0, upperHeight: 0}, + viewRootLayout + )); + }); + } + + var treeRoot = seriesModel.getData().tree.root; + + treeRoot.setLayout( + calculateRootPosition(layoutInfo, rootRect, targetInfo), + true + ); + + seriesModel.setLayoutInfo(layoutInfo); + + // FIXME + // 现在没有clip功能,暂时取ec高宽。 + prunning( + treeRoot, + // Transform to base element coordinate system. + new BoundingRect(-layoutInfo.x, -layoutInfo.y, ecWidth, ecHeight), + viewAbovePath, + viewRoot, + 0 + ); + } +}; + +/** + * Layout treemap with squarify algorithm. + * @see https://graphics.ethz.ch/teaching/scivis_common/Literature/squarifiedTreeMaps.pdf + * The implementation references to the treemap layout of d3.js. + * See the license statement at the head of this file. + * + * @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 nodeModel = node.getModel(); + var borderWidth = nodeModel.get(PATH_BORDER_WIDTH); + var halfGapWidth = nodeModel.get(PATH_GAP_WIDTH) / 2; + var upperLabelHeight = getUpperLabelHeight(nodeModel); + var upperHeight = Math.max(borderWidth, upperLabelHeight); + var layoutOffset = borderWidth - halfGapWidth; + var layoutOffsetUpper = upperHeight - halfGapWidth; + var nodeModel = node.getModel(); + + node.setLayout({ + borderWidth: borderWidth, + upperHeight: upperHeight, + upperLabelHeight: upperLabelHeight + }, true); + + width = mathMax$4(width - 2 * layoutOffset, 0); + height = mathMax$4(height - layoutOffset - layoutOffsetUpper, 0); + + var totalArea = width * height; + var viewChildren = initChildren( + node, nodeModel, totalArea, options, hideChildren, depth + ); + + if (!viewChildren.length) { + return; + } + + var rect = {x: layoutOffset, y: layoutOffsetUpper, width: width, height: height}; + var rowFixedLength = mathMin$4(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$4(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 = filter(viewChildren, function (child) { + return !child.isRemoved(); + }); + + sort$1(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$1(viewChildren, orderBy) { + if (orderBy) { + viewChildren.sort(function (a, b) { + var diff = orderBy === 'asc' + ? a.getValue() - b.getValue() : b.getValue() - a.getValue(); + return diff === 0 + ? (orderBy === 'asc' + ? a.dataIndex - b.dataIndex : b.dataIndex - a.dataIndex + ) + : diff; + }); + } + 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]; + each$10(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$4( + (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$4(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$4(modWH - 2 * halfGapWidth, 0); + + nodeLayout[xy[idx1WhenH]] = rect[xy[idx1WhenH]] + mathMin$4(halfGapWidth, wh1 / 2); + nodeLayout[xy[idx0WhenH]] = last + mathMin$4(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; + + // Considering border, suppose aspect ratio is 1. + var parentModel = parent.getModel(); + var borderWidth = parentModel.get(PATH_BORDER_WIDTH); + var upperHeight = Math.max(borderWidth, getUpperLabelHeight(parentModel, borderWidth)); + area += 4 * borderWidth * borderWidth + + (3 * borderWidth + upperHeight) * Math.pow(area, 0.5); + + area > MAX_SAFE_INTEGER && (area = 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 nodes visible for prunning when visual coding and rendering. +// Prunning depends on layout and root position, so we have to do it after layout. +function prunning(node, clipRect, viewAbovePath, viewRoot, depth) { + var nodeLayout = node.getLayout(); + var nodeInViewAbovePath = viewAbovePath[depth]; + var isAboveViewRoot = nodeInViewAbovePath && nodeInViewAbovePath === node; + + if ( + (nodeInViewAbovePath && !isAboveViewRoot) + || (depth === viewAbovePath.length && node !== viewRoot) + ) { + return; + } + + node.setLayout({ + // isInView means: viewRoot sub tree + viewAbovePath + isInView: true, + // invisible only means: outside view clip so that the node can not + // see but still layout for animation preparation but not render. + invisible: !isAboveViewRoot && !clipRect.intersect(nodeLayout), + isAboveViewRoot: isAboveViewRoot + }, true); + + // Transform to child coordinate. + var childClipRect = new BoundingRect( + clipRect.x - nodeLayout.x, + clipRect.y - nodeLayout.y, + clipRect.width, + clipRect.height + ); + + each$10(node.viewChildren || [], function (child) { + prunning(child, childClipRect, viewAbovePath, viewRoot, depth + 1); + }); +} + +function getUpperLabelHeight(model) { + return model.get(PATH_UPPER_LABEL_SHOW) ? model.get(PATH_UPPER_LABEL_HEIGHT) : 0; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerVisual(treemapVisual); +registerLayout(treemapLayout); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Graph data structure + * + * @module echarts/data/Graph + * @author Yi Shen(https://www.github.com/pissang) + */ + +// id may be function name of Object, add a prefix to avoid this problem. +function generateNodeKey (id) { + return '_EC_' + id; +} +/** + * @alias module:echarts/data/Graph + * @constructor + * @param {boolean} directed + */ +var Graph = function(directed) { + /** + * 是否是有向图 + * @type {boolean} + * @private + */ + this._directed = directed || false; + + /** + * @type {Array.} + * @readOnly + */ + this.nodes = []; + + /** + * @type {Array.} + * @readOnly + */ + this.edges = []; + + /** + * @type {Object.} + * @private + */ + this._nodesMap = {}; + /** + * @type {Object.} + * @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) { + id = id || ('' + dataIndex); + + var nodesMap = this._nodesMap; + + if (nodesMap[generateNodeKey(id)]) { + if (__DEV__) { + console.error('Graph nodes have duplicate name or id'); + } + return; + } + + var node = new Node(id, dataIndex); + node.hostGraph = this; + + this.nodes.push(node); + + nodesMap[generateNodeKey(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[generateNodeKey(id)]; +}; + +/** + * Add a new edge + * @param {number|string|module:echarts/data/Graph.Node} n1 + * @param {number|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; + + // PNEDING + if (typeof n1 === 'number') { + n1 = this.nodes[n1]; + } + if (typeof n2 === 'number') { + n2 = this.nodes[n2]; + } + + if (!Node.isInstance(n1)) { + n1 = nodesMap[generateNodeKey(n1)]; + } + if (!Node.isInstance(n2)) { + n2 = nodesMap[generateNodeKey(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 (Node.isInstance(n1)) { + n1 = n1.id; + } + if (Node.isInstance(n2)) { + 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 (!Node.isInstance(startNode)) { + startNode = this._nodesMap[generateNodeKey(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(context, 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; + } +}; + +/** + * @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.} + */ + this.inEdges = []; + /** + * @type {Array.} + */ + this.outEdges = []; + /** + * @type {Array.} + */ + 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$$1) { + this.dataIndex >= 0 + && this[hostName][dataName].setItemLayout(this.dataIndex, layout, merge$$1); + }, + + /** + * @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); + } + }; +}; + +mixin(Node, createGraphDataProxyMixin('hostGraph', 'data')); +mixin(Edge, createGraphDataProxyMixin('hostGraph', 'edgeData')); + +Graph.Node = Node; +Graph.Edge = Edge; + +enableClassCheck(Node); +enableClassCheck(Edge); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 createGraphFromNodeEdge = function (nodes, edges, seriesModel, directed, beforeLink) { + // ??? TODO + // support dataset? + var graph = new Graph(directed); + for (var i = 0; i < nodes.length; i++) { + graph.addNode(retrieve( + // Id, name, dataIndex + nodes[i].id, nodes[i].name, i + ), i); + } + + var linkNameList = []; + var validEdges = []; + var linkCount = 0; + for (var i = 0; i < edges.length; i++) { + var link = edges[i]; + var source = link.source; + var target = link.target; + // addEdge may fail when source or target not exists + if (graph.addEdge(source, target, linkCount)) { + validEdges.push(link); + linkNameList.push(retrieve(link.id, source + ' > ' + target)); + linkCount++; + } + } + + var coordSys = seriesModel.get('coordinateSystem'); + var nodeData; + if (coordSys === 'cartesian2d' || coordSys === 'polar') { + nodeData = createListFromArray(nodes, seriesModel); + } + else { + var coordSysCtor = CoordinateSystemManager.get(coordSys); + var coordDimensions = (coordSysCtor && coordSysCtor.type !== 'view') + ? (coordSysCtor.dimensions || []) : []; + // FIXME: Some geo do not need `value` dimenson, whereas `calendar` needs + // `value` dimension, but graph need `value` dimension. It's better to + // uniform this behavior. + if (indexOf(coordDimensions, 'value') < 0) { + coordDimensions.concat(['value']); + } + + var dimensionNames = createDimensions(nodes, { + coordDimensions: coordDimensions + }); + nodeData = new List(dimensionNames, seriesModel); + nodeData.initData(nodes); + } + + var edgeData = new List(['value'], seriesModel); + edgeData.initData(validEdges, linkNameList); + + beforeLink && beforeLink(nodeData, edgeData); + + linkList({ + mainData: nodeData, + struct: graph, + structAttr: 'graph', + datas: {node: nodeData, edge: edgeData}, + datasAttr: {node: 'data', edge: 'edgeData'} + }); + + // Update dataIndex of nodes and edges because invalid edge may be removed + graph.update(); + + return graph; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 GraphSeries = extendSeriesModel({ + + type: 'series.graph', + + init: function (option) { + GraphSeries.superApply(this, 'init', arguments); + + // Provide data for legend select + this.legendDataProvider = function () { + return this._categoriesData; + }; + + this.fillDataTextStyle(option.edges || option.links); + + this._updateCategoriesData(); + }, + + mergeOption: function (option) { + GraphSeries.superApply(this, 'mergeOption', arguments); + + this.fillDataTextStyle(option.edges || option.links); + + this._updateCategoriesData(); + }, + + mergeDefaultAndTheme: function (option) { + GraphSeries.superApply(this, 'mergeDefaultAndTheme', arguments); + defaultEmphasis(option, ['edgeLabel'], ['show']); + }, + + getInitialData: function (option, ecModel) { + var edges = option.edges || option.links || []; + var nodes = option.data || option.nodes || []; + var self = this; + + if (nodes && edges) { + return createGraphFromNodeEdge(nodes, edges, this, true, beforeLink).data; + } + + function beforeLink(nodeData, edgeData) { + // Overwrite nodeData.getItemModel to + nodeData.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; + }); + + var edgeLabelModel = self.getModel('edgeLabel'); + // For option `edgeLabel` can be found by label.xxx.xxx on item mode. + var fakeSeriesModel = new Model( + {label: edgeLabelModel.option}, + edgeLabelModel.parentModel, + ecModel + ); + var emphasisEdgeLabelModel = self.getModel('emphasis.edgeLabel'); + var emphasisFakeSeriesModel = new Model( + {emphasis: {label: emphasisEdgeLabelModel.option}}, + emphasisEdgeLabelModel.parentModel, + ecModel + ); + + edgeData.wrapMethod('getItemModel', function (model) { + model.customizeGetParent(edgeGetParent); + return model; + }); + + function edgeGetParent(path) { + path = this.parsePath(path); + return (path && path[0] === 'label') + ? fakeSeriesModel + : (path && path[0] === 'emphasis' && path[1] === 'label') + ? emphasisFakeSeriesModel + : this.parentModel; + } + } + }, + + /** + * @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; + }, + + /** + * @override + */ + formatTooltip: function (dataIndex, multipleSeries, dataType) { + if (dataType === 'edge') { + var nodeData = this.getData(); + var params = this.getDataParams(dataIndex, dataType); + var edge = nodeData.graph.getEdgeByIndex(dataIndex); + var sourceName = nodeData.getName(edge.node1.dataIndex); + var targetName = nodeData.getName(edge.node2.dataIndex); + + var html = []; + sourceName != null && html.push(sourceName); + targetName != null && html.push(targetName); + html = encodeHTML(html.join(' > ')); + + if (params.value) { + html += ' : ' + encodeHTML(params.value); + } + return html; + } + else { // dataType === 'node' or empty + return GraphSeries.superApply(this, 'formatTooltip', arguments); + } + }, + + _updateCategoriesData: function () { + var categories = map(this.option.categories || [], function (category) { + // Data must has value + return category.value != null ? category : 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); + }); + }, + + setZoom: function (zoom) { + this.option.zoom = zoom; + }, + + setCenter: function (center) { + this.option.center = center; + }, + + isAnimationEnabled: function () { + return GraphSeries.superCall(this, 'isAnimationEnabled') + // Not enable animation when do force layout + && !(this.get('layout') === 'force' && this.get('force.layoutAnimation')); + }, + + defaultOption: { + zlevel: 0, + z: 2, + + coordinateSystem: 'view', + + // Default option for all coordinate systems + // xAxisIndex: 0, + // yAxisIndex: 0, + // polarIndex: 0, + // geoIndex: 0, + + legendHoverLink: true, + + hoverAnimation: true, + + layout: null, + + focusNodeAdjacency: false, + + // Configuration of circular layout + circular: { + rotateLabel: false + }, + // Configuration of force directed layout + force: { + initLayout: null, + // Node repulsion. Can be an array to represent range. + repulsion: [0, 50], + gravity: 0.1, + + // Edge length. Can be an array to represent range. + edgeLength: 30, + + layoutAnimation: true + }, + + left: 'center', + top: 'center', + // right: null, + // bottom: null, + // width: '80%', + // height: '80%', + + symbol: 'circle', + symbolSize: 10, + + edgeSymbol: ['none', 'none'], + edgeSymbolSize: 10, + edgeLabel: { + position: 'middle' + }, + + draggable: false, + + roam: false, + + // Default on center of graph + center: null, + + zoom: 1, + // Symbol size scale ratio in roam + nodeScaleRatio: 0.6, + // cursor: null, + + // categories: [], + + // data: [] + // Or + // nodes: [] + // + // links: [] + // Or + // edges: [] + + label: { + show: false, + formatter: '{b}' + }, + + itemStyle: {}, + + lineStyle: { + color: '#aaa', + width: 1, + curveness: 0, + opacity: 0.5 + }, + emphasis: { + label: { + show: true + } + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Line path for bezier and straight line draw + */ + +var straightLineProto = Line.prototype; +var bezierCurveProto = BezierCurve.prototype; + +function isLine(shape) { + return isNaN(+shape.cpx1) || isNaN(+shape.cpy1); +} + +var LinePath = 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) { + (isLine(shape) ? straightLineProto : bezierCurveProto).buildPath(ctx, shape); + }, + + pointAt: function (t) { + return isLine(this.shape) + ? straightLineProto.pointAt.call(this, t) + : bezierCurveProto.pointAt.call(this, t); + }, + + tangentAt: function (t) { + var shape = this.shape; + var p = isLine(shape) + ? [shape.x2 - shape.x1, shape.y2 - shape.y1] + : bezierCurveProto.tangentAt.call(this, t); + return normalize(p, p); + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @module echarts/chart/helper/Line + */ + +var SYMBOL_CATEGORIES = ['fromSymbol', 'toSymbol']; + +function makeSymbolTypeKey(symbolCategory) { + return '_' + symbolCategory + 'Type'; +} +/** + * @inner + */ +function createSymbol$1(name, lineData, idx) { + var color = lineData.getItemVisual(idx, 'color'); + var symbolType = lineData.getItemVisual(idx, name); + var symbolSize = lineData.getItemVisual(idx, name + 'Size'); + + if (!symbolType || symbolType === 'none') { + return; + } + + if (!isArray(symbolSize)) { + symbolSize = [symbolSize, symbolSize]; + } + var symbolPath = 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' + }); + 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]; + } + else { + targetShape.cpx1 = NaN; + targetShape.cpy1 = NaN; + } +} + +function updateSymbolAndLabelBeforeLineUpdate () { + var lineGroup = this; + var symbolFrom = lineGroup.childOfName('fromSymbol'); + var symbolTo = lineGroup.childOfName('toSymbol'); + var label = lineGroup.childOfName('label'); + // Quick reject + if (!symbolFrom && !symbolTo && label.ignore) { + return; + } + + var invScale = 1; + var parentNode = this.parent; + while (parentNode) { + if (parentNode.scale) { + invScale /= parentNode.scale[0]; + } + parentNode = parentNode.parent; + } + + var line = lineGroup.childOfName('line'); + // If line not changed + // FIXME Parent scale changed + if (!this.__dirty && !line.__dirty) { + return; + } + + var percent = line.shape.percent; + var fromPos = line.pointAt(0); + var toPos = line.pointAt(percent); + + var d = sub([], toPos, fromPos); + normalize(d, d); + + if (symbolFrom) { + symbolFrom.attr('position', fromPos); + var tangent = line.tangentAt(0); + symbolFrom.attr('rotation', Math.PI / 2 - Math.atan2( + tangent[1], tangent[0] + )); + symbolFrom.attr('scale', [invScale * percent, invScale * percent]); + } + if (symbolTo) { + symbolTo.attr('position', toPos); + var tangent = line.tangentAt(1); + symbolTo.attr('rotation', -Math.PI / 2 - Math.atan2( + tangent[1], tangent[0] + )); + symbolTo.attr('scale', [invScale * percent, invScale * percent]); + } + + if (!label.ignore) { + label.attr('position', toPos); + + var textPosition; + var textAlign; + var textVerticalAlign; + + var distance$$1 = 5 * invScale; + // End + if (label.__position === 'end') { + textPosition = [d[0] * distance$$1 + toPos[0], d[1] * distance$$1 + 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'); + } + // Middle + else if (label.__position === 'middle') { + var halfPercent = percent / 2; + var tangent = line.tangentAt(halfPercent); + var n = [tangent[1], -tangent[0]]; + var cp = line.pointAt(halfPercent); + if (n[1] > 0) { + n[0] = -n[0]; + n[1] = -n[1]; + } + textPosition = [cp[0] + n[0] * distance$$1, cp[1] + n[1] * distance$$1]; + textAlign = 'center'; + textVerticalAlign = 'bottom'; + var rotation = -Math.atan2(tangent[1], tangent[0]); + if (toPos[0] < fromPos[0]) { + rotation = Math.PI + rotation; + } + label.attr('rotation', rotation); + } + // Start + else { + textPosition = [-d[0] * distance$$1 + fromPos[0], -d[1] * distance$$1 + 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, + scale: [invScale, invScale] + }); + } +} + +/** + * @constructor + * @extends {module:zrender/graphic/Group} + * @alias {module:echarts/chart/helper/Line} + */ +function Line$1(lineData, idx, seriesScope) { + Group.call(this); + + this._createLine(lineData, idx, seriesScope); +} + +var lineProto = Line$1.prototype; + +// Update symbol position and rotation +lineProto.beforeUpdate = updateSymbolAndLabelBeforeLineUpdate; + +lineProto._createLine = function (lineData, idx, seriesScope) { + var seriesModel = lineData.hostModel; + var linePoints = lineData.getItemLayout(idx); + + var line = createLine(linePoints); + line.shape.percent = 0; + initProps(line, { + shape: { + percent: 1 + } + }, seriesModel, idx); + + this.add(line); + + var label = new Text({ + name: 'label' + }); + this.add(label); + + each$1(SYMBOL_CATEGORIES, function (symbolCategory) { + var symbol = createSymbol$1(symbolCategory, lineData, 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(symbol); + this[makeSymbolTypeKey(symbolCategory)] = lineData.getItemVisual(idx, symbolCategory); + }, this); + + this._updateCommonStl(lineData, idx, seriesScope); +}; + +lineProto.updateData = function (lineData, idx, seriesScope) { + var seriesModel = lineData.hostModel; + + var line = this.childOfName('line'); + var linePoints = lineData.getItemLayout(idx); + var target = { + shape: {} + }; + setLinePoints(target.shape, linePoints); + updateProps(line, target, seriesModel, idx); + + each$1(SYMBOL_CATEGORIES, function (symbolCategory) { + var symbolType = lineData.getItemVisual(idx, symbolCategory); + var key = makeSymbolTypeKey(symbolCategory); + // Symbol changed + if (this[key] !== symbolType) { + this.remove(this.childOfName(symbolCategory)); + var symbol = createSymbol$1(symbolCategory, lineData, idx); + this.add(symbol); + } + this[key] = symbolType; + }, this); + + this._updateCommonStl(lineData, idx, seriesScope); +}; + +lineProto._updateCommonStl = function (lineData, idx, seriesScope) { + var seriesModel = lineData.hostModel; + + var line = this.childOfName('line'); + + var lineStyle = seriesScope && seriesScope.lineStyle; + var hoverLineStyle = seriesScope && seriesScope.hoverLineStyle; + var labelModel = seriesScope && seriesScope.labelModel; + var hoverLabelModel = seriesScope && seriesScope.hoverLabelModel; + + // Optimization for large dataset + if (!seriesScope || lineData.hasItemOption) { + var itemModel = lineData.getItemModel(idx); + + lineStyle = itemModel.getModel('lineStyle').getLineStyle(); + hoverLineStyle = itemModel.getModel('emphasis.lineStyle').getLineStyle(); + + labelModel = itemModel.getModel('label'); + hoverLabelModel = itemModel.getModel('emphasis.label'); + } + + var visualColor = lineData.getItemVisual(idx, 'color'); + var visualOpacity = retrieve3( + lineData.getItemVisual(idx, 'opacity'), + lineStyle.opacity, + 1 + ); + + line.useStyle(defaults( + { + strokeNoScale: true, + fill: 'none', + stroke: visualColor, + opacity: visualOpacity + }, + lineStyle + )); + line.hoverStyle = hoverLineStyle; + + // Update symbol + each$1(SYMBOL_CATEGORIES, function (symbolCategory) { + var symbol = this.childOfName(symbolCategory); + if (symbol) { + symbol.setColor(visualColor); + symbol.setStyle({ + opacity: visualOpacity + }); + } + }, this); + + var showLabel = labelModel.getShallow('show'); + var hoverShowLabel = hoverLabelModel.getShallow('show'); + + var label = this.childOfName('label'); + var defaultLabelColor; + var baseText; + + // FIXME: the logic below probably should be merged to `graphic.setLabelStyle`. + if (showLabel || hoverShowLabel) { + defaultLabelColor = visualColor || '#000'; + + baseText = seriesModel.getFormattedLabel(idx, 'normal', lineData.dataType); + if (baseText == null) { + var rawVal = seriesModel.getRawValue(idx); + baseText = rawVal == null + ? lineData.getName(idx) + : isFinite(rawVal) + ? round$1(rawVal) + : rawVal; + } + } + var normalText = showLabel ? baseText : null; + var emphasisText = hoverShowLabel + ? retrieve2( + seriesModel.getFormattedLabel(idx, 'emphasis', lineData.dataType), + baseText + ) + : null; + + var labelStyle = label.style; + + // Always set `textStyle` even if `normalStyle.text` is null, because default + // values have to be set on `normalStyle`. + if (normalText != null || emphasisText != null) { + setTextStyle(label.style, labelModel, { + text: normalText + }, { + autoColor: defaultLabelColor + }); + + label.__textAlign = labelStyle.textAlign; + label.__verticalAlign = labelStyle.textVerticalAlign; + // 'start', 'middle', 'end' + label.__position = labelModel.get('position') || 'middle'; + } + + if (emphasisText != null) { + // Only these properties supported in this emphasis style here. + label.hoverStyle = { + text: emphasisText, + textFill: hoverLabelModel.getTextColor(true), + // For merging hover style to normal style, do not use + // `hoverLabelModel.getFont()` here. + fontStyle: hoverLabelModel.getShallow('fontStyle'), + fontWeight: hoverLabelModel.getShallow('fontWeight'), + fontSize: hoverLabelModel.getShallow('fontSize'), + fontFamily: hoverLabelModel.getShallow('fontFamily') + }; + } + else { + label.hoverStyle = { + text: null + }; + } + + label.ignore = !showLabel && !hoverShowLabel; + + setHoverStyle(this); +}; + +lineProto.highlight = function () { + this.trigger('emphasis'); +}; + +lineProto.downplay = function () { + this.trigger('normal'); +}; + +lineProto.updateLayout = function (lineData, idx) { + this.setLinePoints(lineData.getItemLayout(idx)); +}; + +lineProto.setLinePoints = function (points) { + var linePath = this.childOfName('line'); + setLinePoints(linePath.shape, points); + linePath.dirty(); +}; + +inherits(Line$1, Group); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @module echarts/chart/helper/LineDraw + */ + +// import IncrementalDisplayable from 'zrender/src/graphic/IncrementalDisplayable'; + +/** + * @alias module:echarts/component/marker/LineDraw + * @constructor + */ +function LineDraw(ctor) { + this._ctor = ctor || Line$1; + + this.group = new Group(); +} + +var lineDrawProto = LineDraw.prototype; + +lineDrawProto.isPersistent = function () { + return true; +}; + +/** + * @param {module:echarts/data/List} lineData + */ +lineDrawProto.updateData = function (lineData) { + var lineDraw = this; + var group = lineDraw.group; + + var oldLineData = lineDraw._lineData; + lineDraw._lineData = lineData; + + // There is no oldLineData only when first rendering or switching from + // stream mode to normal mode, where previous elements should be removed. + if (!oldLineData) { + group.removeAll(); + } + + var seriesScope = makeSeriesScope$1(lineData); + + lineData.diff(oldLineData) + .add(function (idx) { + doAdd(lineDraw, lineData, idx, seriesScope); + }) + .update(function (newIdx, oldIdx) { + doUpdate(lineDraw, oldLineData, lineData, oldIdx, newIdx, seriesScope); + }) + .remove(function (idx) { + group.remove(oldLineData.getItemGraphicEl(idx)); + }) + .execute(); +}; + +function doAdd(lineDraw, lineData, idx, seriesScope) { + var itemLayout = lineData.getItemLayout(idx); + + if (!lineNeedsDraw(itemLayout)) { + return; + } + + var el = new lineDraw._ctor(lineData, idx, seriesScope); + lineData.setItemGraphicEl(idx, el); + lineDraw.group.add(el); +} + +function doUpdate(lineDraw, oldLineData, newLineData, oldIdx, newIdx, seriesScope) { + var itemEl = oldLineData.getItemGraphicEl(oldIdx); + + if (!lineNeedsDraw(newLineData.getItemLayout(newIdx))) { + lineDraw.group.remove(itemEl); + return; + } + + if (!itemEl) { + itemEl = new lineDraw._ctor(newLineData, newIdx, seriesScope); + } + else { + itemEl.updateData(newLineData, newIdx, seriesScope); + } + + newLineData.setItemGraphicEl(newIdx, itemEl); + + lineDraw.group.add(itemEl); +} + +lineDrawProto.updateLayout = function () { + var lineData = this._lineData; + + // Do not support update layout in incremental mode. + if (!lineData) { + return; + } + + lineData.eachItemGraphicEl(function (el, idx) { + el.updateLayout(lineData, idx); + }, this); +}; + +lineDrawProto.incrementalPrepareUpdate = function (lineData) { + this._seriesScope = makeSeriesScope$1(lineData); + this._lineData = null; + this.group.removeAll(); +}; + +lineDrawProto.incrementalUpdate = function (taskParams, lineData) { + function updateIncrementalAndHover(el) { + if (!el.isGroup) { + el.incremental = el.useHoverLayer = true; + } + } + + for (var idx = taskParams.start; idx < taskParams.end; idx++) { + var itemLayout = lineData.getItemLayout(idx); + + if (lineNeedsDraw(itemLayout)) { + var el = new this._ctor(lineData, idx, this._seriesScope); + el.traverse(updateIncrementalAndHover); + + this.group.add(el); + lineData.setItemGraphicEl(idx, el); + } + } +}; + +function makeSeriesScope$1(lineData) { + var hostModel = lineData.hostModel; + return { + lineStyle: hostModel.getModel('lineStyle').getLineStyle(), + hoverLineStyle: hostModel.getModel('emphasis.lineStyle').getLineStyle(), + labelModel: hostModel.getModel('label'), + hoverLabelModel: hostModel.getModel('emphasis.label') + }; +} + +lineDrawProto.remove = function () { + this._clearIncremental(); + this._incremental = null; + this.group.removeAll(); +}; + +lineDrawProto._clearIncremental = function () { + var incremental = this._incremental; + if (incremental) { + incremental.clearDisplaybles(); + } +}; + +function isPointNaN(pt) { + return isNaN(pt[0]) || isNaN(pt[1]); +} + +function lineNeedsDraw(pts) { + return !isPointNaN(pts[0]) && !isPointNaN(pts[1]); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 v1 = []; +var v2 = []; +var v3 = []; +var quadraticAt$1 = quadraticAt; +var v2DistSquare = distSquare; +var mathAbs$1 = Math.abs; +function intersectCurveCircle(curvePoints, center, radius) { + var p0 = curvePoints[0]; + var p1 = curvePoints[1]; + var p2 = curvePoints[2]; + + var d = Infinity; + var t; + var radiusSquare = radius * radius; + var interval = 0.1; + + for (var _t = 0.1; _t <= 0.9; _t += 0.1) { + v1[0] = quadraticAt$1(p0[0], p1[0], p2[0], _t); + v1[1] = quadraticAt$1(p0[1], p1[1], p2[1], _t); + var diff = mathAbs$1(v2DistSquare(v1, center) - radiusSquare); + if (diff < d) { + d = diff; + t = _t; + } + } + + // Assume the segment is monotone,Find root through Bisection method + // At most 32 iteration + for (var i = 0; i < 32; i++) { + // var prev = t - interval; + var next = t + interval; + // v1[0] = quadraticAt(p0[0], p1[0], p2[0], prev); + // v1[1] = quadraticAt(p0[1], p1[1], p2[1], prev); + v2[0] = quadraticAt$1(p0[0], p1[0], p2[0], t); + v2[1] = quadraticAt$1(p0[1], p1[1], p2[1], t); + v3[0] = quadraticAt$1(p0[0], p1[0], p2[0], next); + v3[1] = quadraticAt$1(p0[1], p1[1], p2[1], next); + + var diff = v2DistSquare(v2, center) - radiusSquare; + if (mathAbs$1(diff) < 1e-2) { + break; + } + + // var prevDiff = v2DistSquare(v1, center) - radiusSquare; + var nextDiff = v2DistSquare(v3, center) - radiusSquare; + + interval /= 2; + if (diff < 0) { + if (nextDiff >= 0) { + t = t + interval; + } + else { + t = t - interval; + } + } + else { + if (nextDiff >= 0) { + t = t - interval; + } + else { + t = t + interval; + } + } + } + + return t; +} + +// Adjust edge to avoid +var adjustEdge = function (graph, scale$$1) { + var tmp0 = []; + var quadraticSubdivide$$1 = quadraticSubdivide; + var pts = [[], [], []]; + var pts2 = [[], []]; + var v = []; + scale$$1 /= 2; + + function getSymbolSize(node) { + var symbolSize = node.getVisual('symbolSize'); + if (symbolSize instanceof Array) { + symbolSize = (symbolSize[0] + symbolSize[1]) / 2; + } + return symbolSize; + } + graph.eachEdge(function (edge, idx) { + var linePoints = edge.getLayout(); + var fromSymbol = edge.getVisual('fromSymbol'); + var toSymbol = edge.getVisual('toSymbol'); + + if (!linePoints.__original) { + linePoints.__original = [ + clone$1(linePoints[0]), + clone$1(linePoints[1]) + ]; + if (linePoints[2]) { + linePoints.__original.push(clone$1(linePoints[2])); + } + } + var originalPoints = linePoints.__original; + // Quadratic curve + if (linePoints[2] != null) { + copy(pts[0], originalPoints[0]); + copy(pts[1], originalPoints[2]); + copy(pts[2], originalPoints[1]); + if (fromSymbol && fromSymbol != 'none') { + var symbolSize = getSymbolSize(edge.node1); + + var t = intersectCurveCircle(pts, originalPoints[0], symbolSize * scale$$1); + // Subdivide and get the second + quadraticSubdivide$$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0); + pts[0][0] = tmp0[3]; + pts[1][0] = tmp0[4]; + quadraticSubdivide$$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0); + pts[0][1] = tmp0[3]; + pts[1][1] = tmp0[4]; + } + if (toSymbol && toSymbol != 'none') { + var symbolSize = getSymbolSize(edge.node2); + + var t = intersectCurveCircle(pts, originalPoints[1], symbolSize * scale$$1); + // Subdivide and get the first + quadraticSubdivide$$1(pts[0][0], pts[1][0], pts[2][0], t, tmp0); + pts[1][0] = tmp0[1]; + pts[2][0] = tmp0[2]; + quadraticSubdivide$$1(pts[0][1], pts[1][1], pts[2][1], t, tmp0); + pts[1][1] = tmp0[1]; + pts[2][1] = tmp0[2]; + } + // Copy back to layout + copy(linePoints[0], pts[0]); + copy(linePoints[1], pts[2]); + copy(linePoints[2], pts[1]); + } + // Line + else { + copy(pts2[0], originalPoints[0]); + copy(pts2[1], originalPoints[1]); + + sub(v, pts2[1], pts2[0]); + normalize(v, v); + if (fromSymbol && fromSymbol != 'none') { + + var symbolSize = getSymbolSize(edge.node1); + + scaleAndAdd(pts2[0], pts2[0], v, symbolSize * scale$$1); + } + if (toSymbol && toSymbol != 'none') { + var symbolSize = getSymbolSize(edge.node2); + + scaleAndAdd(pts2[1], pts2[1], v, -symbolSize * scale$$1); + } + copy(linePoints[0], pts2[0]); + copy(linePoints[1], pts2[1]); + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 nodeOpacityPath = ['itemStyle', 'opacity']; +var lineOpacityPath = ['lineStyle', 'opacity']; + +function getItemOpacity(item, opacityPath) { + return item.getVisual('opacity') || item.getModel().get(opacityPath); +} + +function fadeOutItem(item, opacityPath, opacityRatio) { + var el = item.getGraphicEl(); + + var opacity = getItemOpacity(item, opacityPath); + if (opacityRatio != null) { + opacity == null && (opacity = 1); + opacity *= opacityRatio; + } + + el.downplay && el.downplay(); + el.traverse(function (child) { + if (child.type !== 'group') { + child.setStyle('opacity', opacity); + } + }); +} + +function fadeInItem(item, opacityPath) { + var opacity = getItemOpacity(item, opacityPath); + var el = item.getGraphicEl(); + + el.highlight && el.highlight(); + el.traverse(function (child) { + if (child.type !== 'group') { + child.setStyle('opacity', opacity); + } + }); +} + +extendChartView({ + + type: 'graph', + + init: function (ecModel, api) { + var symbolDraw = new SymbolDraw(); + var lineDraw = new LineDraw(); + var group = this.group; + + this._controller = new RoamController(api.getZr()); + this._controllerHost = {target: group}; + + group.add(symbolDraw.group); + group.add(lineDraw.group); + + this._symbolDraw = symbolDraw; + this._lineDraw = lineDraw; + + this._firstRender = true; + }, + + render: function (seriesModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + + this._model = seriesModel; + this._nodeScaleRatio = seriesModel.get('nodeScaleRatio'); + + var symbolDraw = this._symbolDraw; + var lineDraw = this._lineDraw; + + var group = this.group; + + if (coordSys.type === 'view') { + var groupNewProp = { + position: coordSys.position, + scale: coordSys.scale + }; + if (this._firstRender) { + group.attr(groupNewProp); + } + else { + updateProps(group, groupNewProp, seriesModel); + } + } + // Fix edge contact point with node + adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel)); + + var data = seriesModel.getData(); + symbolDraw.updateData(data); + + var edgeData = seriesModel.getEdgeData(); + lineDraw.updateData(edgeData); + + this._updateNodeAndLinkScale(); + + this._updateController(seriesModel, ecModel, api); + + clearTimeout(this._layoutTimeout); + var forceLayout = seriesModel.forceLayout; + var layoutAnimation = seriesModel.get('force.layoutAnimation'); + if (forceLayout) { + this._startForceLayoutIteration(forceLayout, layoutAnimation); + } + + data.eachItemGraphicEl(function (el, idx) { + var itemModel = data.getItemModel(idx); + // Update draggable + el.off('drag').off('dragend'); + var draggable = itemModel.get('draggable'); + if (draggable) { + el.on('drag', function () { + if (forceLayout) { + 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 () { + if (forceLayout) { + forceLayout.setUnfixed(idx); + } + }, this); + } + el.setDraggable(draggable && forceLayout); + + el.off('mouseover', el.__focusNodeAdjacency); + el.off('mouseout', el.__unfocusNodeAdjacency); + + if (itemModel.get('focusNodeAdjacency')) { + el.on('mouseover', el.__focusNodeAdjacency = function () { + api.dispatchAction({ + type: 'focusNodeAdjacency', + seriesId: seriesModel.id, + dataIndex: el.dataIndex + }); + }); + el.on('mouseout', el.__unfocusNodeAdjacency = function () { + api.dispatchAction({ + type: 'unfocusNodeAdjacency', + seriesId: seriesModel.id + }); + }); + + } + + }, this); + + data.graph.eachEdge(function (edge) { + var el = edge.getGraphicEl(); + + el.off('mouseover', el.__focusNodeAdjacency); + el.off('mouseout', el.__unfocusNodeAdjacency); + + if (edge.getModel().get('focusNodeAdjacency')) { + el.on('mouseover', el.__focusNodeAdjacency = function () { + api.dispatchAction({ + type: 'focusNodeAdjacency', + seriesId: seriesModel.id, + edgeDataIndex: edge.dataIndex + }); + }); + el.on('mouseout', el.__unfocusNodeAdjacency = function () { + api.dispatchAction({ + type: 'unfocusNodeAdjacency', + seriesId: seriesModel.id + }); + }); + } + }); + + var circularRotateLabel = seriesModel.get('layout') === 'circular' + && seriesModel.get('circular.rotateLabel'); + var cx = data.getLayout('cx'); + var cy = data.getLayout('cy'); + data.eachItemGraphicEl(function (el, idx) { + var symbolPath = el.getSymbolPath(); + if (circularRotateLabel) { + var pos = data.getItemLayout(idx); + var rad = Math.atan2(pos[1] - cy, pos[0] - cx); + if (rad < 0) { + rad = Math.PI * 2 + rad; + } + var isLeft = pos[0] < cx; + if (isLeft) { + rad = rad - Math.PI; + } + var textPosition = isLeft ? 'left' : 'right'; + symbolPath.setStyle({ + textRotation: -rad, + textPosition: textPosition, + textOrigin: 'center' + }); + symbolPath.hoverStyle && (symbolPath.hoverStyle.textPosition = textPosition); + } + else { + symbolPath.setStyle({ + textRotation: 0 + }); + } + }); + + this._firstRender = false; + }, + + dispose: function () { + this._controller && this._controller.dispose(); + this._controllerHost = {}; + }, + + focusNodeAdjacency: function (seriesModel, ecModel, api, payload) { + var data = this._model.getData(); + var graph = data.graph; + var dataIndex = payload.dataIndex; + var edgeDataIndex = payload.edgeDataIndex; + + var node = graph.getNodeByIndex(dataIndex); + var edge = graph.getEdgeByIndex(edgeDataIndex); + + if (!node && !edge) { + return; + } + + graph.eachNode(function (node) { + fadeOutItem(node, nodeOpacityPath, 0.1); + }); + graph.eachEdge(function (edge) { + fadeOutItem(edge, lineOpacityPath, 0.1); + }); + + if (node) { + fadeInItem(node, nodeOpacityPath); + each$1(node.edges, function (adjacentEdge) { + if (adjacentEdge.dataIndex < 0) { + return; + } + fadeInItem(adjacentEdge, lineOpacityPath); + fadeInItem(adjacentEdge.node1, nodeOpacityPath); + fadeInItem(adjacentEdge.node2, nodeOpacityPath); + }); + } + if (edge) { + fadeInItem(edge, lineOpacityPath); + fadeInItem(edge.node1, nodeOpacityPath); + fadeInItem(edge.node2, nodeOpacityPath); + } + }, + + unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) { + var graph = this._model.getData().graph; + + graph.eachNode(function (node) { + fadeOutItem(node, nodeOpacityPath); + }); + graph.eachEdge(function (edge) { + fadeOutItem(edge, lineOpacityPath); + }); + }, + + _startForceLayoutIteration: function (forceLayout, layoutAnimation) { + var self = this; + (function step() { + forceLayout.step(function (stopped) { + self.updateLayout(self._model); + (self._layouting = !stopped) && ( + layoutAnimation + ? (self._layoutTimeout = setTimeout(step, 16)) + : step() + ); + }); + })(); + }, + + _updateController: function (seriesModel, ecModel, api) { + var controller = this._controller; + var controllerHost = this._controllerHost; + var group = this.group; + + controller.setPointerChecker(function (e, x, y) { + var rect = group.getBoundingRect(); + rect.applyTransform(group.transform); + return rect.contain(x, y) + && !onIrrelevantElement(e, api, seriesModel); + }); + + if (seriesModel.coordinateSystem.type !== 'view') { + controller.disable(); + return; + } + controller.enable(seriesModel.get('roam')); + controllerHost.zoomLimit = seriesModel.get('scaleLimit'); + controllerHost.zoom = seriesModel.coordinateSystem.getZoom(); + + controller + .off('pan') + .off('zoom') + .on('pan', function (e) { + updateViewOnPan(controllerHost, e.dx, e.dy); + api.dispatchAction({ + seriesId: seriesModel.id, + type: 'graphRoam', + dx: e.dx, + dy: e.dy + }); + }) + .on('zoom', function (e) { + updateViewOnZoom(controllerHost, e.scale, e.originX, e.originY); + api.dispatchAction({ + seriesId: seriesModel.id, + type: 'graphRoam', + zoom: e.scale, + originX: e.originX, + originY: e.originY + }); + this._updateNodeAndLinkScale(); + adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel)); + this._lineDraw.updateLayout(); + }, this); + }, + + _updateNodeAndLinkScale: function () { + var seriesModel = this._model; + var data = seriesModel.getData(); + + var nodeScale = this._getNodeGlobalScale(seriesModel); + var invScale = [nodeScale, nodeScale]; + + data.eachItemGraphicEl(function (el, idx) { + el.attr('scale', invScale); + }); + }, + + _getNodeGlobalScale: function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + if (coordSys.type !== 'view') { + return 1; + } + + var nodeScaleRatio = this._nodeScaleRatio; + + var groupScale = coordSys.scale; + var groupZoom = (groupScale && groupScale[0]) || 1; + // Scale node when zoom changes + var roamZoom = coordSys.getZoom(); + var nodeScale = (roamZoom - 1) * nodeScaleRatio + 1; + + return nodeScale / groupZoom; + }, + + updateLayout: function (seriesModel) { + adjustEdge(seriesModel.getGraph(), this._getNodeGlobalScale(seriesModel)); + + this._symbolDraw.updateLayout(); + this._lineDraw.updateLayout(); + }, + + remove: function (ecModel, api) { + this._symbolDraw && this._symbolDraw.remove(); + this._lineDraw && this._lineDraw.remove(); + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @payload + * @property {number} [seriesIndex] + * @property {string} [seriesId] + * @property {string} [seriesName] + * @property {number} [dataIndex] + */ +registerAction({ + type: 'focusNodeAdjacency', + event: 'focusNodeAdjacency', + update: 'series:focusNodeAdjacency' +}, function () {}); + +/** + * @payload + * @property {number} [seriesIndex] + * @property {string} [seriesId] + * @property {string} [seriesName] + */ +registerAction({ + type: 'unfocusNodeAdjacency', + event: 'unfocusNodeAdjacency', + update: 'series:unfocusNodeAdjacency' +}, function () {}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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] + */ +registerAction(actionInfo, function (payload, ecModel) { + ecModel.eachComponent({mainType: 'series', query: payload}, function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + + var res = updateCenterAndZoom(coordSys, payload); + + seriesModel.setCenter + && seriesModel.setCenter(res.center); + + seriesModel.setZoom + && seriesModel.setZoom(res.zoom); + }); +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 categoryFilter = 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); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 categoryVisual = function (ecModel) { + + var paletteScope = {}; + ecModel.eachSeriesByType('graph', function (seriesModel) { + var categoriesData = seriesModel.getCategoriesData(); + var data = seriesModel.getData(); + + var categoryNameIdxMap = {}; + + categoriesData.each(function (idx) { + var name = categoriesData.getName(idx); + // Add prefix to avoid conflict with Object.prototype. + categoryNameIdxMap['ec-' + name] = idx; + + var itemModel = categoriesData.getItemModel(idx); + var color = itemModel.get('itemStyle.color') + || seriesModel.getColorFromPalette(name, paletteScope); + 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['ec-' + category]; + } + if (!data.getItemVisual(idx, 'color', true)) { + data.setItemVisual( + idx, 'color', + categoriesData.getItemVisual(category, 'color') + ); + } + } + }); + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 normalize$1(a) { + if (!(a instanceof Array)) { + a = [a, a]; + } + return a; +} + +var edgeVisual = function (ecModel) { + ecModel.eachSeriesByType('graph', function (seriesModel) { + var graph = seriesModel.getGraph(); + var edgeData = seriesModel.getEdgeData(); + var symbolType = normalize$1(seriesModel.get('edgeSymbol')); + var symbolSize = normalize$1(seriesModel.get('edgeSymbolSize')); + + var colorQuery = 'lineStyle.color'.split('.'); + var opacityQuery = 'lineStyle.opacity'.split('.'); + + edgeData.setVisual('fromSymbol', symbolType && symbolType[0]); + edgeData.setVisual('toSymbol', symbolType && symbolType[1]); + edgeData.setVisual('fromSymbolSize', symbolSize && symbolSize[0]); + edgeData.setVisual('toSymbolSize', symbolSize && symbolSize[1]); + edgeData.setVisual('color', seriesModel.get(colorQuery)); + edgeData.setVisual('opacity', seriesModel.get(opacityQuery)); + + edgeData.each(function (idx) { + var itemModel = edgeData.getItemModel(idx); + var edge = graph.getEdgeByIndex(idx); + var symbolType = normalize$1(itemModel.getShallow('symbol', true)); + var symbolSize = normalize$1(itemModel.getShallow('symbolSize', true)); + // Edge visual must after node visual + var color = itemModel.get(colorQuery); + var opacity = itemModel.get(opacityQuery); + switch (color) { + case 'source': + color = edge.node1.getVisual('color'); + break; + case 'target': + color = edge.node2.getVisual('color'); + break; + } + + symbolType[0] && edge.setVisual('fromSymbol', symbolType[0]); + symbolType[1] && edge.setVisual('toSymbol', symbolType[1]); + symbolSize[0] && edge.setVisual('fromSymbolSize', symbolSize[0]); + symbolSize[1] && edge.setVisual('toSymbolSize', symbolSize[1]); + + edge.setVisual('color', color); + edge.setVisual('opacity', opacity); + }); + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 simpleLayout$1(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')]); + }); + + simpleLayoutEdge(graph); +} + +function simpleLayoutEdge(graph) { + graph.eachEdge(function (edge) { + var curveness = edge.getModel().get('lineStyle.curveness') || 0; + var p1 = clone$1(edge.node1.getLayout()); + var p2 = clone$1(edge.node2.getLayout()); + var points = [p1, p2]; + if (+curveness) { + points.push([ + (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * curveness, + (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * curveness + ]); + } + edge.setLayout(points); + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 simpleLayout = function (ecModel, api) { + ecModel.eachSeriesByType('graph', function (seriesModel) { + var layout = seriesModel.get('layout'); + var coordSys = seriesModel.coordinateSystem; + if (coordSys && coordSys.type !== 'view') { + var data = seriesModel.getData(); + + var dimensions = []; + each$1(coordSys.dimensions, function (coordDim) { + dimensions = dimensions.concat(data.mapDimension(coordDim, true)); + }); + + for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) { + var value = []; + var hasValue = false; + for (var i = 0; i < dimensions.length; i++) { + var val = data.get(dimensions[i], dataIndex); + if (!isNaN(val)) { + hasValue = true; + } + value.push(val); + } + if (hasValue) { + data.setItemLayout(dataIndex, coordSys.dataToPoint(value)); + } + else { + // Also {Array.}, not undefined to avoid if...else... statement + data.setItemLayout(dataIndex, [NaN, NaN]); + } + } + + simpleLayoutEdge(data.graph); + } + else if (!layout || layout === 'none') { + simpleLayout$1(seriesModel); + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 circularLayout$1(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 : 1) / 2; + + node.setLayout([ + r * Math.cos(angle) + cx, + r * Math.sin(angle) + cy + ]); + + angle += unitAngle * (sum ? value : 1) / 2; + }); + + nodeData.setLayout({ + cx: cx, + cy: cy + }); + + graph.eachEdge(function (edge) { + var curveness = edge.getModel().get('lineStyle.curveness') || 0; + var p1 = clone$1(edge.node1.getLayout()); + var p2 = clone$1(edge.node2.getLayout()); + var cp1; + var x12 = (p1[0] + p2[0]) / 2; + var y12 = (p1[1] + p2[1]) / 2; + if (+curveness) { + curveness *= 3; + cp1 = [ + cx * curveness + x12 * (1 - curveness), + cy * curveness + y12 * (1 - curveness) + ]; + } + edge.setLayout([p1, p2, cp1]); + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 circularLayout = function (ecModel) { + ecModel.eachSeriesByType('graph', function (seriesModel) { + if (seriesModel.get('layout') === 'circular') { + circularLayout$1(seriesModel); + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* The layout implementation references to d3.js. The use of +* the source code of this file is also subject to the terms +* and consitions of its license (BSD-3Clause, see +* ). +*/ + +var scaleAndAdd$2 = scaleAndAdd; + +// function adjacentNode(n, e) { +// return e.n1 === n ? e.n2 : e.n1; +// } + +function forceLayout$1(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 = create( + width * (Math.random() - 0.5) + center[0], + height * (Math.random() - 0.5) + center[1] + ); + // } + } + n.pp = clone$1(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; + + sub(v12, n2.p, n1.p); + var d = len(v12) - e.d; + var w = n2.w / (n1.w + n2.w); + + if (isNaN(w)) { + w = 0; + } + + normalize(v12, v12); + + !n1.fixed && scaleAndAdd$2(n1.p, n1.p, v12, w * d * friction); + !n2.fixed && scaleAndAdd$2(n2.p, n2.p, v12, -(1 - w) * d * friction); + } + // Gravity + for (var i = 0; i < nLen; i++) { + var n = nodes[i]; + if (!n.fixed) { + sub(v12, center, n.p); + // var d = vec2.len(v12); + // vec2.scale(v12, v12, 1 / d); + // var gravityFactor = gravity; + scaleAndAdd$2(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]; + sub(v12, n2.p, n1.p); + var d = len(v12); + if (d === 0) { + // Random repulse + set(v12, Math.random() - 0.5, Math.random() - 0.5); + d = 1; + } + var repFact = (n1.rep + n2.rep) / d / d; + !n1.fixed && scaleAndAdd$2(n1.pp, n1.pp, v12, repFact); + !n2.fixed && scaleAndAdd$2(n2.pp, n2.pp, v12, -repFact); + } + } + var v = []; + for (var i = 0; i < nLen; i++) { + var n = nodes[i]; + if (!n.fixed) { + sub(v, n.p, n.pp); + scaleAndAdd$2(n.p, n.p, v, friction); + copy(n.pp, n.p); + } + } + + friction = friction * 0.992; + + cb && cb(nodes, edges, friction < 0.01); + } + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 forceLayout = function (ecModel) { + ecModel.eachSeriesByType('graph', function (graphSeries) { + var coordSys = graphSeries.coordinateSystem; + if (coordSys && coordSys.type !== 'view') { + return; + } + 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') { + simpleLayout$1(graphSeries); + } + else if (initLayout === 'circular') { + circularLayout$1(graphSeries); + } + + var nodeDataExtent = nodeData.getDataExtent('value'); + var edgeDataExtent = edgeData.getDataExtent('value'); + // var edgeDataExtent = edgeData.getDataExtent('value'); + var repulsion = forceModel.get('repulsion'); + var edgeLength = forceModel.get('edgeLength'); + if (!isArray(repulsion)) { + repulsion = [repulsion, repulsion]; + } + if (!isArray(edgeLength)) { + edgeLength = [edgeLength, edgeLength]; + } + // Larger value has smaller length + edgeLength = [edgeLength[1], edgeLength[0]]; + + var nodes = nodeData.mapArray('value', function (value, idx) { + var point = nodeData.getItemLayout(idx); + var rep = linearMap(value, nodeDataExtent, repulsion); + if (isNaN(rep)) { + rep = (repulsion[0] + repulsion[1]) / 2; + } + return { + w: rep, + rep: rep, + fixed: nodeData.getItemModel(idx).get('fixed'), + p: (!point || isNaN(point[0]) || isNaN(point[1])) ? null : point + }; + }); + var edges = edgeData.mapArray('value', function (value, idx) { + var edge = graph.getEdgeByIndex(idx); + var d = linearMap(value, edgeDataExtent, edgeLength); + if (isNaN(d)) { + d = (edgeLength[0] + edgeLength[1]) / 2; + } + return { + n1: nodes[edge.node1.dataIndex], + n2: nodes[edge.node2.dataIndex], + d: d, + curveness: edge.getModel().get('lineStyle.curveness') || 0 + }; + }); + + var coordSys = graphSeries.coordinateSystem; + var rect = coordSys.getBoundingRect(); + var forceInstance = forceLayout$1(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 + 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 edge = graph.getEdgeByIndex(i); + var p1 = e.n1.p; + var p2 = e.n2.p; + var points = edge.getLayout(); + points = points ? points.slice() : []; + points[0] = points[0] || []; + points[1] = points[1] || []; + copy(points[0], p1); + copy(points[1], p2); + if (+e.curveness) { + points[2] = [ + (p1[0] + p2[0]) / 2 - (p1[1] - p2[1]) * e.curveness, + (p1[1] + p2[1]) / 2 - (p2[0] - p1[0]) * e.curveness + ]; + } + edge.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; + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// FIXME Where to create the simple view coordinate system +function getViewRect$1(seriesModel, api, aspect) { + var option = seriesModel.getBoxLayoutParams(); + option.aspect = aspect; + return getLayoutRect(option, { + width: api.getWidth(), + height: api.getHeight() + }); +} + +var createView = function (ecModel, api) { + var viewList = []; + ecModel.eachSeriesByType('graph', function (seriesModel) { + var coordSysType = seriesModel.get('coordinateSystem'); + if (!coordSysType || coordSysType === 'view') { + + 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 = []; + + fromPoints(positions, min, max); + + // If width or height is 0 + if (max[0] - min[0] === 0) { + max[0] += 1; + min[0] -= 1; + } + if (max[1] - min[1] === 0) { + max[1] += 1; + min[1] -= 1; + } + var aspect = (max[0] - min[0]) / (max[1] - min[1]); + // FIXME If get view rect after data processed? + var viewRect = getViewRect$1(seriesModel, api, aspect); + // Position may be NaN, use view rect instead + if (isNaN(aspect)) { + 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; + + var viewCoordSys = seriesModel.coordinateSystem = new View(); + viewCoordSys.zoomLimit = seriesModel.get('scaleLimit'); + + viewCoordSys.setBoundingRect( + min[0], min[1], bbWidth, bbHeight + ); + viewCoordSys.setViewRect( + viewRect.x, viewRect.y, viewWidth, viewHeight + ); + + // Update roam info + viewCoordSys.setCenter(seriesModel.get('center')); + viewCoordSys.setZoom(seriesModel.get('zoom')); + + viewList.push(viewCoordSys); + } + }); + + return viewList; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerProcessor(categoryFilter); + +registerVisual(visualSymbol('graph', 'circle', null)); +registerVisual(categoryVisual); +registerVisual(edgeVisual); + +registerLayout(simpleLayout); +registerLayout(circularLayout); +registerLayout(forceLayout); + +// Graph view coordinate system +registerCoordinateSystem('graphView', { + create: createView +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 GaugeSeries = SeriesModel.extend({ + + type: 'series.gauge', + + getInitialData: function (option, ecModel) { + var dataOpt = option.data || []; + if (!isArray(dataOpt)) { + dataOpt = [dataOpt]; + } + option.data = dataOpt; + return createListSimply(this, ['value']); + }, + + 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, + distance: 5, + // formatter: null, + color: 'auto' + }, + pointer: { + show: true, + length: '80%', + width: 8 + }, + itemStyle: { + color: 'auto' + }, + title: { + show: true, + // x, y,单位px + offsetCenter: [0, '-40%'], + // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#333', + fontSize: 15 + }, + detail: { + show: true, + backgroundColor: 'rgba(0,0,0,0)', + borderWidth: 0, + borderColor: '#ccc', + width: 100, + height: null, // self-adaption + padding: [5, 10], + // x, y,单位px + offsetCenter: [0, '40%'], + // formatter: null, + // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: 'auto', + fontSize: 30 + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 PointerPath = Path.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; + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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$1(center[0], api.getWidth()); + var cy = parsePercent$1(center[1], api.getHeight()); + var r = parsePercent$1(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 != null ? label : ''); + } + else if (typeof labelFormatter === 'function') { + label = labelFormatter(label); + } + } + + return label; +} + +var PI2$5 = Math.PI * 2; + +var GaugeView = Chart.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 + ); + }, + + dispose: function () {}, + + _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$5; + + var prevEndAngle = startAngle; + var axisLineWidth = lineStyleModel.get('width'); + + for (var i = 0; i < colorList.length; i++) { + // Clamp + var percent = Math.min(Math.max(colorList[i][0], 0), 1); + var endAngle = startAngle + angleRangeSpan * percent; + var sector = new 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$1( + splitLineModel.get('length'), r + ); + var tickLen = parsePercent$1( + 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(); + + 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 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( + round$1(i / splitNumber * (maxVal - minVal) + minVal), + labelModel.get('formatter') + ); + var distance = labelModel.get('distance'); + var autoColor = getColor(i / splitNumber); + + group.add(new Text({ + style: setTextStyle({}, labelModel, { + text: label, + x: unitX * (r - splitLineLen - distance) + cx, + y: unitY * (r - splitLineLen - distance) + cy, + textVerticalAlign: unitY < -0.4 ? 'top' : (unitY > 0.4 ? 'bottom' : 'middle'), + textAlign: unitX < -0.4 ? 'left' : (unitX > 0.4 ? 'right' : 'center') + }, {autoColor: autoColor}), + silent: true + })); + } + + // 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 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 group = this.group; + var oldData = this._data; + + if (!seriesModel.get('pointer.show')) { + // Remove old element + oldData && oldData.eachItemGraphicEl(function (el) { + group.remove(el); + }); + return; + } + + var valueExtent = [+seriesModel.get('min'), +seriesModel.get('max')]; + var angleExtent = [startAngle, endAngle]; + + var data = seriesModel.getData(); + var valueDim = data.mapDimension('value'); + + data.diff(oldData) + .add(function (idx) { + var pointer = new PointerPath({ + shape: { + angle: startAngle + } + }); + + initProps(pointer, { + shape: { + angle: linearMap(data.get(valueDim, idx), valueExtent, angleExtent, true) + } + }, seriesModel); + + group.add(pointer); + data.setItemGraphicEl(idx, pointer); + }) + .update(function (newIdx, oldIdx) { + var pointer = oldData.getItemGraphicEl(oldIdx); + + updateProps(pointer, { + shape: { + angle: linearMap(data.get(valueDim, newIdx), valueExtent, angleExtent, true) + } + }, 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.setShape({ + x: posInfo.cx, + y: posInfo.cy, + width: parsePercent$1( + pointerModel.get('width'), posInfo.r + ), + r: parsePercent$1(pointerModel.get('length'), posInfo.r) + }); + + pointer.useStyle(itemModel.getModel('itemStyle').getItemStyle()); + + if (pointer.style.fill === 'auto') { + pointer.setStyle('fill', getColor( + linearMap(data.get(valueDim, idx), valueExtent, [0, 1], true) + )); + } + + setHoverStyle( + pointer, itemModel.getModel('emphasis.itemStyle').getItemStyle() + ); + }); + + this._data = data; + }, + + _renderTitle: function ( + seriesModel, ecModel, api, getColor, posInfo + ) { + var data = seriesModel.getData(); + var valueDim = data.mapDimension('value'); + var titleModel = seriesModel.getModel('title'); + if (titleModel.get('show')) { + var offsetCenter = titleModel.get('offsetCenter'); + var x = posInfo.cx + parsePercent$1(offsetCenter[0], posInfo.r); + var y = posInfo.cy + parsePercent$1(offsetCenter[1], posInfo.r); + + var minVal = +seriesModel.get('min'); + var maxVal = +seriesModel.get('max'); + var value = seriesModel.getData().get(valueDim, 0); + var autoColor = getColor( + linearMap(value, [minVal, maxVal], [0, 1], true) + ); + + this.group.add(new Text({ + silent: true, + style: setTextStyle({}, titleModel, { + x: x, + y: y, + // FIXME First data name ? + text: data.getName(0), + textAlign: 'center', + textVerticalAlign: 'middle' + }, {autoColor: autoColor, forceRich: true}) + })); + } + }, + + _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 offsetCenter = detailModel.get('offsetCenter'); + var x = posInfo.cx + parsePercent$1(offsetCenter[0], posInfo.r); + var y = posInfo.cy + parsePercent$1(offsetCenter[1], posInfo.r); + var width = parsePercent$1(detailModel.get('width'), posInfo.r); + var height = parsePercent$1(detailModel.get('height'), posInfo.r); + var data = seriesModel.getData(); + var value = data.get(data.mapDimension('value'), 0); + var autoColor = getColor( + linearMap(value, [minVal, maxVal], [0, 1], true) + ); + + this.group.add(new Text({ + silent: true, + style: setTextStyle({}, detailModel, { + x: x, + y: y, + text: formatLabel( + // FIXME First data name ? + value, detailModel.get('formatter') + ), + textWidth: isNaN(width) ? null : width, + textHeight: isNaN(height) ? null : height, + textAlign: 'center', + textVerticalAlign: 'middle' + }, {autoColor: autoColor, forceRich: true}) + })); + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 FunnelSeries = 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.getRawData(); + }; + // Extend labelLine emphasis + this._defaultLabelLine(option); + }, + + getInitialData: function (option, ecModel) { + return createListSimply(this, ['value']); + }, + + _defaultLabelLine: function (option) { + // Extend labelLine emphasis + defaultEmphasis(option, 'labelLine', ['show']); + + var labelLineNormalOpt = option.labelLine; + var labelLineEmphasisOpt = option.emphasis.labelLine; + // Not show label line if `label.normal.show = false` + labelLineNormalOpt.show = labelLineNormalOpt.show + && option.label.show; + labelLineEmphasisOpt.show = labelLineEmphasisOpt.show + && option.emphasis.label.show; + }, + + // Overwrite + getDataParams: function (dataIndex) { + var data = this.getData(); + var params = FunnelSeries.superCall(this, 'getDataParams', dataIndex); + var valueDim = data.mapDimension('value'); + var sum = data.getSum(valueDim); + // Percent is 0 if sum is 0 + params.percent = !sum ? 0 : +(data.get(valueDim, dataIndex) / sum * 100).toFixed(2); + + params.$vars.push('percent'); + return params; + }, + + 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: { + show: true, + position: 'outer' + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + }, + labelLine: { + show: true, + length: 20, + lineStyle: { + // color: 各异, + width: 1, + type: 'solid' + } + }, + itemStyle: { + // color: 各异, + borderColor: '#fff', + borderWidth: 1 + }, + emphasis: { + label: { + show: true + } + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Piece of pie including Sector, Label, LabelLine + * @constructor + * @extends {module:zrender/graphic/Group} + */ +function FunnelPiece(data, idx) { + + Group.call(this); + + var polygon = new Polygon(); + var labelLine = new Polyline(); + var text = new 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; + +var opacityAccessPath = ['itemStyle', '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; + + // Reset style + polygon.useStyle({}); + + if (firstCreate) { + polygon.setShape({ + points: layout.points + }); + polygon.setStyle({ opacity : 0 }); + initProps(polygon, { + style: { + opacity: opacity + } + }, seriesModel, idx); + } + else { + updateProps(polygon, { + style: { + opacity: opacity + }, + shape: { + points: layout.points + } + }, seriesModel, idx); + } + + // Update common style + var itemStyleModel = itemModel.getModel('itemStyle'); + var visualColor = data.getItemVisual(idx, 'color'); + + polygon.setStyle( + defaults( + { + lineJoin: 'round', + fill: visualColor + }, + itemStyleModel.getItemStyle(['opacity']) + ) + ); + polygon.hoverStyle = itemStyleModel.getModel('emphasis').getItemStyle(); + + this._updateLabel(data, idx); + + 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'); + + updateProps(labelLine, { + shape: { + points: labelLayout.linePoints || labelLayout.linePoints + } + }, seriesModel, idx); + + updateProps(labelText, { + style: { + x: labelLayout.x, + y: labelLayout.y + } + }, seriesModel, idx); + labelText.attr({ + rotation: labelLayout.rotation, + origin: [labelLayout.x, labelLayout.y], + z2: 10 + }); + + var labelModel = itemModel.getModel('label'); + var labelHoverModel = itemModel.getModel('emphasis.label'); + var labelLineModel = itemModel.getModel('labelLine'); + var labelLineHoverModel = itemModel.getModel('emphasis.labelLine'); + var visualColor = data.getItemVisual(idx, 'color'); + + setLabelStyle( + labelText.style, labelText.hoverStyle = {}, labelModel, labelHoverModel, + { + labelFetcher: data.hostModel, + labelDataIndex: idx, + defaultText: data.getName(idx), + autoColor: visualColor, + useInsideStyle: !!labelLayout.inside + }, + { + textAlign: labelLayout.textAlign, + textVerticalAlign: labelLayout.verticalAlign + } + ); + + 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()); + + labelLine.hoverStyle = labelLineHoverModel.getModel('lineStyle').getLineStyle(); +}; + +inherits(FunnelPiece, Group); + + +var FunnelView = Chart.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; + }, + + dispose: function () {} +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 getViewRect$2(seriesModel, api) { + return getLayoutRect( + seriesModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + } + ); +} + +function getSortedIndices(data, sort) { + var valueDim = data.mapDimension('value'); + var valueArr = data.mapArray(valueDim, function (val) { + return val; + }); + var indices = []; + var isAscending = sort === 'ascending'; + for (var i = 0, len = data.count(); i < len; i++) { + indices[i] = i; + } + + // Add custom sortable function & none sortable opetion by "options.sort" + if (typeof sort === 'function') { + indices.sort(sort); + } else if (sort !== 'none') { + indices.sort(function (a, b) { + return isAscending ? valueArr[a] - valueArr[b] : valueArr[b] - valueArr[a]; + }); + } + return indices; +} + +function labelLayout$1(data) { + data.each(function (idx) { + var itemModel = data.getItemModel(idx); + var labelModel = itemModel.getModel('label'); + var labelPosition = labelModel.get('position'); + + var labelLineModel = itemModel.getModel('labelLine'); + + 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 + }; + }); +} + +var funnelLayout = function (ecModel, api, payload) { + ecModel.eachSeriesByType('funnel', function (seriesModel) { + var data = seriesModel.getData(); + var valueDim = data.mapDimension('value'); + var sort = seriesModel.get('sort'); + var viewRect = getViewRect$2(seriesModel, api); + var indices = getSortedIndices(data, sort); + + var sizeExtent = [ + parsePercent$1(seriesModel.get('minSize'), viewRect.width), + parsePercent$1(seriesModel.get('maxSize'), viewRect.width) + ]; + var dataExtent = data.getDataExtent(valueDim); + 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(valueDim, idx) || 0; + var itemWidth = 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 itemModel = data.getItemModel(idx); + var height = itemModel.get('itemStyle.height'); + if (height == null) { + height = itemHeight; + } + else { + height = parsePercent$1(height, viewRect.height); + if (sort === 'ascending') { + height = -height; + } + } + + var start = getLinePoints(idx, y); + var end = getLinePoints(nextIdx, y + height); + + y += height + gap; + + data.setItemLayout(idx, { + points: start.concat(end.slice().reverse()) + }); + } + + labelLayout$1(data); + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerVisual(dataColor('funnel')); +registerLayout(funnelLayout); +registerProcessor(dataFilter('funnel')); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 parallelPreprocessor = function (option) { + createParallelIfNeeded(option); + mergeAxisOptionFromParallel(option); +}; + +/** + * Create a parallel coordinate if not exists. + * @inner + */ +function createParallelIfNeeded(option) { + if (option.parallel) { + return; + } + + var hasParallelSeries = false; + + each$1(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 = normalizeToArray(option.parallelAxis); + + each$1(axes, function (axisOption) { + if (!isObject$1(axisOption)) { + return; + } + + var parallelIndex = axisOption.parallelIndex || 0; + var parallelOption = normalizeToArray(option.parallel)[parallelIndex]; + + if (parallelOption && parallelOption.parallelAxisDefault) { + merge(axisOption, parallelOption.parallelAxisDefault, false); + } + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @constructor module:echarts/coord/parallel/ParallelAxis + * @extends {module:echarts/coord/Axis} + * @param {string} dim + * @param {*} scale + * @param {Array.} 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, + + /** + * @override + */ + isHorizontal: function () { + return this.coordinateSystem.getModel().get('layout') !== 'horizontal'; + } + +}; + +inherits(ParallelAxis, Axis); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Calculate slider move result. + * Usage: + * (1) If both handle0 and handle1 are needed to be moved, set minSpan the same as + * maxSpan and the same as `Math.abs(handleEnd[1] - handleEnds[0])`. + * (2) If handle0 is forbidden to cross handle1, set minSpan as `0`. + * + * @param {number} delta Move length. + * @param {Array.} handleEnds handleEnds[0] can be bigger then handleEnds[1]. + * handleEnds will be modified in this method. + * @param {Array.} extent handleEnds is restricted by extent. + * extent[0] should less or equals than extent[1]. + * @param {number|string} handleIndex Can be 'all', means that both move the two handleEnds, + * where the input minSpan and maxSpan will not work. + * @param {number} [minSpan] The range of dataZoom can not be smaller than that. + * If not set, handle0 and cross handle1. If set as a non-negative + * number (including `0`), handles will push each other when reaching + * the minSpan. + * @param {number} [maxSpan] The range of dataZoom can not be larger than that. + * @return {Array.} The input handleEnds. + */ +var sliderMove = function (delta, handleEnds, extent, handleIndex, minSpan, maxSpan) { + // Normalize firstly. + handleEnds[0] = restrict$1(handleEnds[0], extent); + handleEnds[1] = restrict$1(handleEnds[1], extent); + + delta = delta || 0; + + var extentSpan = extent[1] - extent[0]; + + // Notice maxSpan and minSpan can be null/undefined. + if (minSpan != null) { + minSpan = restrict$1(minSpan, [0, extentSpan]); + } + if (maxSpan != null) { + maxSpan = Math.max(maxSpan, minSpan != null ? minSpan : 0); + } + if (handleIndex === 'all') { + minSpan = maxSpan = Math.abs(handleEnds[1] - handleEnds[0]); + handleIndex = 0; + } + + var originalDistSign = getSpanSign(handleEnds, handleIndex); + + handleEnds[handleIndex] += delta; + + // Restrict in extent. + var extentMinSpan = minSpan || 0; + var realExtent = extent.slice(); + originalDistSign.sign < 0 ? (realExtent[0] += extentMinSpan) : (realExtent[1] -= extentMinSpan); + handleEnds[handleIndex] = restrict$1(handleEnds[handleIndex], realExtent); + + // Expand span. + var currDistSign = getSpanSign(handleEnds, handleIndex); + if (minSpan != null && ( + currDistSign.sign !== originalDistSign.sign || currDistSign.span < minSpan + )) { + // If minSpan exists, 'cross' is forbinden. + handleEnds[1 - handleIndex] = handleEnds[handleIndex] + originalDistSign.sign * minSpan; + } + + // Shrink span. + var currDistSign = getSpanSign(handleEnds, handleIndex); + if (maxSpan != null && currDistSign.span > maxSpan) { + handleEnds[1 - handleIndex] = handleEnds[handleIndex] + currDistSign.sign * maxSpan; + } + + return handleEnds; +}; + +function getSpanSign(handleEnds, handleIndex) { + var dist = handleEnds[handleIndex] - handleEnds[1 - handleIndex]; + // If `handleEnds[0] === handleEnds[1]`, always believe that handleEnd[0] + // is at left of handleEnds[1] for non-cross case. + return {span: Math.abs(dist), sign: dist > 0 ? -1 : dist < 0 ? 1 : handleIndex ? -1 : 1}; +} + +function restrict$1(value, extend) { + return Math.min(extend[1], Math.max(extend[0], value)); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Parallel Coordinates + * + */ + +var each$11 = each$1; +var mathMin$5 = Math.min; +var mathMax$5 = Math.max; +var mathFloor$2 = Math.floor; +var mathCeil$2 = Math.ceil; +var round$2 = round$1; + +var PI$3 = Math.PI; + +function Parallel(parallelModel, ecModel, api) { + + /** + * key: dimension + * @type {Object.} + * @private + */ + this._axesMap = createHashMap(); + + /** + * key: dimension + * value: {position: [], rotation, } + * @type {Object.} + * @private + */ + this._axesLayout = {}; + + /** + * Always follow axis order. + * @type {Array.} + * @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$11(dimensions, function (dim, idx) { + + var axisIndex = parallelAxisIndex[idx]; + var axisModel = ecModel.getComponent('parallelAxis', axisIndex); + + var axis = this._axesMap.set(dim, new ParallelAxis( + dim, + createScaleByModel(axisModel), + [0, 0], + axisModel.get('type'), + axisIndex + )); + + var isCategory = axis.type === 'category'; + axis.onBand = isCategory && axisModel.get('boundaryGap'); + axis.inverse = axisModel.get('inverse'); + + // Injection + axisModel.axis = axis; + axis.model = axisModel; + axis.coordinateSystem = axisModel.coordinateSystem = this; + + }, 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); + }, + + /** + * @override + */ + containPoint: function (point) { + var layoutInfo = this._makeLayoutInfo(); + var axisBase = layoutInfo.axisBase; + var layoutBase = layoutInfo.layoutBase; + var pixelDimIndex = layoutInfo.pixelDimIndex; + var pAxis = point[1 - pixelDimIndex]; + var pLayout = point[pixelDimIndex]; + + return pAxis >= axisBase + && pAxis <= axisBase + layoutInfo.axisLength + && pLayout >= layoutBase + && pLayout <= layoutBase + layoutInfo.layoutLength; + }, + + getModel: function () { + return this._model; + }, + + /** + * Update properties from series + * @private + */ + _updateAxesFromSeries: function (parallelModel, ecModel) { + ecModel.eachSeries(function (seriesModel) { + + if (!parallelModel.contains(seriesModel, ecModel)) { + return; + } + + var data = seriesModel.getData(); + + each$11(this.dimensions, function (dim) { + var axis = this._axesMap.get(dim); + axis.scale.unionExtentFromData(data, data.mapDimension(dim)); + niceScaleExtent(axis.scale, 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 = getLayoutRect( + parallelModel.getBoxLayoutParams(), + { + width: api.getWidth(), + height: api.getHeight() + } + ); + + this._layoutAxes(); + }, + + /** + * @return {module:zrender/core/BoundingRect} + */ + getRect: function () { + return this._rect; + }, + + /** + * @private + */ + _makeLayoutInfo: function () { + var parallelModel = this._model; + var rect = this._rect; + var xy = ['x', 'y']; + var wh = ['width', 'height']; + var layout = parallelModel.get('layout'); + var pixelDimIndex = layout === 'horizontal' ? 0 : 1; + var layoutLength = rect[wh[pixelDimIndex]]; + var layoutExtent = [0, layoutLength]; + var axisCount = this.dimensions.length; + + var axisExpandWidth = restrict(parallelModel.get('axisExpandWidth'), layoutExtent); + var axisExpandCount = restrict(parallelModel.get('axisExpandCount') || 0, [0, axisCount]); + var axisExpandable = parallelModel.get('axisExpandable') + && axisCount > 3 + && axisCount > axisExpandCount + && axisExpandCount > 1 + && axisExpandWidth > 0 + && layoutLength > 0; + + // `axisExpandWindow` is According to the coordinates of [0, axisExpandLength], + // for sake of consider the case that axisCollapseWidth is 0 (when screen is narrow), + // where collapsed axes should be overlapped. + var axisExpandWindow = parallelModel.get('axisExpandWindow'); + var winSize; + if (!axisExpandWindow) { + winSize = restrict(axisExpandWidth * (axisExpandCount - 1), layoutExtent); + var axisExpandCenter = parallelModel.get('axisExpandCenter') || mathFloor$2(axisCount / 2); + axisExpandWindow = [axisExpandWidth * axisExpandCenter - winSize / 2]; + axisExpandWindow[1] = axisExpandWindow[0] + winSize; + } + else { + winSize = restrict(axisExpandWindow[1] - axisExpandWindow[0], layoutExtent); + axisExpandWindow[1] = axisExpandWindow[0] + winSize; + } + + var axisCollapseWidth = (layoutLength - winSize) / (axisCount - axisExpandCount); + // Avoid axisCollapseWidth is too small. + axisCollapseWidth < 3 && (axisCollapseWidth = 0); + + // Find the first and last indices > ewin[0] and < ewin[1]. + var winInnerIndices = [ + mathFloor$2(round$2(axisExpandWindow[0] / axisExpandWidth, 1)) + 1, + mathCeil$2(round$2(axisExpandWindow[1] / axisExpandWidth, 1)) - 1 + ]; + + // Pos in ec coordinates. + var axisExpandWindow0Pos = axisCollapseWidth / axisExpandWidth * axisExpandWindow[0]; + + return { + layout: layout, + pixelDimIndex: pixelDimIndex, + layoutBase: rect[xy[pixelDimIndex]], + layoutLength: layoutLength, + axisBase: rect[xy[1 - pixelDimIndex]], + axisLength: rect[wh[1 - pixelDimIndex]], + axisExpandable: axisExpandable, + axisExpandWidth: axisExpandWidth, + axisCollapseWidth: axisCollapseWidth, + axisExpandWindow: axisExpandWindow, + axisCount: axisCount, + winInnerIndices: winInnerIndices, + axisExpandWindow0Pos: axisExpandWindow0Pos + }; + }, + + /** + * @private + */ + _layoutAxes: function () { + var rect = this._rect; + var axes = this._axesMap; + var dimensions = this.dimensions; + var layoutInfo = this._makeLayoutInfo(); + var layout = layoutInfo.layout; + + axes.each(function (axis) { + var axisExtent = [0, layoutInfo.axisLength]; + var idx = axis.inverse ? 1 : 0; + axis.setExtent(axisExtent[idx], axisExtent[1 - idx]); + }); + + each$11(dimensions, function (dim, idx) { + var posInfo = (layoutInfo.axisExpandable + ? layoutAxisWithExpand : layoutAxisWithoutExpand + )(idx, layoutInfo); + + var positionTable = { + horizontal: { + x: posInfo.position, + y: layoutInfo.axisLength + }, + vertical: { + x: 0, + y: posInfo.position + } + }; + var rotationTable = { + horizontal: PI$3 / 2, + vertical: 0 + }; + + var position = [ + positionTable[layout].x + rect.x, + positionTable[layout].y + rect.y + ]; + + var rotation = rotationTable[layout]; + var transform = create$1(); + rotate(transform, transform, rotation); + translate(transform, transform, position); + + // TODO + // tick等排布信息。 + + // TODO + // 根据axis order 更新 dimensions顺序。 + + this._axesLayout[dim] = { + position: position, + rotation: rotation, + transform: transform, + axisNameAvailableWidth: posInfo.axisNameAvailableWidth, + axisLabelShow: posInfo.axisLabelShow, + nameTruncateMaxWidth: posInfo.nameTruncateMaxWidth, + 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.get(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.get(dim).dataToCoord(value), + dim + ); + }, + + /** + * Travel data for one time, get activeState of each data item. + * @param {module:echarts/data/List} data + * @param {Functio} cb param: {string} activeState 'active' or 'inactive' or 'normal' + * {number} dataIndex + * @param {number} [start=0] the start dataIndex that travel from. + * @param {number} [end=data.count()] the next dataIndex of the last dataIndex will be travel. + */ + eachActiveState: function (data, callback, start, end) { + start == null && (start = 0); + end == null && (end = data.count()); + + var axesMap = this._axesMap; + var dimensions = this.dimensions; + var dataDimensions = []; + var axisModels = []; + + each$1(dimensions, function (axisDim) { + dataDimensions.push(data.mapDimension(axisDim)); + axisModels.push(axesMap.get(axisDim).model); + }); + + var hasActiveSet = this.hasAxisBrushed(); + + for (var dataIndex = start; dataIndex < end; dataIndex++) { + var activeState; + + if (!hasActiveSet) { + activeState = 'normal'; + } + else { + activeState = 'active'; + var values = data.getValues(dataDimensions, dataIndex); + for (var j = 0, lenj = dimensions.length; j < lenj; j++) { + var state = axisModels[j].getActiveState(values[j]); + + if (state === 'inactive') { + activeState = 'inactive'; + break; + } + } + } + + callback(activeState, dataIndex); + } + }, + + /** + * Whether has any activeSet. + * @return {boolean} + */ + hasAxisBrushed: function () { + var dimensions = this.dimensions; + var axesMap = this._axesMap; + var hasActiveSet = false; + + for (var j = 0, lenj = dimensions.length; j < lenj; j++) { + if (axesMap.get(dimensions[j]).model.getActiveState() !== 'normal') { + hasActiveSet = true; + } + } + + return hasActiveSet; + }, + + /** + * Convert coords of each axis to Point. + * Return point. For example: [10, 20] + * @param {Array.} coords + * @param {string} dim + * @return {Array.} + */ + axisCoordToPoint: function (coord, dim) { + var axisLayout = this._axesLayout[dim]; + return applyTransform$1([coord, 0], axisLayout.transform); + }, + + /** + * Get axis layout. + */ + getAxisLayout: function (dim) { + return clone(this._axesLayout[dim]); + }, + + /** + * @param {Array.} point + * @return {Object} {axisExpandWindow, delta, behavior: 'jump' | 'slide' | 'none'}. + */ + getSlidedAxisExpandWindow: function (point) { + var layoutInfo = this._makeLayoutInfo(); + var pixelDimIndex = layoutInfo.pixelDimIndex; + var axisExpandWindow = layoutInfo.axisExpandWindow.slice(); + var winSize = axisExpandWindow[1] - axisExpandWindow[0]; + var extent = [0, layoutInfo.axisExpandWidth * (layoutInfo.axisCount - 1)]; + + // Out of the area of coordinate system. + if (!this.containPoint(point)) { + return {behavior: 'none', axisExpandWindow: axisExpandWindow}; + } + + // Conver the point from global to expand coordinates. + var pointCoord = point[pixelDimIndex] - layoutInfo.layoutBase - layoutInfo.axisExpandWindow0Pos; + + // For dragging operation convenience, the window should not be + // slided when mouse is the center area of the window. + var delta; + var behavior = 'slide'; + var axisCollapseWidth = layoutInfo.axisCollapseWidth; + var triggerArea = this._model.get('axisExpandSlideTriggerArea'); + // But consider touch device, jump is necessary. + var useJump = triggerArea[0] != null; + + if (axisCollapseWidth) { + if (useJump && axisCollapseWidth && pointCoord < winSize * triggerArea[0]) { + behavior = 'jump'; + delta = pointCoord - winSize * triggerArea[2]; + } + else if (useJump && axisCollapseWidth && pointCoord > winSize * (1 - triggerArea[0])) { + behavior = 'jump'; + delta = pointCoord - winSize * (1 - triggerArea[2]); + } + else { + (delta = pointCoord - winSize * triggerArea[1]) >= 0 + && (delta = pointCoord - winSize * (1 - triggerArea[1])) <= 0 + && (delta = 0); + } + delta *= layoutInfo.axisExpandWidth / axisCollapseWidth; + delta + ? sliderMove(delta, axisExpandWindow, extent, 'all') + // Avoid nonsense triger on mousemove. + : (behavior = 'none'); + } + // When screen is too narrow, make it visible and slidable, although it is hard to interact. + else { + var winSize = axisExpandWindow[1] - axisExpandWindow[0]; + var pos = extent[1] * pointCoord / winSize; + axisExpandWindow = [mathMax$5(0, pos - winSize / 2)]; + axisExpandWindow[1] = mathMin$5(extent[1], axisExpandWindow[0] + winSize); + axisExpandWindow[0] = axisExpandWindow[1] - winSize; + } + + return { + axisExpandWindow: axisExpandWindow, + behavior: behavior + }; + } +}; + +function restrict(len, extent) { + return mathMin$5(mathMax$5(len, extent[0]), extent[1]); +} + +function layoutAxisWithoutExpand(axisIndex, layoutInfo) { + var step = layoutInfo.layoutLength / (layoutInfo.axisCount - 1); + return { + position: step * axisIndex, + axisNameAvailableWidth: step, + axisLabelShow: true + }; +} + +function layoutAxisWithExpand(axisIndex, layoutInfo) { + var layoutLength = layoutInfo.layoutLength; + var axisExpandWidth = layoutInfo.axisExpandWidth; + var axisCount = layoutInfo.axisCount; + var axisCollapseWidth = layoutInfo.axisCollapseWidth; + var winInnerIndices = layoutInfo.winInnerIndices; + + var position; + var axisNameAvailableWidth = axisCollapseWidth; + var axisLabelShow = false; + var nameTruncateMaxWidth; + + if (axisIndex < winInnerIndices[0]) { + position = axisIndex * axisCollapseWidth; + nameTruncateMaxWidth = axisCollapseWidth; + } + else if (axisIndex <= winInnerIndices[1]) { + position = layoutInfo.axisExpandWindow0Pos + + axisIndex * axisExpandWidth - layoutInfo.axisExpandWindow[0]; + axisNameAvailableWidth = axisExpandWidth; + axisLabelShow = true; + } + else { + position = layoutLength - (axisCount - 1 - axisIndex) * axisCollapseWidth; + nameTruncateMaxWidth = axisCollapseWidth; + } + + return { + position: position, + axisNameAvailableWidth: axisNameAvailableWidth, + axisLabelShow: axisLabelShow, + nameTruncateMaxWidth: nameTruncateMaxWidth + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Parallel coordinate system creater. + */ + +function create$2(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 parallelModel = ecModel.queryComponents({ + mainType: 'parallel', + index: seriesModel.get('parallelIndex'), + id: seriesModel.get('parallelId') + })[0]; + seriesModel.coordinateSystem = parallelModel.coordinateSystem; + } + }); + + return coordSysList; +} + +CoordinateSystemManager.register('parallel', {create: create$2}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 AxisModel$2 = ComponentModel.extend({ + + type: 'baseParallelAxis', + + /** + * @type {module:echarts/coord/parallel/Axis} + */ + axis: null, + + /** + * @type {Array.} + * @readOnly + */ + activeIntervals: [], + + /** + * @return {Object} + */ + getAreaSelectStyle: function () { + return makeStyleMapper( + [ + ['fill', 'color'], + ['lineWidth', 'borderWidth'], + ['stroke', 'borderColor'], + ['width', 'width'], + ['opacity', 'opacity'] + ] + )(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.>} intervals interval.length === 0 + * means set all active. + * @public + */ + setActiveIntervals: function (intervals) { + var activeIntervals = this.activeIntervals = clone(intervals); + + // Normalize + if (activeIntervals) { + for (var i = activeIntervals.length - 1; i >= 0; i--) { + 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 || isNaN(value)) { + return 'inactive'; + } + + // Simple optimization + if (activeIntervals.length === 1) { + var interval = activeIntervals[0]; + if (interval[0] <= value && value <= interval[1]) { + return 'active'; + } + } + else { + 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$1 = { + + type: 'value', + + /** + * @type {Array.} + */ + 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 + }, + + realtime: true, // Whether realtime update view when select. + + z: 10 +}; + +merge(AxisModel$2.prototype, axisModelCommonMixin); + +function getAxisType$1(axisName, option) { + return option.type || (option.data ? 'category' : 'value'); +} + +axisModelCreator('parallel', AxisModel$2, getAxisType$1, defaultOption$1); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +ComponentModel.extend({ + + type: 'parallel', + + dependencies: ['parallelAxis'], + + /** + * @type {module:echarts/coord/parallel/Parallel} + */ + coordinateSystem: null, + + /** + * Each item like: 'dim0', 'dim1', 'dim2', ... + * @type {Array.} + * @readOnly + */ + dimensions: null, + + /** + * Coresponding to dimensions. + * @type {Array.} + * @readOnly + */ + parallelAxisIndex: null, + + layoutMode: 'box', + + 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' + + // FIXME + // naming? + axisExpandable: false, + axisExpandCenter: null, + axisExpandCount: 0, + axisExpandWidth: 50, // FIXME '10%' ? + axisExpandRate: 17, + axisExpandDebounce: 50, + // [out, in, jumpTarget]. In percentage. If use [null, 0.05], null means full. + // Do not doc to user until necessary. + axisExpandSlideTriggerArea: [-0.15, 0.05, 0.4], + axisExpandTriggerOn: 'click', // 'mousemove' or 'click' + + parallelAxisDefault: null + }, + + /** + * @override + */ + init: function () { + ComponentModel.prototype.init.apply(this, arguments); + + this.mergeOption({}); + }, + + /** + * @override + */ + mergeOption: function (newOption) { + var thisOption = this.option; + + newOption && 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; + }, + + setAxisExpand: function (opt) { + each$1( + ['axisExpandable', 'axisExpandCenter', 'axisExpandCount', 'axisExpandWidth', 'axisExpandWindow'], + function (name) { + if (opt.hasOwnProperty(name)) { + this.option[name] = opt[name]; + } + }, + this + ); + }, + + /** + * @private + */ + _initDimensions: function () { + var dimensions = this.dimensions = []; + var parallelAxisIndex = this.parallelAxisIndex = []; + + var axisModels = filter(this.dependentModels.parallelAxis, function (axisModel) { + // Can not use this.contains here, because + // initialization has not been completed yet. + return (axisModel.get('parallelIndex') || 0) === this.componentIndex; + }, this); + + each$1(axisModels, function (axisModel) { + dimensions.push('dim' + axisModel.get('dim')); + parallelAxisIndex.push(axisModel.componentIndex); + }); + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @payload + * @property {string} parallelAxisId + * @property {Array.>} intervals + */ +var actionInfo$1 = { + type: 'axisAreaSelect', + event: 'axisAreaSelected' + // update: 'updateVisual' +}; + +registerAction(actionInfo$1, function (payload, ecModel) { + ecModel.eachComponent( + {mainType: 'parallelAxis', query: payload}, + function (parallelAxisModel) { + parallelAxisModel.axis.model.setActiveIntervals(payload.intervals); + } + ); +}); + +/** + * @payload + */ +registerAction('parallelAxisExpand', function (payload, ecModel) { + ecModel.eachComponent( + {mainType: 'parallel', query: payload}, + function (parallelModel) { + parallelModel.setAxisExpand(payload); + } + ); + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 curry$2 = curry; +var each$12 = each$1; +var map$2 = map; +var mathMin$6 = Math.min; +var mathMax$6 = Math.max; +var mathPow$2 = Math.pow; + +var COVER_Z = 10000; +var UNSELECT_THRESHOLD = 6; +var MIN_RESIZE_LINE_WIDTH = 6; +var MUTEX_RESOURCE_KEY = 'globalPan'; + +var DIRECTION_MAP = { + w: [0, 0], + e: [0, 1], + n: [1, 0], + s: [1, 1] +}; +var CURSOR_MAP = { + w: 'ew', + e: 'ew', + n: 'ns', + s: 'ns', + ne: 'nesw', + sw: 'nesw', + nw: 'nwse', + se: 'nwse' +}; +var DEFAULT_BRUSH_OPT = { + brushStyle: { + lineWidth: 2, + stroke: 'rgba(0,0,0,0.3)', + fill: 'rgba(0,0,0,0.1)' + }, + transformable: true, + brushMode: 'single', + removeOnClick: false +}; + +var baseUID = 0; + +/** + * @alias module:echarts/component/helper/BrushController + * @constructor + * @mixin {module:zrender/mixin/Eventful} + * @event module:echarts/component/helper/BrushController#brush + * params: + * areas: Array., coord relates to container group, + * If no container specified, to global. + * opt { + * isEnd: boolean, + * removeOnClick: boolean + * } + * + * @param {module:zrender/zrender~ZRender} zr + */ +function BrushController(zr) { + + if (__DEV__) { + assert$1(zr); + } + + Eventful.call(this); + + /** + * @type {module:zrender/zrender~ZRender} + * @private + */ + this._zr = zr; + + /** + * @type {module:zrender/container/Group} + * @readOnly + */ + this.group = new Group(); + + /** + * Only for drawing (after enabledBrush). + * 'line', 'rect', 'polygon' or false + * If passing false/null/undefined, disable brush. + * If passing 'auto', determined by panel.defaultBrushType + * @private + * @type {string} + */ + this._brushType; + + /** + * Only for drawing (after enabledBrush). + * + * @private + * @type {Object} + */ + this._brushOption; + + /** + * @private + * @type {Object} + */ + this._panels; + + /** + * @private + * @type {Array.} + */ + this._track = []; + + /** + * @private + * @type {boolean} + */ + this._dragging; + + /** + * @private + * @type {Array} + */ + this._covers = []; + + /** + * @private + * @type {moudule:zrender/container/Group} + */ + this._creatingCover; + + /** + * `true` means global panel + * @private + * @type {module:zrender/container/Group|boolean} + */ + this._creatingPanel; + + /** + * @private + * @type {boolean} + */ + this._enableGlobalPan; + + /** + * @private + * @type {boolean} + */ + if (__DEV__) { + this._mounted; + } + + /** + * @private + * @type {string} + */ + this._uid = 'brushController_' + baseUID++; + + /** + * @private + * @type {Object} + */ + this._handlers = {}; + each$12(mouseHandlers, function (handler, eventName) { + this._handlers[eventName] = bind(handler, this); + }, this); +} + +BrushController.prototype = { + + constructor: BrushController, + + /** + * If set to null/undefined/false, select disabled. + * @param {Object} brushOption + * @param {string|boolean} brushOption.brushType 'line', 'rect', 'polygon' or false + * If passing false/null/undefined, disable brush. + * If passing 'auto', determined by panel.defaultBrushType. + * ('auto' can not be used in global panel) + * @param {number} [brushOption.brushMode='single'] 'single' or 'multiple' + * @param {boolean} [brushOption.transformable=true] + * @param {boolean} [brushOption.removeOnClick=false] + * @param {Object} [brushOption.brushStyle] + * @param {number} [brushOption.brushStyle.width] + * @param {number} [brushOption.brushStyle.lineWidth] + * @param {string} [brushOption.brushStyle.stroke] + * @param {string} [brushOption.brushStyle.fill] + * @param {number} [brushOption.z] + */ + enableBrush: function (brushOption) { + if (__DEV__) { + assert$1(this._mounted); + } + + this._brushType && doDisableBrush(this); + brushOption.brushType && doEnableBrush(this, brushOption); + + return this; + }, + + /** + * @param {Array.} panelOpts If not pass, it is global brush. + * Each items: { + * panelId, // mandatory. + * clipPath, // mandatory. function. + * isTargetByCursor, // mandatory. function. + * defaultBrushType, // optional, only used when brushType is 'auto'. + * getLinearBrushOtherExtent, // optional. function. + * } + */ + setPanels: function (panelOpts) { + if (panelOpts && panelOpts.length) { + var panels = this._panels = {}; + each$1(panelOpts, function (panelOpts) { + panels[panelOpts.panelId] = clone(panelOpts); + }); + } + else { + this._panels = null; + } + return this; + }, + + /** + * @param {Object} [opt] + * @return {boolean} [opt.enableGlobalPan=false] + */ + mount: function (opt) { + opt = opt || {}; + + if (__DEV__) { + this._mounted = true; // should be at first. + } + + this._enableGlobalPan = opt.enableGlobalPan; + + var thisGroup = this.group; + this._zr.add(thisGroup); + + thisGroup.attr({ + position: opt.position || [0, 0], + rotation: opt.rotation || 0, + scale: opt.scale || [1, 1] + }); + this._transform = thisGroup.getLocalTransform(); + + return this; + }, + + eachCover: function (cb, context) { + each$12(this._covers, cb, context); + }, + + /** + * Update covers. + * @param {Array.} brushOptionList Like: + * [ + * {id: 'xx', brushType: 'line', range: [23, 44], brushStyle, transformable}, + * {id: 'yy', brushType: 'rect', range: [[23, 44], [23, 54]]}, + * ... + * ] + * `brushType` is required in each cover info. (can not be 'auto') + * `id` is not mandatory. + * `brushStyle`, `transformable` is not mandatory, use DEFAULT_BRUSH_OPT by default. + * If brushOptionList is null/undefined, all covers removed. + */ + updateCovers: function (brushOptionList) { + if (__DEV__) { + assert$1(this._mounted); + } + + brushOptionList = map(brushOptionList, function (brushOption) { + return merge(clone(DEFAULT_BRUSH_OPT), brushOption, true); + }); + + var tmpIdPrefix = '\0-brush-index-'; + var oldCovers = this._covers; + var newCovers = this._covers = []; + var controller = this; + var creatingCover = this._creatingCover; + + (new DataDiffer(oldCovers, brushOptionList, oldGetKey, getKey)) + .add(addOrUpdate) + .update(addOrUpdate) + .remove(remove) + .execute(); + + return this; + + function getKey(brushOption, index) { + return (brushOption.id != null ? brushOption.id : tmpIdPrefix + index) + + '-' + brushOption.brushType; + } + + function oldGetKey(cover, index) { + return getKey(cover.__brushOption, index); + } + + function addOrUpdate(newIndex, oldIndex) { + var newBrushOption = brushOptionList[newIndex]; + // Consider setOption in event listener of brushSelect, + // where updating cover when creating should be forbiden. + if (oldIndex != null && oldCovers[oldIndex] === creatingCover) { + newCovers[newIndex] = oldCovers[oldIndex]; + } + else { + var cover = newCovers[newIndex] = oldIndex != null + ? ( + oldCovers[oldIndex].__brushOption = newBrushOption, + oldCovers[oldIndex] + ) + : endCreating(controller, createCover(controller, newBrushOption)); + updateCoverAfterCreation(controller, cover); + } + } + + function remove(oldIndex) { + if (oldCovers[oldIndex] !== creatingCover) { + controller.group.remove(oldCovers[oldIndex]); + } + } + }, + + unmount: function () { + if (__DEV__) { + if (!this._mounted) { + return; + } + } + + this.enableBrush(false); + + // container may 'removeAll' outside. + clearCovers(this); + this._zr.remove(this.group); + + if (__DEV__) { + this._mounted = false; // should be at last. + } + + return this; + }, + + dispose: function () { + this.unmount(); + this.off(); + } +}; + +mixin(BrushController, Eventful); + +function doEnableBrush(controller, brushOption) { + var zr = controller._zr; + + // Consider roam, which takes globalPan too. + if (!controller._enableGlobalPan) { + take(zr, MUTEX_RESOURCE_KEY, controller._uid); + } + + each$12(controller._handlers, function (handler, eventName) { + zr.on(eventName, handler); + }); + + controller._brushType = brushOption.brushType; + controller._brushOption = merge(clone(DEFAULT_BRUSH_OPT), brushOption, true); +} + +function doDisableBrush(controller) { + var zr = controller._zr; + + release(zr, MUTEX_RESOURCE_KEY, controller._uid); + + each$12(controller._handlers, function (handler, eventName) { + zr.off(eventName, handler); + }); + + controller._brushType = controller._brushOption = null; +} + +function createCover(controller, brushOption) { + var cover = coverRenderers[brushOption.brushType].createCover(controller, brushOption); + cover.__brushOption = brushOption; + updateZ$1(cover, brushOption); + controller.group.add(cover); + return cover; +} + +function endCreating(controller, creatingCover) { + var coverRenderer = getCoverRenderer(creatingCover); + if (coverRenderer.endCreating) { + coverRenderer.endCreating(controller, creatingCover); + updateZ$1(creatingCover, creatingCover.__brushOption); + } + return creatingCover; +} + +function updateCoverShape(controller, cover) { + var brushOption = cover.__brushOption; + getCoverRenderer(cover).updateCoverShape( + controller, cover, brushOption.range, brushOption + ); +} + +function updateZ$1(cover, brushOption) { + var z = brushOption.z; + z == null && (z = COVER_Z); + cover.traverse(function (el) { + el.z = z; + el.z2 = z; // Consider in given container. + }); +} + +function updateCoverAfterCreation(controller, cover) { + getCoverRenderer(cover).updateCommon(controller, cover); + updateCoverShape(controller, cover); +} + +function getCoverRenderer(cover) { + return coverRenderers[cover.__brushOption.brushType]; +} + +// return target panel or `true` (means global panel) +function getPanelByPoint(controller, e, localCursorPoint) { + var panels = controller._panels; + if (!panels) { + return true; // Global panel + } + var panel; + var transform = controller._transform; + each$12(panels, function (pn) { + pn.isTargetByCursor(e, localCursorPoint, transform) && (panel = pn); + }); + return panel; +} + +// Return a panel or true +function getPanelByCover(controller, cover) { + var panels = controller._panels; + if (!panels) { + return true; // Global panel + } + var panelId = cover.__brushOption.panelId; + // User may give cover without coord sys info, + // which is then treated as global panel. + return panelId != null ? panels[panelId] : true; +} + +function clearCovers(controller) { + var covers = controller._covers; + var originalLength = covers.length; + each$12(covers, function (cover) { + controller.group.remove(cover); + }, controller); + covers.length = 0; + + return !!originalLength; +} + +function trigger$1(controller, opt) { + var areas = map$2(controller._covers, function (cover) { + var brushOption = cover.__brushOption; + var range = clone(brushOption.range); + return { + brushType: brushOption.brushType, + panelId: brushOption.panelId, + range: range + }; + }); + + controller.trigger('brush', areas, { + isEnd: !!opt.isEnd, + removeOnClick: !!opt.removeOnClick + }); +} + +function shouldShowCover(controller) { + var track = controller._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$2(dx * dx + dy * dy, 0.5); + + return dist > UNSELECT_THRESHOLD; +} + +function getTrackEnds(track) { + var tail = track.length - 1; + tail < 0 && (tail = 0); + return [track[0], track[tail]]; +} + +function createBaseRectCover(doDrift, controller, brushOption, edgeNames) { + var cover = new Group(); + + cover.add(new Rect({ + name: 'main', + style: makeStyle(brushOption), + silent: true, + draggable: true, + cursor: 'move', + drift: curry$2(doDrift, controller, cover, 'nswe'), + ondragend: curry$2(trigger$1, controller, {isEnd: true}) + })); + + each$12( + edgeNames, + function (name) { + cover.add(new Rect({ + name: name, + style: {opacity: 0}, + draggable: true, + silent: true, + invisible: true, + drift: curry$2(doDrift, controller, cover, name), + ondragend: curry$2(trigger$1, controller, {isEnd: true}) + })); + } + ); + + return cover; +} + +function updateBaseRect(controller, cover, localRange, brushOption) { + var lineWidth = brushOption.brushStyle.lineWidth || 0; + var handleSize = mathMax$6(lineWidth, MIN_RESIZE_LINE_WIDTH); + var x = localRange[0][0]; + var y = localRange[1][0]; + var xa = x - lineWidth / 2; + var ya = y - lineWidth / 2; + var x2 = localRange[0][1]; + var y2 = localRange[1][1]; + var x2a = x2 - handleSize + lineWidth / 2; + var y2a = y2 - handleSize + lineWidth / 2; + var width = x2 - x; + var height = y2 - y; + var widtha = width + lineWidth; + var heighta = height + lineWidth; + + updateRectShape(controller, cover, 'main', x, y, width, height); + + if (brushOption.transformable) { + updateRectShape(controller, cover, 'w', xa, ya, handleSize, heighta); + updateRectShape(controller, cover, 'e', x2a, ya, handleSize, heighta); + updateRectShape(controller, cover, 'n', xa, ya, widtha, handleSize); + updateRectShape(controller, cover, 's', xa, y2a, widtha, handleSize); + + updateRectShape(controller, cover, 'nw', xa, ya, handleSize, handleSize); + updateRectShape(controller, cover, 'ne', x2a, ya, handleSize, handleSize); + updateRectShape(controller, cover, 'sw', xa, y2a, handleSize, handleSize); + updateRectShape(controller, cover, 'se', x2a, y2a, handleSize, handleSize); + } +} + +function updateCommon(controller, cover) { + var brushOption = cover.__brushOption; + var transformable = brushOption.transformable; + + var mainEl = cover.childAt(0); + mainEl.useStyle(makeStyle(brushOption)); + mainEl.attr({ + silent: !transformable, + cursor: transformable ? 'move' : 'default' + }); + + each$12( + ['w', 'e', 'n', 's', 'se', 'sw', 'ne', 'nw'], + function (name) { + var el = cover.childOfName(name); + var globalDir = getGlobalDirection(controller, name); + + el && el.attr({ + silent: !transformable, + invisible: !transformable, + cursor: transformable ? CURSOR_MAP[globalDir] + '-resize' : null + }); + } + ); +} + +function updateRectShape(controller, cover, name, x, y, w, h) { + var el = cover.childOfName(name); + el && el.setShape(pointsToRect( + clipByPanel(controller, cover, [[x, y], [x + w, y + h]]) + )); +} + +function makeStyle(brushOption) { + return defaults({strokeNoScale: true}, brushOption.brushStyle); +} + +function formatRectRange(x, y, x2, y2) { + var min = [mathMin$6(x, x2), mathMin$6(y, y2)]; + var max = [mathMax$6(x, x2), mathMax$6(y, y2)]; + + return [ + [min[0], max[0]], // x range + [min[1], max[1]] // y range + ]; +} + +function getTransform$1(controller) { + return getTransform(controller.group); +} + +function getGlobalDirection(controller, localDirection) { + if (localDirection.length > 1) { + localDirection = localDirection.split(''); + var globalDir = [ + getGlobalDirection(controller, localDirection[0]), + getGlobalDirection(controller, localDirection[1]) + ]; + (globalDir[0] === 'e' || globalDir[0] === 'w') && globalDir.reverse(); + return globalDir.join(''); + } + else { + var map$$1 = {w: 'left', e: 'right', n: 'top', s: 'bottom'}; + var inverseMap = {left: 'w', right: 'e', top: 'n', bottom: 's'}; + var globalDir = transformDirection( + map$$1[localDirection], getTransform$1(controller) + ); + return inverseMap[globalDir]; + } +} + +function driftRect(toRectRange, fromRectRange, controller, cover, name, dx, dy, e) { + var brushOption = cover.__brushOption; + var rectRange = toRectRange(brushOption.range); + var localDelta = toLocalDelta(controller, dx, dy); + + each$12(name.split(''), function (namePart) { + var ind = DIRECTION_MAP[namePart]; + rectRange[ind[0]][ind[1]] += localDelta[ind[0]]; + }); + + brushOption.range = fromRectRange(formatRectRange( + rectRange[0][0], rectRange[1][0], rectRange[0][1], rectRange[1][1] + )); + + updateCoverAfterCreation(controller, cover); + trigger$1(controller, {isEnd: false}); +} + +function driftPolygon(controller, cover, dx, dy, e) { + var range = cover.__brushOption.range; + var localDelta = toLocalDelta(controller, dx, dy); + + each$12(range, function (point) { + point[0] += localDelta[0]; + point[1] += localDelta[1]; + }); + + updateCoverAfterCreation(controller, cover); + trigger$1(controller, {isEnd: false}); +} + +function toLocalDelta(controller, dx, dy) { + var thisGroup = controller.group; + var localD = thisGroup.transformCoordToLocal(dx, dy); + var localZero = thisGroup.transformCoordToLocal(0, 0); + + return [localD[0] - localZero[0], localD[1] - localZero[1]]; +} + +function clipByPanel(controller, cover, data) { + var panel = getPanelByCover(controller, cover); + + return (panel && panel !== true) + ? panel.clipPath(data, controller._transform) + : clone(data); +} + +function pointsToRect(points) { + var xmin = mathMin$6(points[0][0], points[1][0]); + var ymin = mathMin$6(points[0][1], points[1][1]); + var xmax = mathMax$6(points[0][0], points[1][0]); + var ymax = mathMax$6(points[0][1], points[1][1]); + + return { + x: xmin, + y: ymin, + width: xmax - xmin, + height: ymax - ymin + }; +} + +function resetCursor(controller, e, localCursorPoint) { + // Check active + if (!controller._brushType) { + return; + } + + var zr = controller._zr; + var covers = controller._covers; + var currPanel = getPanelByPoint(controller, e, localCursorPoint); + + // Check whether in covers. + if (!controller._dragging) { + for (var i = 0; i < covers.length; i++) { + var brushOption = covers[i].__brushOption; + if (currPanel + && (currPanel === true || brushOption.panelId === currPanel.panelId) + && coverRenderers[brushOption.brushType].contain( + covers[i], localCursorPoint[0], localCursorPoint[1] + ) + ) { + // Use cursor style set on cover. + return; + } + } + } + + currPanel && zr.setCursorStyle('crosshair'); +} + +function preventDefault(e) { + var rawE = e.event; + rawE.preventDefault && rawE.preventDefault(); +} + +function mainShapeContain(cover, x, y) { + return cover.childOfName('main').contain(x, y); +} + +function updateCoverByMouse(controller, e, localCursorPoint, isEnd) { + var creatingCover = controller._creatingCover; + var panel = controller._creatingPanel; + var thisBrushOption = controller._brushOption; + var eventParams; + + controller._track.push(localCursorPoint.slice()); + + if (shouldShowCover(controller) || creatingCover) { + + if (panel && !creatingCover) { + thisBrushOption.brushMode === 'single' && clearCovers(controller); + var brushOption = clone(thisBrushOption); + brushOption.brushType = determineBrushType(brushOption.brushType, panel); + brushOption.panelId = panel === true ? null : panel.panelId; + creatingCover = controller._creatingCover = createCover(controller, brushOption); + controller._covers.push(creatingCover); + } + + if (creatingCover) { + var coverRenderer = coverRenderers[determineBrushType(controller._brushType, panel)]; + var coverBrushOption = creatingCover.__brushOption; + + coverBrushOption.range = coverRenderer.getCreatingRange( + clipByPanel(controller, creatingCover, controller._track) + ); + + if (isEnd) { + endCreating(controller, creatingCover); + coverRenderer.updateCommon(controller, creatingCover); + } + + updateCoverShape(controller, creatingCover); + + eventParams = {isEnd: isEnd}; + } + } + else if ( + isEnd + && thisBrushOption.brushMode === 'single' + && thisBrushOption.removeOnClick + ) { + // Help user to remove covers easily, only by a tiny drag, in 'single' mode. + // But a single click do not clear covers, because user may have casual + // clicks (for example, click on other component and do not expect covers + // disappear). + // Only some cover removed, trigger action, but not every click trigger action. + if (getPanelByPoint(controller, e, localCursorPoint) && clearCovers(controller)) { + eventParams = {isEnd: isEnd, removeOnClick: true}; + } + } + + return eventParams; +} + +function determineBrushType(brushType, panel) { + if (brushType === 'auto') { + if (__DEV__) { + assert$1( + panel && panel.defaultBrushType, + 'MUST have defaultBrushType when brushType is "atuo"' + ); + } + return panel.defaultBrushType; + } + return brushType; +} + +var mouseHandlers = { + + mousedown: function (e) { + if (this._dragging) { + // In case some browser do not support globalOut, + // and release mose out side the browser. + handleDragEnd.call(this, e); + } + else if (!e.target || !e.target.draggable) { + + preventDefault(e); + + var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); + + this._creatingCover = null; + var panel = this._creatingPanel = getPanelByPoint(this, e, localCursorPoint); + + if (panel) { + this._dragging = true; + this._track = [localCursorPoint.slice()]; + } + } + }, + + mousemove: function (e) { + var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); + + resetCursor(this, e, localCursorPoint); + + if (this._dragging) { + + preventDefault(e); + + var eventParams = updateCoverByMouse(this, e, localCursorPoint, false); + + eventParams && trigger$1(this, eventParams); + } + }, + + mouseup: handleDragEnd //, + + // FIXME + // in tooltip, globalout should not be triggered. + // globalout: handleDragEnd +}; + +function handleDragEnd(e) { + if (this._dragging) { + + preventDefault(e); + + var localCursorPoint = this.group.transformCoordToLocal(e.offsetX, e.offsetY); + var eventParams = updateCoverByMouse(this, e, localCursorPoint, true); + + this._dragging = false; + this._track = []; + this._creatingCover = null; + + // trigger event shoule be at final, after procedure will be nested. + eventParams && trigger$1(this, eventParams); + } +} + +/** + * key: brushType + * @type {Object} + */ +var coverRenderers = { + + lineX: getLineRenderer(0), + + lineY: getLineRenderer(1), + + rect: { + createCover: function (controller, brushOption) { + return createBaseRectCover( + curry$2( + driftRect, + function (range) { + return range; + }, + function (range) { + return range; + } + ), + controller, + brushOption, + ['w', 'e', 'n', 's', 'se', 'sw', 'ne', 'nw'] + ); + }, + getCreatingRange: function (localTrack) { + var ends = getTrackEnds(localTrack); + return formatRectRange(ends[1][0], ends[1][1], ends[0][0], ends[0][1]); + }, + updateCoverShape: function (controller, cover, localRange, brushOption) { + updateBaseRect(controller, cover, localRange, brushOption); + }, + updateCommon: updateCommon, + contain: mainShapeContain + }, + + polygon: { + createCover: function (controller, brushOption) { + var cover = new Group(); + + // Do not use graphic.Polygon because graphic.Polyline do not close the + // border of the shape when drawing, which is a better experience for user. + cover.add(new Polyline({ + name: 'main', + style: makeStyle(brushOption), + silent: true + })); + + return cover; + }, + getCreatingRange: function (localTrack) { + return localTrack; + }, + endCreating: function (controller, cover) { + cover.remove(cover.childAt(0)); + // Use graphic.Polygon close the shape. + cover.add(new Polygon({ + name: 'main', + draggable: true, + drift: curry$2(driftPolygon, controller, cover), + ondragend: curry$2(trigger$1, controller, {isEnd: true}) + })); + }, + updateCoverShape: function (controller, cover, localRange, brushOption) { + cover.childAt(0).setShape({ + points: clipByPanel(controller, cover, localRange) + }); + }, + updateCommon: updateCommon, + contain: mainShapeContain + } +}; + +function getLineRenderer(xyIndex) { + return { + createCover: function (controller, brushOption) { + return createBaseRectCover( + curry$2( + driftRect, + function (range) { + var rectRange = [range, [0, 100]]; + xyIndex && rectRange.reverse(); + return rectRange; + }, + function (rectRange) { + return rectRange[xyIndex]; + } + ), + controller, + brushOption, + [['w', 'e'], ['n', 's']][xyIndex] + ); + }, + getCreatingRange: function (localTrack) { + var ends = getTrackEnds(localTrack); + var min = mathMin$6(ends[0][xyIndex], ends[1][xyIndex]); + var max = mathMax$6(ends[0][xyIndex], ends[1][xyIndex]); + + return [min, max]; + }, + updateCoverShape: function (controller, cover, localRange, brushOption) { + var otherExtent; + // If brushWidth not specified, fit the panel. + var panel = getPanelByCover(controller, cover); + if (panel !== true && panel.getLinearBrushOtherExtent) { + otherExtent = panel.getLinearBrushOtherExtent( + xyIndex, controller._transform + ); + } + else { + var zr = controller._zr; + otherExtent = [0, [zr.getWidth(), zr.getHeight()][1 - xyIndex]]; + } + var rectRange = [localRange, otherExtent]; + xyIndex && rectRange.reverse(); + + updateBaseRect(controller, cover, rectRange, brushOption); + }, + updateCommon: updateCommon, + contain: mainShapeContain + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 makeRectPanelClipPath(rect) { + rect = normalizeRect(rect); + return function (localPoints, transform) { + return clipPointsByRect(localPoints, rect); + }; +} + +function makeLinearBrushOtherExtent(rect, specifiedXYIndex) { + rect = normalizeRect(rect); + return function (xyIndex) { + var idx = specifiedXYIndex != null ? specifiedXYIndex : xyIndex; + var brushWidth = idx ? rect.width : rect.height; + var base = idx ? rect.x : rect.y; + return [base, base + (brushWidth || 0)]; + }; +} + +function makeRectIsTargetByCursor(rect, api, targetModel) { + rect = normalizeRect(rect); + return function (e, localCursorPoint, transform) { + return rect.contain(localCursorPoint[0], localCursorPoint[1]) + && !onIrrelevantElement(e, api, targetModel); + }; +} + +// Consider width/height is negative. +function normalizeRect(rect) { + return BoundingRect.create(rect); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 elementList = ['axisLine', 'axisTickLabel', 'axisName']; + +var AxisView$2 = extendComponentView({ + + type: 'parallelAxis', + + /** + * @override + */ + init: function (ecModel, api) { + AxisView$2.superApply(this, 'init', arguments); + + /** + * @type {module:echarts/component/helper/BrushController} + */ + (this._brushController = new BrushController(api.getZr())) + .on('brush', bind(this._onBrush, this)); + }, + + /** + * @override + */ + render: function (axisModel, ecModel, api, payload) { + if (fromAxisAreaSelect(axisModel, ecModel, payload)) { + return; + } + + this.axisModel = axisModel; + this.api = api; + + this.group.removeAll(); + + var oldAxisGroup = this._axisGroup; + this._axisGroup = new Group(); + this.group.add(this._axisGroup); + + if (!axisModel.get('show')) { + return; + } + + var coordSysModel = getCoordSysModel(axisModel, ecModel); + var coordSys = coordSysModel.coordinateSystem; + + var areaSelectStyle = axisModel.getAreaSelectStyle(); + var areaWidth = areaSelectStyle.width; + + var dim = axisModel.axis.dim; + var axisLayout = coordSys.getAxisLayout(dim); + + var builderOpt = extend( + {strokeContainThreshold: areaWidth}, + axisLayout + ); + + var axisBuilder = new AxisBuilder(axisModel, builderOpt); + + each$1(elementList, axisBuilder.add, axisBuilder); + + this._axisGroup.add(axisBuilder.getGroup()); + + this._refreshBrushController( + builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api + ); + + var animationModel = (payload && payload.animation === false) ? null : axisModel; + groupTransition(oldAxisGroup, this._axisGroup, animationModel); + }, + + // /** + // * @override + // */ + // updateVisual: function (axisModel, ecModel, api, payload) { + // this._brushController && this._brushController + // .updateCovers(getCoverInfoList(axisModel)); + // }, + + _refreshBrushController: function ( + builderOpt, areaSelectStyle, axisModel, coordSysModel, areaWidth, api + ) { + // After filtering, axis may change, select area needs to be update. + var extent = axisModel.axis.getExtent(); + var extentLen = extent[1] - extent[0]; + var extra = Math.min(30, Math.abs(extentLen) * 0.1); // Arbitrary value. + + // width/height might be negative, which will be + // normalized in BoundingRect. + var rect = BoundingRect.create({ + x: extent[0], + y: -areaWidth / 2, + width: extentLen, + height: areaWidth + }); + rect.x -= extra; + rect.width += 2 * extra; + + this._brushController + .mount({ + enableGlobalPan: true, + rotation: builderOpt.rotation, + position: builderOpt.position + }) + .setPanels([{ + panelId: 'pl', + clipPath: makeRectPanelClipPath(rect), + isTargetByCursor: makeRectIsTargetByCursor(rect, api, coordSysModel), + getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect, 0) + }]) + .enableBrush({ + brushType: 'lineX', + brushStyle: areaSelectStyle, + removeOnClick: true + }) + .updateCovers(getCoverInfoList(axisModel)); + }, + + _onBrush: function (coverInfoList, opt) { + // Do not cache these object, because the mey be changed. + var axisModel = this.axisModel; + var axis = axisModel.axis; + var intervals = map(coverInfoList, function (coverInfo) { + return [ + axis.coordToData(coverInfo.range[0], true), + axis.coordToData(coverInfo.range[1], true) + ]; + }); + + // If realtime is true, action is not dispatched on drag end, because + // the drag end emits the same params with the last drag move event, + // and may have some delay when using touch pad. + if (!axisModel.option.realtime === opt.isEnd || opt.removeOnClick) { // jshint ignore:line + this.api.dispatchAction({ + type: 'axisAreaSelect', + parallelAxisId: axisModel.id, + intervals: intervals + }); + } + }, + + /** + * @override + */ + dispose: function () { + this._brushController.dispose(); + } +}); + +function fromAxisAreaSelect(axisModel, ecModel, payload) { + return payload + && payload.type === 'axisAreaSelect' + && ecModel.findComponents( + {mainType: 'parallelAxis', query: payload} + )[0] === axisModel; +} + +function getCoverInfoList(axisModel) { + var axis = axisModel.axis; + return map(axisModel.activeIntervals, function (interval) { + return { + brushType: 'lineX', + panelId: 'pl', + range: [ + axis.dataToCoord(interval[0], true), + axis.dataToCoord(interval[1], true) + ] + }; + }); +} + +function getCoordSysModel(axisModel, ecModel) { + return ecModel.getComponent( + 'parallel', axisModel.get('parallelIndex') + ); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 CLICK_THRESHOLD = 5; // > 4 + +// Parallel view +extendComponentView({ + type: 'parallel', + + render: function (parallelModel, ecModel, api) { + this._model = parallelModel; + this._api = api; + + if (!this._handlers) { + this._handlers = {}; + each$1(handlers, function (handler, eventName) { + api.getZr().on(eventName, this._handlers[eventName] = bind(handler, this)); + }, this); + } + + createOrUpdate( + this, + '_throttledDispatchExpand', + parallelModel.get('axisExpandRate'), + 'fixRate' + ); + }, + + dispose: function (ecModel, api) { + each$1(this._handlers, function (handler, eventName) { + api.getZr().off(eventName, handler); + }); + this._handlers = null; + }, + + /** + * @param {Object} [opt] If null, cancle the last action triggering for debounce. + */ + _throttledDispatchExpand: function (opt) { + this._dispatchExpand(opt); + }, + + _dispatchExpand: function (opt) { + opt && this._api.dispatchAction( + extend({type: 'parallelAxisExpand'}, opt) + ); + } + +}); + +var handlers = { + + mousedown: function (e) { + if (checkTrigger(this, 'click')) { + this._mouseDownPoint = [e.offsetX, e.offsetY]; + } + }, + + mouseup: function (e) { + var mouseDownPoint = this._mouseDownPoint; + + if (checkTrigger(this, 'click') && mouseDownPoint) { + var point = [e.offsetX, e.offsetY]; + var dist = Math.pow(mouseDownPoint[0] - point[0], 2) + + Math.pow(mouseDownPoint[1] - point[1], 2); + + if (dist > CLICK_THRESHOLD) { + return; + } + + var result = this._model.coordinateSystem.getSlidedAxisExpandWindow( + [e.offsetX, e.offsetY] + ); + + result.behavior !== 'none' && this._dispatchExpand({ + axisExpandWindow: result.axisExpandWindow + }); + } + + this._mouseDownPoint = null; + }, + + mousemove: function (e) { + // Should do nothing when brushing. + if (this._mouseDownPoint || !checkTrigger(this, 'mousemove')) { + return; + } + var model = this._model; + var result = model.coordinateSystem.getSlidedAxisExpandWindow( + [e.offsetX, e.offsetY] + ); + + var behavior = result.behavior; + behavior === 'jump' && this._throttledDispatchExpand.debounceNextCall(model.get('axisExpandDebounce')); + this._throttledDispatchExpand( + behavior === 'none' + ? null // Cancle the last trigger, in case that mouse slide out of the area quickly. + : { + axisExpandWindow: result.axisExpandWindow, + // Jumping uses animation, and sliding suppresses animation. + animation: behavior === 'jump' ? null : false + } + ); + } +}; + +function checkTrigger(view, triggerOn) { + var model = view._model; + return model.get('axisExpandable') && model.get('axisExpandTriggerOn') === triggerOn; +} + +registerPreprocessor(parallelPreprocessor); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +SeriesModel.extend({ + + type: 'series.parallel', + + dependencies: ['parallel'], + + visualColorAccessPath: 'lineStyle.color', + + getInitialData: function (option, ecModel) { + var source = this.getSource(); + + setEncodeAndDimensions(source, this); + + return createListFromArray(source, this); + }, + + /** + * User can get data raw indices on 'axisAreaSelected' event received. + * + * @public + * @param {string} activeState 'active' or 'inactive' or 'normal' + * @return {Array.} Raw indices + */ + getRawIndicesByActiveState: function (activeState) { + var coordSys = this.coordinateSystem; + var data = this.getData(); + var indices = []; + + coordSys.eachActiveState(data, function (theActiveState, dataIndex) { + if (activeState === theActiveState) { + indices.push(data.getRawIndex(dataIndex)); + } + }); + + return indices; + }, + + defaultOption: { + zlevel: 0, // 一级层叠 + z: 2, // 二级层叠 + + coordinateSystem: 'parallel', + parallelIndex: 0, + + label: { + show: false + }, + + inactiveOpacity: 0.05, + activeOpacity: 1, + + lineStyle: { + width: 1, + opacity: 0.45, + type: 'solid' + }, + emphasis: { + label: { + show: false + } + }, + + progressive: 500, + smooth: false, // true | false | number + + animationEasing: 'linear' + } +}); + +function setEncodeAndDimensions(source, seriesModel) { + // The mapping of parallelAxis dimension to data dimension can + // be specified in parallelAxis.option.dim. For example, if + // parallelAxis.option.dim is 'dim3', it mapping to the third + // dimension of data. But `data.encode` has higher priority. + // Moreover, parallelModel.dimension should not be regarded as data + // dimensions. Consider dimensions = ['dim4', 'dim2', 'dim6']; + + if (source.encodeDefine) { + return; + } + + var parallelModel = seriesModel.ecModel.getComponent( + 'parallel', seriesModel.get('parallelIndex') + ); + if (!parallelModel) { + return; + } + + var encodeDefine = source.encodeDefine = createHashMap(); + each$1(parallelModel.dimensions, function (axisDim) { + var dataDimIndex = convertDimNameToNumber(axisDim); + encodeDefine.set(axisDim, dataDimIndex); + }); +} + +function convertDimNameToNumber(dimName) { + return +dimName.replace('dim', ''); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 DEFAULT_SMOOTH = 0.3; + +var ParallelView = Chart.extend({ + + type: 'parallel', + + init: function () { + + /** + * @type {module:zrender/container/Group} + * @private + */ + this._dataGroup = new Group(); + + this.group.add(this._dataGroup); + + /** + * @type {module:echarts/data/List} + */ + this._data; + + /** + * @type {boolean} + */ + this._initialized; + }, + + /** + * @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; + var seriesScope = makeSeriesScope$2(seriesModel); + + data.diff(oldData) + .add(add) + .update(update) + .remove(remove) + .execute(); + + function add(newDataIndex) { + var line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys); + updateElCommon(line, data, newDataIndex, seriesScope); + } + + function update(newDataIndex, oldDataIndex) { + var line = oldData.getItemGraphicEl(oldDataIndex); + var points = createLinePoints(data, newDataIndex, dimensions, coordSys); + data.setItemGraphicEl(newDataIndex, line); + var animationModel = (payload && payload.animation === false) ? null : seriesModel; + updateProps(line, {shape: {points: points}}, animationModel, newDataIndex); + + updateElCommon(line, data, newDataIndex, seriesScope); + } + + function remove(oldDataIndex) { + var line = oldData.getItemGraphicEl(oldDataIndex); + dataGroup.remove(line); + } + + // First create + if (!this._initialized) { + this._initialized = true; + var clipPath = createGridClipShape$1( + coordSys, seriesModel, function () { + // Callback will be invoked immediately if there is no animation + setTimeout(function () { + dataGroup.removeClipPath(); + }); + } + ); + dataGroup.setClipPath(clipPath); + } + + this._data = data; + }, + + incrementalPrepareRender: function (seriesModel, ecModel, api) { + this._initialized = true; + this._data = null; + this._dataGroup.removeAll(); + }, + + incrementalRender: function (taskParams, seriesModel, ecModel) { + var data = seriesModel.getData(); + var coordSys = seriesModel.coordinateSystem; + var dimensions = coordSys.dimensions; + var seriesScope = makeSeriesScope$2(seriesModel); + + for (var dataIndex = taskParams.start; dataIndex < taskParams.end; dataIndex++) { + var line = addEl(data, this._dataGroup, dataIndex, dimensions, coordSys); + line.incremental = true; + updateElCommon(line, data, dataIndex, seriesScope); + } + }, + + dispose: function () {}, + + // _renderForProgressive: function (seriesModel) { + // var dataGroup = this._dataGroup; + // var data = seriesModel.getData(); + // var oldData = this._data; + // var coordSys = seriesModel.coordinateSystem; + // var dimensions = coordSys.dimensions; + // var option = seriesModel.option; + // var progressive = option.progressive; + // var smooth = option.smooth ? SMOOTH : null; + + // // In progressive animation is disabled, so use simple data diff, + // // which effects performance less. + // // (Typically performance for data with length 7000+ like: + // // simpleDiff: 60ms, addEl: 184ms, + // // in RMBP 2.4GHz intel i7, OSX 10.9 chrome 50.0.2661.102 (64-bit)) + // if (simpleDiff(oldData, data, dimensions)) { + // dataGroup.removeAll(); + // data.each(function (dataIndex) { + // addEl(data, dataGroup, dataIndex, dimensions, coordSys); + // }); + // } + + // updateElCommon(data, progressive, smooth); + + // // Consider switch between progressive and not. + // data.__plProgressive = true; + // this._data = data; + // }, + + /** + * @override + */ + remove: function () { + this._dataGroup && this._dataGroup.removeAll(); + this._data = null; + } +}); + +function createGridClipShape$1(coordSys, seriesModel, cb) { + var parallelModel = coordSys.model; + var rect = coordSys.getRect(); + var rectEl = new 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); + initProps(rectEl, { + shape: { + width: rect.width, + height: rect.height + } + }, seriesModel, cb); + return rectEl; +} + +function createLinePoints(data, dataIndex, dimensions, coordSys) { + var points = []; + for (var i = 0; i < dimensions.length; i++) { + var dimName = dimensions[i]; + var value = data.get(data.mapDimension(dimName), dataIndex); + if (!isEmptyValue(value, coordSys.getAxis(dimName).type)) { + points.push(coordSys.dataToPoint(value, dimName)); + } + } + return points; +} + +function addEl(data, dataGroup, dataIndex, dimensions, coordSys) { + var points = createLinePoints(data, dataIndex, dimensions, coordSys); + var line = new Polyline({ + shape: {points: points}, + silent: true, + z2: 10 + }); + dataGroup.add(line); + data.setItemGraphicEl(dataIndex, line); + return line; +} + +function makeSeriesScope$2(seriesModel) { + var smooth = seriesModel.get('smooth', true); + smooth === true && (smooth = DEFAULT_SMOOTH); + return { + lineStyle: seriesModel.getModel('lineStyle').getLineStyle(), + smooth: smooth != null ? smooth : DEFAULT_SMOOTH + }; +} + +function updateElCommon(el, data, dataIndex, seriesScope) { + var lineStyle = seriesScope.lineStyle; + + if (data.hasItemOption) { + var lineStyleModel = data.getItemModel(dataIndex).getModel('lineStyle'); + lineStyle = lineStyleModel.getLineStyle(); + } + + el.useStyle(lineStyle); + + var elStyle = el.style; + elStyle.fill = null; + // lineStyle.color have been set to itemVisual in module:echarts/visual/seriesColor. + elStyle.stroke = data.getItemVisual(dataIndex, 'color'); + // lineStyle.opacity have been set to itemVisual in parallelVisual. + elStyle.opacity = data.getItemVisual(dataIndex, 'opacity'); + + seriesScope.smooth && (el.shape.smooth = seriesScope.smooth); +} + +// function simpleDiff(oldData, newData, dimensions) { +// var oldLen; +// if (!oldData +// || !oldData.__plProgressive +// || (oldLen = oldData.count()) !== newData.count() +// ) { +// return true; +// } + +// var dimLen = dimensions.length; +// for (var i = 0; i < oldLen; i++) { +// for (var j = 0; j < dimLen; j++) { +// if (oldData.get(dimensions[j], i) !== newData.get(dimensions[j], i)) { +// return true; +// } +// } +// } + +// return false; +// } + +// FIXME +// 公用方法? +function isEmptyValue(val, axisType) { + return axisType === 'category' + ? val == null + : (val == null || isNaN(val)); // axisType === 'value' +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 opacityAccessPath$1 = ['lineStyle', 'normal', 'opacity']; + +var parallelVisual = { + + seriesType: 'parallel', + + reset: function (seriesModel, ecModel, api) { + + var itemStyleModel = seriesModel.getModel('itemStyle'); + var lineStyleModel = seriesModel.getModel('lineStyle'); + var globalColors = ecModel.get('color'); + + var color = lineStyleModel.get('color') + || itemStyleModel.get('color') + || globalColors[seriesModel.seriesIndex % globalColors.length]; + var inactiveOpacity = seriesModel.get('inactiveOpacity'); + var activeOpacity = seriesModel.get('activeOpacity'); + var lineStyle = seriesModel.getModel('lineStyle').getLineStyle(); + + var coordSys = seriesModel.coordinateSystem; + var data = seriesModel.getData(); + + var opacityMap = { + normal: lineStyle.opacity, + active: activeOpacity, + inactive: inactiveOpacity + }; + + data.setVisual('color', color); + + function progress(params, data) { + coordSys.eachActiveState(data, function (activeState, dataIndex) { + var opacity = opacityMap[activeState]; + if (activeState === 'normal' && data.hasItemOption) { + var itemOpacity = data.getItemModel(dataIndex).get(opacityAccessPath$1, true); + itemOpacity != null && (opacity = itemOpacity); + } + data.setItemVisual(dataIndex, 'opacity', opacity); + }, params.start, params.end); + } + + return {progress: progress}; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerVisual(parallelVisual); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Get initial data and define sankey view's series model + * @author Deqing Li(annong035@gmail.com) + */ + +var SankeySeries = SeriesModel.extend({ + + type: 'series.sankey', + + layoutInfo: null, + + /** + * Init a graph data structure from data in option series + * + * @param {Object} option the object used to config echarts view + * @return {module:echarts/data/List} storage initial data + */ + getInitialData: function (option) { + 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; + } + }, + + setNodePosition: function (dataIndex, localPosition) { + var dataItem = this.option.data[dataIndex]; + dataItem.localX = localPosition[0]; + dataItem.localY = localPosition[1]; + }, + + /** + * Return the graphic data structure + * + * @return {module:echarts/data/Graph} graphic data structure + */ + getGraph: function () { + return this.getData().graph; + }, + + /** + * Get edge data of graphic data structure + * + * @return {module:echarts/data/List} data structure of list + */ + getEdgeData: function () { + return this.getGraph().edgeData; + }, + + /** + * @override + */ + formatTooltip: function (dataIndex, multipleSeries, dataType) { + // dataType === 'node' or empty do not show tooltip by default + if (dataType === 'edge') { + var params = this.getDataParams(dataIndex, dataType); + var rawDataOpt = params.data; + var html = rawDataOpt.source + ' -- ' + rawDataOpt.target; + if (params.value) { + html += ' : ' + params.value; + } + return encodeHTML(html); + } + + return SankeySeries.superCall(this, 'formatTooltip', dataIndex, multipleSeries); + }, + + 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 vertical distance between two nodes + nodeGap: 8, + + // control if the node can move or not + draggable: true, + + focusNodeAdjacency: false, + + // the number of iterations to change the position of the node + layoutIterations: 32, + + label: { + show: true, + position: 'right', + color: '#000', + fontSize: 12 + }, + + itemStyle: { + borderWidth: 1, + borderColor: '#333' + }, + + lineStyle: { + color: '#314656', + opacity: 0.2, + curveness: 0.5 + }, + + emphasis: { + label: { + show: true + }, + lineStyle: { + opacity: 0.6 + } + }, + + animationEasing: 'linear', + + animationDuration: 1000 + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file The file used to draw sankey view + * @author Deqing Li(annong035@gmail.com) + */ + +var nodeOpacityPath$1 = ['itemStyle', 'opacity']; +var lineOpacityPath$1 = ['lineStyle', 'opacity']; + +function getItemOpacity$1(item, opacityPath) { + return item.getVisual('opacity') || item.getModel().get(opacityPath); +} + +function fadeOutItem$1(item, opacityPath, opacityRatio) { + var el = item.getGraphicEl(); + + var opacity = getItemOpacity$1(item, opacityPath); + if (opacityRatio != null) { + opacity == null && (opacity = 1); + opacity *= opacityRatio; + } + + el.downplay && el.downplay(); + el.traverse(function (child) { + if (child.type !== 'group') { + child.setStyle('opacity', opacity); + } + }); +} + +function fadeInItem$1(item, opacityPath) { + var opacity = getItemOpacity$1(item, opacityPath); + var el = item.getGraphicEl(); + + el.highlight && el.highlight(); + el.traverse(function (child) { + if (child.type !== 'group') { + child.setStyle('opacity', opacity); + } + }); +} + +var SankeyShape = 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(); + } +}); + +extendChartView({ + + type: 'sankey', + + /** + * @private + * @type {module:echarts/chart/sankey/SankeySeries} + */ + _model: null, + + /** + * @private + * @type {boolean} + */ + _focusAdjacencyDisabled: false, + + render: function (seriesModel, ecModel, api) { + var sankeyView = this; + var graph = seriesModel.getGraph(); + var group = this.group; + var layoutInfo = seriesModel.layoutInfo; + // view width + var width = layoutInfo.width; + // view height + var height = layoutInfo.height; + + var nodeData = seriesModel.getData(); + var edgeData = seriesModel.getData('edge'); + var orient = seriesModel.get('orient'); + + this._model = seriesModel; + + group.removeAll(); + + group.attr('position', [layoutInfo.x, layoutInfo.y]); + + // generate a bezire Curve for each edge + graph.eachEdge(function (edge) { + var curve = new SankeyShape(); + curve.dataIndex = edge.dataIndex; + curve.seriesIndex = seriesModel.seriesIndex; + curve.dataType = 'edge'; + var lineStyleModel = edge.getModel('lineStyle'); + var curvature = lineStyleModel.get('curveness'); + var n1Layout = edge.node1.getLayout(); + var node1Model = edge.node1.getModel(); + var dragX1 = node1Model.get('localX'); + var dragY1 = node1Model.get('localY'); + var n2Layout = edge.node2.getLayout(); + var node2Model = edge.node2.getModel(); + var dragX2 = node2Model.get('localX'); + var dragY2 = node2Model.get('localY'); + var edgeLayout = edge.getLayout(); + + curve.shape.extent = Math.max(1, edgeLayout.dy); + + var x1 = (dragX1 != null ? dragX1 * width : n1Layout.x) + n1Layout.dx; + var y1 = (dragY1 != null ? dragY1 * height : n1Layout.y) + edgeLayout.sy + edgeLayout.dy / 2; + var x2 = dragX2 != null ? dragX2 * width : n2Layout.x; + var y2 = (dragY2 != null ? dragY2 * height : 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()); + // Special color, use source node color or target node color + switch (curve.style.fill) { + case 'source': + curve.style.fill = edge.node1.getVisual('color'); + break; + case 'target': + curve.style.fill = edge.node2.getVisual('color'); + break; + } + + setHoverStyle(curve, edge.getModel('emphasis.lineStyle').getItemStyle()); + + group.add(curve); + + edgeData.setItemGraphicEl(edge.dataIndex, curve); + }); + + // Generate a rect for each node + graph.eachNode(function (node) { + var layout = node.getLayout(); + var itemModel = node.getModel(); + var dragX = itemModel.get('localX'); + var dragY = itemModel.get('localY'); + var labelModel = itemModel.getModel('label'); + var labelHoverModel = itemModel.getModel('emphasis.label'); + + var rect = new Rect({ + shape: { + x: dragX != null ? dragX * width : layout.x, + y: dragY != null ? dragY * height : layout.y, + width: layout.dx, + height: layout.dy + }, + style: itemModel.getModel('itemStyle').getItemStyle() + }); + + var hoverStyle = node.getModel('emphasis.itemStyle').getItemStyle(); + + setLabelStyle( + rect.style, hoverStyle, labelModel, labelHoverModel, + { + labelFetcher: seriesModel, + labelDataIndex: node.dataIndex, + defaultText: node.id, + isRectText: true + } + ); + + rect.setStyle('fill', node.getVisual('color')); + + setHoverStyle(rect, hoverStyle); + + group.add(rect); + + nodeData.setItemGraphicEl(node.dataIndex, rect); + + rect.dataType = 'node'; + }); + + nodeData.eachItemGraphicEl(function (el, dataIndex) { + var itemModel = nodeData.getItemModel(dataIndex); + if (itemModel.get('draggable')) { + el.drift = function (dx, dy) { + sankeyView._focusAdjacencyDisabled = true; + this.shape.x += dx; + this.shape.y += dy; + this.dirty(); + api.dispatchAction({ + type: 'dragNode', + seriesId: seriesModel.id, + dataIndex: nodeData.getRawIndex(dataIndex), + localX: this.shape.x / width, + localY: this.shape.y / height + }); + }; + el.draggable = true; + el.cursor = 'move'; + } + + if (itemModel.get('focusNodeAdjacency')) { + el.off('mouseover').on('mouseover', function () { + if (!sankeyView._focusAdjacencyDisabled) { + api.dispatchAction({ + type: 'focusNodeAdjacency', + seriesId: seriesModel.id, + dataIndex: el.dataIndex + }); + } + }); + el.off('mouseout').on('mouseout', function () { + if (!sankeyView._focusAdjacencyDisabled) { + api.dispatchAction({ + type: 'unfocusNodeAdjacency', + seriesId: seriesModel.id + }); + } + }); + } + }); + + edgeData.eachItemGraphicEl(function (el, dataIndex) { + var edgeModel = edgeData.getItemModel(dataIndex); + if (edgeModel.get('focusNodeAdjacency')) { + el.off('mouseover').on('mouseover', function () { + if (!sankeyView._focusAdjacencyDisabled) { + api.dispatchAction({ + type: 'focusNodeAdjacency', + seriesId: seriesModel.id, + edgeDataIndex: el.dataIndex + }); + } + }); + el.off('mouseout').on('mouseout', function () { + if (!sankeyView._focusAdjacencyDisabled) { + api.dispatchAction({ + type: 'unfocusNodeAdjacency', + seriesId: seriesModel.id + }); + } + }); + } + }); + + if (!this._data && seriesModel.get('animation')) { + group.setClipPath(createGridClipShape$2(group.getBoundingRect(), seriesModel, function () { + group.removeClipPath(); + })); + } + + this._data = seriesModel.getData(); + }, + + dispose: function () {}, + + focusNodeAdjacency: function (seriesModel, ecModel, api, payload) { + var data = this._model.getData(); + var graph = data.graph; + var dataIndex = payload.dataIndex; + var itemModel = data.getItemModel(dataIndex); + var edgeDataIndex = payload.edgeDataIndex; + + if (dataIndex == null && edgeDataIndex == null) { + return; + } + var node = graph.getNodeByIndex(dataIndex); + var edge = graph.getEdgeByIndex(edgeDataIndex); + + graph.eachNode(function (node) { + fadeOutItem$1(node, nodeOpacityPath$1, 0.1); + }); + graph.eachEdge(function (edge) { + fadeOutItem$1(edge, lineOpacityPath$1, 0.1); + }); + + if (node) { + fadeInItem$1(node, nodeOpacityPath$1); + var focusNodeAdj = itemModel.get('focusNodeAdjacency'); + if (focusNodeAdj === 'outEdges') { + each$1(node.outEdges, function (edge) { + if (edge.dataIndex < 0) { + return; + } + fadeInItem$1(edge, lineOpacityPath$1); + fadeInItem$1(edge.node2, nodeOpacityPath$1); + }); + } + else if (focusNodeAdj === 'inEdges') { + each$1(node.inEdges, function (edge) { + if (edge.dataIndex < 0) { + return; + } + fadeInItem$1(edge, lineOpacityPath$1); + fadeInItem$1(edge.node1, nodeOpacityPath$1); + }); + } + else if (focusNodeAdj === 'allEdges') { + each$1(node.edges, function (edge) { + if (edge.dataIndex < 0) { + return; + } + fadeInItem$1(edge, lineOpacityPath$1); + fadeInItem$1(edge.node1, nodeOpacityPath$1); + fadeInItem$1(edge.node2, nodeOpacityPath$1); + }); + } + } + if (edge) { + fadeInItem$1(edge, lineOpacityPath$1); + fadeInItem$1(edge.node1, nodeOpacityPath$1); + fadeInItem$1(edge.node2, nodeOpacityPath$1); + } + }, + + unfocusNodeAdjacency: function (seriesModel, ecModel, api, payload) { + var graph = this._model.getGraph(); + + graph.eachNode(function (node) { + fadeOutItem$1(node, nodeOpacityPath$1); + }); + graph.eachEdge(function (edge) { + fadeOutItem$1(edge, lineOpacityPath$1); + }); + } +}); + +// add animation to the view +function createGridClipShape$2(rect, seriesModel, cb) { + var rectEl = new Rect({ + shape: { + x: rect.x - 10, + y: rect.y - 10, + width: 0, + height: rect.height + 20 + } + }); + initProps(rectEl, { + shape: { + width: rect.width + 20, + height: rect.height + 20 + } + }, seriesModel, cb); + + return rectEl; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file The interactive action of sankey view + * @author Deqing Li(annong035@gmail.com) + */ + +registerAction({ + type: 'dragNode', + event: 'dragNode', + // here can only use 'update' now, other value is not support in echarts. + update: 'update' +}, function (payload, ecModel) { + ecModel.eachComponent({mainType: 'series', subType: 'sankey', query: payload}, function (seriesModel) { + seriesModel.setNodePosition(payload.dataIndex, [payload.localX, payload.localY]); + }); +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* The implementation references to d3.js. The use of the source +* code of this file is also subject to the terms and consitions +* of its license (BSD-3Clause, see ). +*/ + + +/** + * 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$$1(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]]; + } + } + + each$1(valuesByKey, function (value, key) { + mapObject[key] = map$$1(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++]; + + each$1(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$$1(array, 0), 0); + } + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file The layout algorithm of sankey view + * @author Deqing Li(annong035@gmail.com) + */ + +var sankeyLayout = function (ecModel, api, payload) { + + ecModel.eachSeriesByType('sankey', function (seriesModel) { + + var nodeWidth = seriesModel.get('nodeWidth'); + var nodeGap = seriesModel.get('nodeGap'); + + var layoutInfo = getViewRect$3(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 = filter(nodes, 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 + * + * @param {module:echarts/model/Series} seriesModel the model object of sankey series + * @param {module:echarts/ExtensionAPI} api provide the API list that the developer can call + * @return {module:zrender/core/BoundingRect} size of rect to draw the sankey view + */ +function getViewRect$3(seriesModel, api) { + return getLayoutRect( + seriesModel.getBoxLayoutParams(), { + width: api.getWidth(), + height: api.getHeight() + } + ); +} + +function layoutSankey(nodes, edges, nodeWidth, nodeGap, width, height, iterations) { + computeNodeBreadths(nodes, edges, 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 node of sankey view + */ +function computeNodeValues(nodes) { + each$1(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. + * + * Here we use Kahn algorithm to detect cycle when we traverse + * the node to computer the initial x position. + * + * @param {module:echarts/data/Graph~Node} nodes node of sankey view + * @param {number} nodeWidth the dx of the node + * @param {number} width the whole width of the area to draw the view + */ +function computeNodeBreadths(nodes, edges, nodeWidth, width) { + // Used to mark whether the edge is deleted. if it is deleted, + // the value is 0, otherwise it is 1. + var remainEdges = []; + // Storage each node's indegree. + var indegreeArr = []; + //Used to storage the node with indegree is equal to 0. + var zeroIndegrees = []; + var nextNode = []; + var x = 0; + var kx = 0; + + for (var i = 0; i < edges.length; i++) { + remainEdges[i] = 1; + } + + for (var i = 0; i < nodes.length; i++) { + indegreeArr[i] = nodes[i].inEdges.length; + if (indegreeArr[i] === 0) { + zeroIndegrees.push(nodes[i]); + } + } + + while (zeroIndegrees.length) { + each$1(zeroIndegrees, function (node) { + node.setLayout({x: x}, true); + node.setLayout({dx: nodeWidth}, true); + each$1(node.outEdges, function (edge) { + var indexEdge = edges.indexOf(edge); + remainEdges[indexEdge] = 0; + var targetNode = edge.node2; + var nodeIndex = nodes.indexOf(targetNode); + if (--indegreeArr[nodeIndex] === 0) { + nextNode.push(targetNode); + } + }); + }); + + ++x; + zeroIndegrees = nextNode; + nextNode = []; + } + + for (var i = 0; i < remainEdges.length; i++) { + if (__DEV__) { + if (remainEdges[i] === 1) { + throw new Error('Sankey is a DAG, the original data has cycle!'); + } + } + } + + moveSinksRight(nodes, x); + kx = (width - nodeWidth) / (x - 1); + + scaleNodeBreadths(nodes, kx); +} + +/** + * All the node without outEgdes are assigned maximum x-position and + * be aligned in the last column. + * + * @param {module:echarts/data/Graph~Node} nodes node of sankey view + * @param {number} x value (x-1) use to assign to node without outEdges + * as x-position + */ +function moveSinksRight(nodes, x) { + each$1(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 node of sankey view + * @param {number} kx multiple used to scale nodes + */ +function scaleNodeBreadths(nodes, kx) { + each$1(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 node of sankey view + * @param {module:echarts/data/Graph~Edge} edges edge of sankey view + * @param {number} height the whole height of the area to draw the view + * @param {number} nodeGap the vertical distance between two nodes + * in the same column. + * @param {number} iterations the number of iterations for the algorithm + */ +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--) { + // 0.99 is a experience parameter, ensure that each iterations of + // changes as small as possible. + 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 node of sankey view + * @param {Array.>} nodesByBreadth + * group by the array of all sankey nodes based on the nodes x-position. + * @param {module:echarts/data/Graph~Edge} edges edge of sankey view + * @param {number} height the whole height of the area to draw the view + * @param {number} nodeGap the vertical distance between two nodes + */ +function initializeNodeDepth(nodes, nodesByBreadth, edges, height, nodeGap) { + var kyArray = []; + each$1(nodesByBreadth, function (nodes) { + var n = nodes.length; + var sum = 0; + each$1(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]; + + each$1(nodesByBreadth, function (nodes) { + each$1(nodes, function (node, i) { + node.setLayout({y: i}, true); + var nodeDy = node.getLayout().value * ky0; + node.setLayout({dy: nodeDy}, true); + }); + }); + + each$1(edges, function (edge) { + var edgeDy = +edge.getValue() * ky0; + edge.setLayout({dy: edgeDy}, true); + }); +} + +/** + * Resolve the collision of initialized depth (y-position) + * + * @param {Array.>} nodesByBreadth + * group by the array of all sankey nodes based on the nodes x-position. + * @param {number} nodeGap the vertical distance between two nodes + * @param {number} height the whole height of the area to draw the view + */ +function resolveCollisions(nodesByBreadth, nodeGap, height) { + each$1(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 bounds, 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.>} nodesByBreadth + * group by the array of all sankey nodes based on the node x-position. + * @param {number} alpha parameter used to adjust the nodes y-position + */ +function relaxRightToLeft(nodesByBreadth, alpha) { + each$1(nodesByBreadth.slice().reverse(), function (nodes) { + each$1(nodes, function (node) { + if (node.outEdges.length) { + var y = sum(node.outEdges, weightedTarget) / sum(node.outEdges, getEdgeValue); + var nodeY = node.getLayout().y + (y - center$1(node)) * alpha; + node.setLayout({y: nodeY}, true); + } + }); + }); +} + +function weightedTarget(edge) { + return center$1(edge.node2) * edge.getValue(); +} + +/** + * Change the y-position of the nodes, except most the left side nodes + * + * @param {Array.>} nodesByBreadth + * group by the array of all sankey nodes based on the node x-position. + * @param {number} alpha parameter used to adjust the nodes y-position + */ +function relaxLeftToRight(nodesByBreadth, alpha) { + each$1(nodesByBreadth, function (nodes) { + each$1(nodes, function (node) { + if (node.inEdges.length) { + var y = sum(node.inEdges, weightedSource) / sum(node.inEdges, getEdgeValue); + var nodeY = node.getLayout().y + (y - center$1(node)) * alpha; + node.setLayout({y: nodeY}, true); + } + }); + }); +} + +function weightedSource(edge) { + return center$1(edge.node1) * edge.getValue(); +} + +/** + * Compute the depth(y-position) of each edge + * + * @param {module:echarts/data/Graph~Node} nodes node of sankey view + */ +function computeEdgeDepths(nodes) { + each$1(nodes, function (node) { + node.outEdges.sort(ascendingTargetDepth); + node.inEdges.sort(ascendingSourceDepth); + }); + each$1(nodes, function (node) { + var sy = 0; + var ty = 0; + each$1(node.outEdges, function (edge) { + edge.setLayout({sy: sy}, true); + sy += edge.getLayout().dy; + }); + each$1(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 sum = 0; + var len = array.length; + var i = -1; + while (++i < len) { + var value = +f.call(array, array[i], i); + if (!isNaN(value)) { + sum += value; + } + } + return sum; +} + +function center$1(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; +} + +function getEdgeValue(edge) { + return edge.getValue(); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Visual encoding for sankey view + * @author Deqing Li(annong035@gmail.com) + */ + +var sankeyVisual = function (ecModel, payload) { + ecModel.eachSeriesByType('sankey', function (seriesModel) { + var graph = seriesModel.getGraph(); + var nodes = graph.nodes; + if (nodes.length) { + var minValue = Infinity; + var maxValue = -Infinity; + each$1(nodes, function (node) { + var nodeValue = node.getLayout().value; + if (nodeValue < minValue) { + minValue = nodeValue; + } + if (nodeValue > maxValue) { + maxValue = nodeValue; + } + }); + + each$1(nodes, 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); + // If set itemStyle.normal.color + var itemModel = node.getModel(); + var customColor = itemModel.get('itemStyle.color'); + if (customColor != null) { + node.setVisual('color', customColor); + } + }); + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerLayout(sankeyLayout); +registerVisual(sankeyVisual); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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 ordinalMeta; + + 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'; + ordinalMeta = xAxisModel.getOrdinalMeta(); + addOrdinal = true; + } + else if (yAxisType === 'category') { + option.layout = 'vertical'; + ordinalMeta = yAxisModel.getOrdinalMeta(); + addOrdinal = true; + } + else { + option.layout = option.layout || 'horizontal'; + } + + var coordDims = ['x', 'y']; + var baseAxisDimIndex = option.layout === 'horizontal' ? 0 : 1; + var baseAxisDim = this._baseAxisDim = coordDims[baseAxisDimIndex]; + var otherAxisDim = coordDims[1 - baseAxisDimIndex]; + var axisModels = [xAxisModel, yAxisModel]; + var baseAxisType = axisModels[baseAxisDimIndex].get('type'); + var otherAxisType = axisModels[1 - baseAxisDimIndex].get('type'); + var data = option.data; + + // ??? FIXME make a stage to perform data transfrom. + // MUST create a new data, consider setOption({}) again. + if (data && addOrdinal) { + var newOptionData = []; + each$1(data, function (item, index) { + var newItem; + if (item.value && isArray(item.value)) { + newItem = item.value.slice(); + item.value.unshift(index); + } + else if (isArray(item)) { + newItem = item.slice(); + item.unshift(index); + } + else { + newItem = item; + } + newOptionData.push(newItem); + }); + option.data = newOptionData; + } + + var defaultValueDimensions = this.defaultValueDimensions; + + return createListSimply( + this, + { + coordDimensions: [{ + name: baseAxisDim, + type: getDimensionTypeByAxis(baseAxisType), + ordinalMeta: ordinalMeta, + otherDims: { + tooltip: false, + itemName: 0 + }, + dimsDef: ['base'] + }, { + name: otherAxisDim, + type: getDimensionTypeByAxis(otherAxisType), + dimsDef: defaultValueDimensions.slice() + }], + dimensionsCount: defaultValueDimensions.length + 1 + } + ); + }, + + /** + * 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; + } + +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 BoxplotSeries = SeriesModel.extend({ + + type: 'series.boxplot', + + dependencies: ['xAxis', 'yAxis', 'grid'], + + // TODO + // box width represents group size, so dimension should have 'size'. + + /** + * @see + * The meanings of 'min' and 'max' depend on user, + * and echarts do not need to know it. + * @readOnly + */ + defaultValueDimensions: [ + {name: 'min', defaultTooltip: true}, + {name: 'Q1', defaultTooltip: true}, + {name: 'median', defaultTooltip: true}, + {name: 'Q3', defaultTooltip: true}, + {name: 'max', defaultTooltip: true} + ], + + /** + * @type {Array.} + * @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: { + color: '#fff', + borderWidth: 1 + }, + + emphasis: { + itemStyle: { + borderWidth: 2, + shadowBlur: 5, + shadowOffsetX: 2, + shadowOffsetY: 2, + shadowColor: 'rgba(0,0,0,0.4)' + } + }, + + animationEasing: 'elasticOut', + animationDuration: 800 + } +}); + +mixin(BoxplotSeries, seriesModelMixin, true); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Update common properties +var NORMAL_ITEM_STYLE_PATH = ['itemStyle']; +var EMPHASIS_ITEM_STYLE_PATH = ['emphasis', 'itemStyle']; + +var BoxplotView = Chart.extend({ + + type: 'boxplot', + + render: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + var group = this.group; + var oldData = this._data; + + // There is no old data only when first rendering or switching from + // stream mode to normal mode, where previous elements should be removed. + if (!this._data) { + group.removeAll(); + } + + var constDim = seriesModel.get('layout') === 'horizontal' ? 1 : 0; + + data.diff(oldData) + .add(function (newIdx) { + if (data.hasValue(newIdx)) { + var itemLayout = data.getItemLayout(newIdx); + var symbolEl = createNormalBox(itemLayout, data, newIdx, constDim, 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; + } + + var itemLayout = data.getItemLayout(newIdx); + if (!symbolEl) { + symbolEl = createNormalBox(itemLayout, data, newIdx, constDim); + } + else { + updateNormalBoxData(itemLayout, symbolEl, data, newIdx); + } + + group.add(symbolEl); + + data.setItemGraphicEl(newIdx, symbolEl); + }) + .remove(function (oldIdx) { + var el = oldData.getItemGraphicEl(oldIdx); + el && group.remove(el); + }) + .execute(); + + this._data = data; + }, + + remove: function (ecModel) { + var group = this.group; + var data = this._data; + this._data = null; + data && data.eachItemGraphicEl(function (el) { + el && group.remove(el); + }); + }, + + dispose: noop + +}); + + +var BoxPath = Path.extend({ + + type: 'boxplotBoxPath', + + shape: {}, + + buildPath: function (ctx, shape) { + var ends = shape.points; + + var i = 0; + ctx.moveTo(ends[i][0], ends[i][1]); + i++; + for (; i < 4; i++) { + ctx.lineTo(ends[i][0], ends[i][1]); + } + ctx.closePath(); + + for (; i < ends.length; i++) { + ctx.moveTo(ends[i][0], ends[i][1]); + i++; + ctx.lineTo(ends[i][0], ends[i][1]); + } + } +}); + + +function createNormalBox(itemLayout, data, dataIndex, constDim, isInit) { + var ends = itemLayout.ends; + + var el = new BoxPath({ + shape: { + points: isInit + ? transInit(ends, constDim, itemLayout) + : ends + } + }); + + updateNormalBoxData(itemLayout, el, data, dataIndex, isInit); + + return el; +} + +function updateNormalBoxData(itemLayout, el, data, dataIndex, isInit) { + var seriesModel = data.hostModel; + var updateMethod = graphic[isInit ? 'initProps' : 'updateProps']; + + updateMethod( + el, + {shape: {points: itemLayout.ends}}, + seriesModel, + dataIndex + ); + + var itemModel = data.getItemModel(dataIndex); + var normalItemStyleModel = itemModel.getModel(NORMAL_ITEM_STYLE_PATH); + var borderColor = data.getItemVisual(dataIndex, 'color'); + + // Exclude borderColor. + var itemStyle = normalItemStyleModel.getItemStyle(['borderColor']); + itemStyle.stroke = borderColor; + itemStyle.strokeNoScale = true; + el.useStyle(itemStyle); + + el.z2 = 100; + + var hoverStyle = itemModel.getModel(EMPHASIS_ITEM_STYLE_PATH).getItemStyle(); + setHoverStyle(el, hoverStyle); +} + +function transInit(points, dim, itemLayout) { + return map(points, function (point) { + point = point.slice(); + point[dim] = itemLayout.initBaseline; + return point; + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 borderColorQuery = ['itemStyle', 'borderColor']; + +var boxplotVisual = 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)} + ); + }); + } + }); + +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$13 = each$1; + +var boxplotLayout = function (ecModel) { + + var groupResult = groupSeriesByAxis(ecModel); + + each$13(groupResult, function (groupItem) { + var seriesModels = groupItem.seriesModels; + + if (!seriesModels.length) { + return; + } + + calculateBase(groupItem); + + each$13(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 = 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$13(seriesModels, function (seriesModel) { + maxDataCount = Math.max(maxDataCount, seriesModel.getData().count()); + }); + extent = baseAxis.getExtent(), + Math.abs(extent[1] - extent[0]) / maxDataCount; + } + + each$13(seriesModels, function (seriesModel) { + var boxWidthBound = seriesModel.get('boxWidth'); + if (!isArray(boxWidthBound)) { + boxWidthBound = [boxWidthBound, boxWidthBound]; + } + boundList.push([ + parsePercent$1(boxWidthBound[0], bandWidth) || 0, + parsePercent$1(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$13(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 halfWidth = boxWidth / 2; + var cDimIdx = seriesModel.get('layout') === 'horizontal' ? 0 : 1; + var vDimIdx = 1 - cDimIdx; + var coordDims = ['x', 'y']; + var cDim = data.mapDimension(coordDims[cDimIdx]); + var vDims = data.mapDimension(coordDims[vDimIdx], true); + + if (cDim == null || vDims.length < 5) { + return; + } + + for (var dataIndex = 0; dataIndex < data.count(); dataIndex++) { + var axisDimVal = data.get(cDim, dataIndex); + + var median = getPoint(axisDimVal, vDims[2], dataIndex); + var end1 = getPoint(axisDimVal, vDims[0], dataIndex); + var end2 = getPoint(axisDimVal, vDims[1], dataIndex); + var end4 = getPoint(axisDimVal, vDims[3], dataIndex); + var end5 = getPoint(axisDimVal, vDims[4], dataIndex); + + var ends = []; + addBodyEnd(ends, end2, 0); + addBodyEnd(ends, end4, 1); + + ends.push(end1, end2, end5, end4); + layEndLine(ends, end1); + layEndLine(ends, end5); + layEndLine(ends, median); + + data.setItemLayout(dataIndex, { + initBaseline: median[vDimIdx], + ends: ends + }); + } + + function getPoint(axisDimVal, dimIdx, dataIndex) { + var val = data.get(dimIdx, dataIndex); + var p = []; + p[cDimIdx] = axisDimVal; + p[vDimIdx] = val; + var point; + if (isNaN(axisDimVal) || isNaN(val)) { + point = [NaN, NaN]; + } + else { + point = coordSys.dataToPoint(p); + point[cDimIdx] += offset; + } + return point; + } + + function addBodyEnd(ends, point, start) { + var point1 = point.slice(); + var point2 = point.slice(); + point1[cDimIdx] += halfWidth; + point2[cDimIdx] -= halfWidth; + start + ? ends.push(point1, point2) + : ends.push(point2, point1); + } + + function layEndLine(ends, endCenter) { + var from = endCenter.slice(); + var to = endCenter.slice(); + from[cDimIdx] -= halfWidth; + to[cDimIdx] += halfWidth; + ends.push(from, to); + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerVisual(boxplotVisual); +registerLayout(boxplotLayout); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 CandlestickSeries = SeriesModel.extend({ + + type: 'series.candlestick', + + dependencies: ['xAxis', 'yAxis', 'grid'], + + /** + * @readOnly + */ + defaultValueDimensions: [ + {name: 'open', defaultTooltip: true}, + {name: 'close', defaultTooltip: true}, + {name: 'lowest', defaultTooltip: true}, + {name: 'highest', defaultTooltip: true} + ], + + /** + * @type {Array.} + * @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: { + color: '#c23531', // 阳线 positive + color0: '#314656', // 阴线 negative '#c23531', '#314656' + borderWidth: 1, + // FIXME + // ec2中使用的是lineStyle.color 和 lineStyle.color0 + borderColor: '#c23531', + borderColor0: '#314656' + }, + + emphasis: { + itemStyle: { + borderWidth: 2 + } + }, + + barMaxWidth: null, + barMinWidth: null, + barWidth: null, + + large: true, + largeThreshold: 600, + + progressive: 3e3, + progressiveThreshold: 1e4, + progressiveChunkMode: 'mod', + + animationUpdate: false, + animationEasing: 'linear', + animationDuration: 300 + }, + + /** + * Get dimension for shadow in dataZoom + * @return {string} dimension name + */ + getShadowDim: function () { + return 'open'; + }, + + brushSelector: function (dataIndex, data, selectors) { + var itemLayout = data.getItemLayout(dataIndex); + return itemLayout && selectors.rect(itemLayout.brushRect); + } + +}); + +mixin(CandlestickSeries, seriesModelMixin, true); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 NORMAL_ITEM_STYLE_PATH$1 = ['itemStyle']; +var EMPHASIS_ITEM_STYLE_PATH$1 = ['emphasis', 'itemStyle']; +var SKIP_PROPS = ['color', 'color0', 'borderColor', 'borderColor0']; + + +var CandlestickView = Chart.extend({ + + type: 'candlestick', + + render: function (seriesModel, ecModel, api) { + this._updateDrawMode(seriesModel); + + this._isLargeDraw + ? this._renderLarge(seriesModel) + : this._renderNormal(seriesModel); + }, + + incrementalPrepareRender: function (seriesModel, ecModel, api) { + this._clear(); + this._updateDrawMode(seriesModel); + }, + + incrementalRender: function (params, seriesModel, ecModel, api) { + this._isLargeDraw + ? this._incrementalRenderLarge(params, seriesModel) + : this._incrementalRenderNormal(params, seriesModel); + }, + + _updateDrawMode: function (seriesModel) { + var isLargeDraw = seriesModel.pipelineContext.large; + if (this._isLargeDraw == null || isLargeDraw ^ this._isLargeDraw) { + this._isLargeDraw = isLargeDraw; + this._clear(); + } + }, + + _renderNormal: function (seriesModel) { + var data = seriesModel.getData(); + var oldData = this._data; + var group = this.group; + var isSimpleBox = data.getLayout('isSimpleBox'); + + // There is no old data only when first rendering or switching from + // stream mode to normal mode, where previous elements should be removed. + if (!this._data) { + group.removeAll(); + } + + data.diff(oldData) + .add(function (newIdx) { + if (data.hasValue(newIdx)) { + var el; + + var itemLayout = data.getItemLayout(newIdx); + el = createNormalBox$1(itemLayout, newIdx, true); + initProps(el, {shape: {points: itemLayout.ends}}, seriesModel, newIdx); + + setBoxCommon(el, data, newIdx, isSimpleBox); + + group.add(el); + data.setItemGraphicEl(newIdx, el); + } + }) + .update(function (newIdx, oldIdx) { + var el = oldData.getItemGraphicEl(oldIdx); + + // Empty data + if (!data.hasValue(newIdx)) { + group.remove(el); + return; + } + + var itemLayout = data.getItemLayout(newIdx); + if (!el) { + el = createNormalBox$1(itemLayout, newIdx); + } + else { + updateProps(el, {shape: {points: itemLayout.ends}}, seriesModel, newIdx); + } + + setBoxCommon(el, data, newIdx, isSimpleBox); + + group.add(el); + data.setItemGraphicEl(newIdx, el); + }) + .remove(function (oldIdx) { + var el = oldData.getItemGraphicEl(oldIdx); + el && group.remove(el); + }) + .execute(); + + this._data = data; + }, + + _renderLarge: function (seriesModel) { + this._clear(); + createLarge$1(seriesModel, this.group); + }, + + _incrementalRenderNormal: function (params, seriesModel) { + var data = seriesModel.getData(); + var isSimpleBox = data.getLayout('isSimpleBox'); + + var dataIndex; + while ((dataIndex = params.next()) != null) { + var el; + + var itemLayout = data.getItemLayout(dataIndex); + el = createNormalBox$1(itemLayout, dataIndex); + setBoxCommon(el, data, dataIndex, isSimpleBox); + + el.incremental = true; + this.group.add(el); + } + }, + + _incrementalRenderLarge: function (params, seriesModel) { + createLarge$1(seriesModel, this.group, true); + }, + + remove: function (ecModel) { + this._clear(); + }, + + _clear: function () { + this.group.removeAll(); + this._data = null; + }, + + dispose: noop + +}); + + +var NormalBoxPath = Path.extend({ + + type: 'normalCandlestickBox', + + shape: {}, + + buildPath: function (ctx, shape) { + var ends = shape.points; + + if (this.__simpleBox) { + ctx.moveTo(ends[4][0], ends[4][1]); + ctx.lineTo(ends[6][0], ends[6][1]); + } + else { + ctx.moveTo(ends[0][0], ends[0][1]); + ctx.lineTo(ends[1][0], ends[1][1]); + ctx.lineTo(ends[2][0], ends[2][1]); + ctx.lineTo(ends[3][0], ends[3][1]); + ctx.closePath(); + + ctx.moveTo(ends[4][0], ends[4][1]); + ctx.lineTo(ends[5][0], ends[5][1]); + ctx.moveTo(ends[6][0], ends[6][1]); + ctx.lineTo(ends[7][0], ends[7][1]); + } + } +}); + +function createNormalBox$1(itemLayout, dataIndex, isInit) { + var ends = itemLayout.ends; + return new NormalBoxPath({ + shape: { + points: isInit + ? transInit$1(ends, itemLayout) + : ends + }, + z2: 100 + }); +} + +function setBoxCommon(el, data, dataIndex, isSimpleBox) { + var itemModel = data.getItemModel(dataIndex); + var normalItemStyleModel = itemModel.getModel(NORMAL_ITEM_STYLE_PATH$1); + var color = data.getItemVisual(dataIndex, 'color'); + var borderColor = data.getItemVisual(dataIndex, 'borderColor') || color; + + // Color must be excluded. + // Because symbol provide setColor individually to set fill and stroke + var itemStyle = normalItemStyleModel.getItemStyle(SKIP_PROPS); + + el.useStyle(itemStyle); + el.style.strokeNoScale = true; + el.style.fill = color; + el.style.stroke = borderColor; + + el.__simpleBox = isSimpleBox; + + var hoverStyle = itemModel.getModel(EMPHASIS_ITEM_STYLE_PATH$1).getItemStyle(); + setHoverStyle(el, hoverStyle); +} + +function transInit$1(points, itemLayout) { + return map(points, function (point) { + point = point.slice(); + point[1] = itemLayout.initBaseline; + return point; + }); +} + + + +var LargeBoxPath = Path.extend({ + + type: 'largeCandlestickBox', + + shape: {}, + + buildPath: function (ctx, shape) { + // Drawing lines is more efficient than drawing + // a whole line or drawing rects. + var points = shape.points; + for (var i = 0; i < points.length;) { + if (this.__sign === points[i++]) { + var x = points[i++]; + ctx.moveTo(x, points[i++]); + ctx.lineTo(x, points[i++]); + } + else { + i += 3; + } + } + } +}); + +function createLarge$1(seriesModel, group, incremental) { + var data = seriesModel.getData(); + var largePoints = data.getLayout('largePoints'); + + var elP = new LargeBoxPath({ + shape: {points: largePoints}, + __sign: 1 + }); + group.add(elP); + var elN = new LargeBoxPath({ + shape: {points: largePoints}, + __sign: -1 + }); + group.add(elN); + + setLargeStyle$1(1, elP, seriesModel, data); + setLargeStyle$1(-1, elN, seriesModel, data); + + if (incremental) { + elP.incremental = true; + elN.incremental = true; + } +} + +function setLargeStyle$1(sign, el, seriesModel, data) { + var suffix = sign > 0 ? 'P' : 'N'; + var borderColor = data.getVisual('borderColor' + suffix) + || data.getVisual('color' + suffix); + + // Color must be excluded. + // Because symbol provide setColor individually to set fill and stroke + var itemStyle = seriesModel.getModel(NORMAL_ITEM_STYLE_PATH$1).getItemStyle(SKIP_PROPS); + + el.useStyle(itemStyle); + el.style.fill = null; + el.style.stroke = borderColor; + // No different + // el.style.lineWidth = .5; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 preprocessor = function (option) { + if (!option || !isArray(option.series)) { + return; + } + + // Translate 'k' to 'candlestick'. + each$1(option.series, function (seriesItem) { + if (isObject$1(seriesItem) && seriesItem.type === 'k') { + seriesItem.type = 'candlestick'; + } + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 positiveBorderColorQuery = ['itemStyle', 'borderColor']; +var negativeBorderColorQuery = ['itemStyle', 'borderColor0']; +var positiveColorQuery = ['itemStyle', 'color']; +var negativeColorQuery = ['itemStyle', 'color0']; + +var candlestickVisual = { + + seriesType: 'candlestick', + + plan: createRenderPlanner(), + + // For legend. + performRawSeries: true, + + reset: function (seriesModel, ecModel) { + + var data = seriesModel.getData(); + var isLargeRender = seriesModel.pipelineContext.large; + + data.setVisual({ + legendSymbol: 'roundRect', + colorP: getColor(1, seriesModel), + colorN: getColor(-1, seriesModel), + borderColorP: getBorderColor(1, seriesModel), + borderColorN: getBorderColor(-1, seriesModel) + }); + + // Only visible series has each data be visual encoded + if (ecModel.isSeriesFiltered(seriesModel)) { + return; + } + + return !isLargeRender && {progress: progress}; + + + function progress(params, data) { + var dataIndex; + while ((dataIndex = params.next()) != null) { + var itemModel = data.getItemModel(dataIndex); + var sign = data.getItemLayout(dataIndex).sign; + + data.setItemVisual( + dataIndex, + { + color: getColor(sign, itemModel), + borderColor: getBorderColor(sign, itemModel) + } + ); + } + } + + function getColor(sign, model) { + return model.get( + sign > 0 ? positiveColorQuery : negativeColorQuery + ); + } + + function getBorderColor(sign, model) { + return model.get( + sign > 0 ? positiveBorderColorQuery : negativeBorderColorQuery + ); + } + + } + +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 LargeArr$1 = typeof Float32Array !== 'undefined' ? Float32Array : Array; + +var candlestickLayout = { + + seriesType: 'candlestick', + + plan: createRenderPlanner(), + + reset: function (seriesModel) { + + var coordSys = seriesModel.coordinateSystem; + var data = seriesModel.getData(); + var candleWidth = calculateCandleWidth(seriesModel, data); + var cDimIdx = 0; + var vDimIdx = 1; + var coordDims = ['x', 'y']; + var cDim = data.mapDimension(coordDims[cDimIdx]); + var vDims = data.mapDimension(coordDims[vDimIdx], true); + var openDim = vDims[0]; + var closeDim = vDims[1]; + var lowestDim = vDims[2]; + var highestDim = vDims[3]; + + data.setLayout({ + candleWidth: candleWidth, + // The value is experimented visually. + isSimpleBox: candleWidth <= 1.3 + }); + + if (cDim == null || vDims.length < 4) { + return; + } + + return { + progress: seriesModel.pipelineContext.large + ? largeProgress : normalProgress + }; + + function normalProgress(params, data) { + var dataIndex; + while ((dataIndex = params.next()) != null) { + + var axisDimVal = data.get(cDim, dataIndex); + var openVal = data.get(openDim, dataIndex); + var closeVal = data.get(closeDim, dataIndex); + var lowestVal = data.get(lowestDim, dataIndex); + var highestVal = data.get(highestDim, dataIndex); + + var ocLow = Math.min(openVal, closeVal); + var ocHigh = Math.max(openVal, closeVal); + + var ocLowPoint = getPoint(ocLow, axisDimVal); + var ocHighPoint = getPoint(ocHigh, axisDimVal); + var lowestPoint = getPoint(lowestVal, axisDimVal); + var highestPoint = getPoint(highestVal, axisDimVal); + + var ends = []; + addBodyEnd(ends, ocHighPoint, 0); + addBodyEnd(ends, ocLowPoint, 1); + + ends.push( + subPixelOptimizePoint(highestPoint), + subPixelOptimizePoint(ocHighPoint), + subPixelOptimizePoint(lowestPoint), + subPixelOptimizePoint(ocLowPoint) + ); + + data.setItemLayout(dataIndex, { + sign: getSign(data, dataIndex, openVal, closeVal, closeDim), + initBaseline: openVal > closeVal + ? ocHighPoint[vDimIdx] : ocLowPoint[vDimIdx], // open point. + ends: ends, + brushRect: makeBrushRect(lowestVal, highestVal, axisDimVal) + }); + } + + function getPoint(val, axisDimVal) { + var p = []; + p[cDimIdx] = axisDimVal; + p[vDimIdx] = val; + return (isNaN(axisDimVal) || isNaN(val)) + ? [NaN, NaN] + : coordSys.dataToPoint(p); + } + + function addBodyEnd(ends, point, start) { + var point1 = point.slice(); + var point2 = point.slice(); + + point1[cDimIdx] = subPixelOptimize( + point1[cDimIdx] + candleWidth / 2, 1, false + ); + point2[cDimIdx] = subPixelOptimize( + point2[cDimIdx] - candleWidth / 2, 1, true + ); + + start + ? ends.push(point1, point2) + : ends.push(point2, point1); + } + + function makeBrushRect(lowestVal, highestVal, axisDimVal) { + var pmin = getPoint(lowestVal, axisDimVal); + var pmax = getPoint(highestVal, axisDimVal); + + pmin[cDimIdx] -= candleWidth / 2; + pmax[cDimIdx] -= candleWidth / 2; + + return { + x: pmin[0], + y: pmin[1], + width: vDimIdx ? candleWidth : pmax[0] - pmin[0], + height: vDimIdx ? pmax[1] - pmin[1] : candleWidth + }; + } + + function subPixelOptimizePoint(point) { + point[cDimIdx] = subPixelOptimize(point[cDimIdx], 1); + return point; + } + } + + function largeProgress(params, data) { + // Structure: [sign, x, yhigh, ylow, sign, x, yhigh, ylow, ...] + var points = new LargeArr$1(params.count * 5); + var offset = 0; + var point; + var tmpIn = []; + var tmpOut = []; + var dataIndex; + + while ((dataIndex = params.next()) != null) { + var axisDimVal = data.get(cDim, dataIndex); + var openVal = data.get(openDim, dataIndex); + var closeVal = data.get(closeDim, dataIndex); + var lowestVal = data.get(lowestDim, dataIndex); + var highestVal = data.get(highestDim, dataIndex); + + if (isNaN(axisDimVal) || isNaN(lowestVal) || isNaN(highestVal)) { + points[offset++] = NaN; + offset += 4; + continue; + } + + points[offset++] = getSign(data, dataIndex, openVal, closeVal, closeDim); + + tmpIn[cDimIdx] = axisDimVal; + + tmpIn[vDimIdx] = lowestVal; + point = coordSys.dataToPoint(tmpIn, null, tmpOut); + points[offset++] = point ? point[0] : NaN; + points[offset++] = point ? point[1] : NaN; + tmpIn[vDimIdx] = highestVal; + point = coordSys.dataToPoint(tmpIn, null, tmpOut); + points[offset++] = point ? point[1] : NaN; + } + + data.setLayout('largePoints', points); + } + } +}; + +function getSign(data, dataIndex, openVal, closeVal, closeDim) { + var sign; + if (openVal > closeVal) { + sign = -1; + } + else if (openVal < closeVal) { + sign = 1; + } + else { + sign = dataIndex > 0 + // If close === open, compare with close of last record + ? (data.get(closeDim, dataIndex - 1) <= closeVal ? 1 : -1) + // No record of previous, set to be positive + : 1; + } + + return sign; +} + +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() + ); + + var barMaxWidth = parsePercent$1( + retrieve2(seriesModel.get('barMaxWidth'), bandWidth), + bandWidth + ); + var barMinWidth = parsePercent$1( + retrieve2(seriesModel.get('barMinWidth'), 1), + bandWidth + ); + var barWidth = seriesModel.get('barWidth'); + + return barWidth != null + ? parsePercent$1(barWidth, bandWidth) + // Put max outer to ensure bar visible in spite of overlap. + : Math.max(Math.min(bandWidth / 2, barMaxWidth), barMinWidth); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerPreprocessor(preprocessor); +registerVisual(candlestickVisual); +registerLayout(candlestickLayout); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +SeriesModel.extend({ + + type: 'series.effectScatter', + + dependencies: ['grid', 'polar'], + + getInitialData: function (option, ecModel) { + return createListFromArray(this.getSource(), this); + }, + + brushSelector: 'point', + + defaultOption: { + coordinateSystem: 'cartesian2d', + zlevel: 0, + z: 2, + legendHoverLink: true, + + effectType: 'ripple', + + progressive: 0, + + // 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: { + // opacity: 1 + // } + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Symbol with ripple effect + * @module echarts/chart/helper/EffectSymbol + */ + +var EFFECT_RIPPLE_NUMBER = 3; + +function normalizeSymbolSize$1(symbolSize) { + if (!isArray(symbolSize)) { + symbolSize = [+symbolSize, +symbolSize]; + } + return symbolSize; +} + +function updateRipplePath(rippleGroup, effectCfg) { + rippleGroup.eachChild(function (ripplePath) { + ripplePath.attr({ + z: effectCfg.z, + zlevel: effectCfg.zlevel, + style: { + stroke: effectCfg.brushType === 'stroke' ? effectCfg.color : null, + fill: effectCfg.brushType === 'fill' ? effectCfg.color : null + } + }); + }); +} +/** + * @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 SymbolClz$1(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 (effectCfg) { + var symbolType = effectCfg.symbolType; + var color = effectCfg.color; + var rippleGroup = this.childAt(1); + + for (var i = 0; i < EFFECT_RIPPLE_NUMBER; i++) { + // var ripplePath = createSymbol( + // symbolType, -0.5, -0.5, 1, 1, color + // ); + // If width/height are set too small (e.g., set to 1) on ios10 + // and macOS Sierra, a circle stroke become a rect, no matter what + // the scale is set. So we set width/height as 2. See #4136. + var ripplePath = createSymbol( + symbolType, -1, -1, 2, 2, color + ); + ripplePath.attr({ + style: { + strokeNoScale: true + }, + z2: 99, + silent: true, + scale: [0.5, 0.5] + }); + + var delay = -i / EFFECT_RIPPLE_NUMBER * effectCfg.period + effectCfg.effectOffset; + // TODO Configurable effectCfg.period + ripplePath.animate('', true) + .when(effectCfg.period, { + scale: [effectCfg.rippleScale / 2, effectCfg.rippleScale / 2] + }) + .delay(delay) + .start(); + ripplePath.animateStyle(true) + .when(effectCfg.period, { + opacity: 0 + }) + .delay(delay) + .start(); + + rippleGroup.add(ripplePath); + } + + updateRipplePath(rippleGroup, effectCfg); +}; + +/** + * Update effect symbol + */ +effectSymbolProto.updateEffectAnimation = function (effectCfg) { + var oldEffectCfg = this._effectCfg; + var rippleGroup = this.childAt(1); + + // Must reinitialize effect if following configuration changed + var DIFFICULT_PROPS = ['symbolType', 'period', 'rippleScale']; + for (var i = 0; i < DIFFICULT_PROPS.length; i++) { + var propName = DIFFICULT_PROPS[i]; + if (oldEffectCfg[propName] !== effectCfg[propName]) { + this.stopEffectAnimation(); + this.startEffectAnimation(effectCfg); + return; + } + } + + updateRipplePath(rippleGroup, effectCfg); +}; + +/** + * 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$1(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] = parsePercent$1(symbolOffset[0], symbolSize[0]); + pos[1] = parsePercent$1(symbolOffset[1], symbolSize[1]); + } + rippleGroup.rotation = (itemModel.getShallow('symbolRotate') || 0) * Math.PI / 180 || 0; + + var effectCfg = {}; + + effectCfg.showEffectOn = seriesModel.get('showEffectOn'); + effectCfg.rippleScale = itemModel.get('rippleEffect.scale'); + effectCfg.brushType = itemModel.get('rippleEffect.brushType'); + effectCfg.period = itemModel.get('rippleEffect.period') * 1000; + effectCfg.effectOffset = idx / data.count(); + effectCfg.z = itemModel.getShallow('z') || 0; + effectCfg.zlevel = itemModel.getShallow('zlevel') || 0; + effectCfg.symbolType = symbolType; + effectCfg.color = color; + + this.off('mouseover').off('mouseout').off('emphasis').off('normal'); + + if (effectCfg.showEffectOn === 'render') { + this._effectCfg + ? this.updateEffectAnimation(effectCfg) + : this.startEffectAnimation(effectCfg); + + this._effectCfg = effectCfg; + } + else { + // Not keep old effect config + this._effectCfg = null; + + this.stopEffectAnimation(); + var symbol = this.childAt(0); + var onEmphasis = function () { + symbol.highlight(); + if (effectCfg.showEffectOn !== 'render') { + this.startEffectAnimation(effectCfg); + } + }; + var onNormal = function () { + symbol.downplay(); + if (effectCfg.showEffectOn !== 'render') { + this.stopEffectAnimation(); + } + }; + this.on('mouseover', onEmphasis, this) + .on('mouseout', onNormal, this) + .on('emphasis', onEmphasis, this) + .on('normal', onNormal, this); + } + + this._effectCfg = effectCfg; +}; + +effectSymbolProto.fadeOut = function (cb) { + this.off('mouseover').off('mouseout').off('emphasis').off('normal'); + cb && cb(); +}; + +inherits(EffectSymbol, Group); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +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); + }, + + updateTransform: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + + this.group.dirty(); + + var res = pointsLayout().reset(seriesModel); + if (res.progress) { + res.progress({ start: 0, end: data.count() }, data); + } + + this._symbolDraw.updateLayout(data); + }, + + _updateGroupTransform: function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + if (coordSys && coordSys.getRoamTransform) { + this.group.transform = clone$2(coordSys.getRoamTransform()); + this.group.decomposeTransform(); + } + }, + + remove: function (ecModel, api) { + this._symbolDraw && this._symbolDraw.remove(api); + }, + + dispose: function () {} +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerVisual(visualSymbol('effectScatter', 'circle')); +registerLayout(pointsLayout('effectScatter')); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 Uint32Arr = typeof Uint32Array === 'undefined' ? Array : Uint32Array; +var Float64Arr = typeof Float64Array === 'undefined' ? Array : Float64Array; + +function compatEc2(seriesOpt) { + var data = seriesOpt.data; + if (data && data[0] && data[0][0] && data[0][0].coord) { + if (__DEV__) { + console.warn('Lines data configuration has been changed to' + + ' { coords:[[1,2],[2,3]] }'); + } + seriesOpt.data = map(data, function (itemOpt) { + var coords = [ + itemOpt[0].coord, itemOpt[1].coord + ]; + var target = { + coords: coords + }; + if (itemOpt[0].name) { + target.fromName = itemOpt[0].name; + } + if (itemOpt[1].name) { + target.toName = itemOpt[1].name; + } + return mergeAll([target, itemOpt[0], itemOpt[1]]); + }); + } +} + +var LinesSeries = SeriesModel.extend({ + + type: 'series.lines', + + dependencies: ['grid', 'polar'], + + visualColorAccessPath: 'lineStyle.color', + + init: function (option) { + // The input data may be null/undefined. + option.data = option.data || []; + + // Not using preprocessor because mergeOption may not have series.type + compatEc2(option); + + var result = this._processFlatCoordsArray(option.data); + this._flatCoords = result.flatCoords; + this._flatCoordsOffset = result.flatCoordsOffset; + if (result.flatCoords) { + option.data = new Float32Array(result.count); + } + + LinesSeries.superApply(this, 'init', arguments); + }, + + mergeOption: function (option) { + // The input data may be null/undefined. + option.data = option.data || []; + + compatEc2(option); + + if (option.data) { + // Only update when have option data to merge. + var result = this._processFlatCoordsArray(option.data); + this._flatCoords = result.flatCoords; + this._flatCoordsOffset = result.flatCoordsOffset; + if (result.flatCoords) { + option.data = new Float32Array(result.count); + } + } + + LinesSeries.superApply(this, 'mergeOption', arguments); + }, + + appendData: function (params) { + var result = this._processFlatCoordsArray(params.data); + if (result.flatCoords) { + if (!this._flatCoords) { + this._flatCoords = result.flatCoords; + this._flatCoordsOffset = result.flatCoordsOffset; + } + else { + this._flatCoords = concatArray(this._flatCoords, result.flatCoords); + this._flatCoordsOffset = concatArray(this._flatCoordsOffset, result.flatCoordsOffset); + } + params.data = new Float32Array(result.count); + } + + this.getRawData().appendData(params.data); + }, + + _getCoordsFromItemModel: function (idx) { + var itemModel = this.getData().getItemModel(idx); + var coords = (itemModel.option instanceof Array) + ? itemModel.option : itemModel.getShallow('coords'); + + if (__DEV__) { + if (!(coords instanceof Array && coords.length > 0 && coords[0] instanceof Array)) { + throw new Error('Invalid coords ' + JSON.stringify(coords) + '. Lines must have 2d coords array in data item.'); + } + } + return coords; + }, + + getLineCoordsCount: function (idx) { + if (this._flatCoordsOffset) { + return this._flatCoordsOffset[idx * 2 + 1]; + } + else { + return this._getCoordsFromItemModel(idx).length; + } + }, + + getLineCoords: function (idx, out) { + if (this._flatCoordsOffset) { + var offset = this._flatCoordsOffset[idx * 2]; + var len = this._flatCoordsOffset[idx * 2 + 1]; + for (var i = 0; i < len; i++) { + out[i] = out[i] || []; + out[i][0] = this._flatCoords[offset + i * 2]; + out[i][1] = this._flatCoords[offset + i * 2 + 1]; + } + return len; + } + else { + var coords = this._getCoordsFromItemModel(idx); + for (var i = 0; i < coords.length; i++) { + out[i] = out[i] || []; + out[i][0] = coords[i][0]; + out[i][1] = coords[i][1]; + } + return coords.length; + } + }, + + _processFlatCoordsArray: function (data) { + var startOffset = 0; + if (this._flatCoords) { + startOffset = this._flatCoords.length; + } + // Stored as a typed array. In format + // Points Count(2) | x | y | x | y | Points Count(3) | x | y | x | y | x | y | + if (typeof data[0] === 'number') { + var len = data.length; + // Store offset and len of each segment + var coordsOffsetAndLenStorage = new Uint32Arr(len); + var coordsStorage = new Float64Arr(len); + var coordsCursor = 0; + var offsetCursor = 0; + var dataCount = 0; + for (var i = 0; i < len;) { + dataCount++; + var count = data[i++]; + // Offset + coordsOffsetAndLenStorage[offsetCursor++] = coordsCursor + startOffset; + // Len + coordsOffsetAndLenStorage[offsetCursor++] = count; + for (var k = 0; k < count; k++) { + var x = data[i++]; + var y = data[i++]; + coordsStorage[coordsCursor++] = x; + coordsStorage[coordsCursor++] = y; + + if (i > len) { + if (__DEV__) { + throw new Error('Invalid data format.'); + } + } + } + } + + return { + flatCoordsOffset: new Uint32Array(coordsOffsetAndLenStorage.buffer, 0, offsetCursor), + flatCoords: coordsStorage, + count: dataCount + }; + } + + return { + flatCoordsOffset: null, + flatCoords: null, + count: data.length + }; + }, + + getInitialData: function (option, ecModel) { + if (__DEV__) { + var CoordSys = CoordinateSystemManager.get(option.coordinateSystem); + if (!CoordSys) { + throw new Error('Unkown coordinate system ' + option.coordinateSystem); + } + } + + var lineData = new List(['value'], this); + lineData.hasItemOption = false; + + lineData.initData(option.data, [], function (dataItem, dimName, dataIndex, dimIndex) { + // dataItem is simply coords + if (dataItem instanceof Array) { + return NaN; + } + else { + lineData.hasItemOption = true; + var value = dataItem.value; + if (value != null) { + return value instanceof Array ? value[dimIndex] : value; + } + } + }); + + return lineData; + }, + + formatTooltip: function (dataIndex) { + var data = this.getData(); + var itemModel = data.getItemModel(dataIndex); + var name = itemModel.get('name'); + if (name) { + return name; + } + var fromName = itemModel.get('fromName'); + var toName = itemModel.get('toName'); + var html = []; + fromName != null && html.push(fromName); + toName != null && html.push(toName); + + return encodeHTML(html.join(' > ')); + }, + + preventIncremental: function () { + return !!this.get('effect.show'); + }, + + getProgressive: function () { + var progressive = this.option.progressive; + if (progressive == null) { + return this.option.large ? 1e4 : this.get('progressive'); + } + return progressive; + }, + + getProgressiveThreshold: function () { + var progressiveThreshold = this.option.progressiveThreshold; + if (progressiveThreshold == null) { + return this.option.large ? 2e4 : this.get('progressiveThreshold'); + } + return progressiveThreshold; + }, + + defaultOption: { + coordinateSystem: 'geo', + zlevel: 0, + z: 2, + legendHoverLink: true, + + hoverAnimation: true, + // Cartesian coordinate system + xAxisIndex: 0, + yAxisIndex: 0, + + symbol: ['none', 'none'], + symbolSize: [10, 10], + // Geo coordinate system + geoIndex: 0, + + effect: { + show: false, + period: 4, + // Animation delay. support callback + // delay: 0, + // If move with constant speed px/sec + // period will be ignored if this property is > 0, + constantSpeed: 0, + symbol: 'circle', + symbolSize: 3, + loop: true, + // Length of trail, 0 - 1 + trailLength: 0.2 + // Same with lineStyle.color + // color + }, + + large: false, + // Available when large is true + largeThreshold: 2000, + + // If lines are polyline + // polyline not support curveness, label, animation + polyline: false, + + label: { + show: false, + position: 'end' + // distance: 5, + // formatter: 标签文本格式器,同Tooltip.formatter,不支持异步回调 + }, + + lineStyle: { + opacity: 0.5 + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Provide effect for line + * @module echarts/chart/helper/EffectLine + */ + +/** + * @constructor + * @extends {module:zrender/graphic/Group} + * @alias {module:echarts/chart/helper/Line} + */ +function EffectLine(lineData, idx, seriesScope) { + Group.call(this); + + this.add(this.createLine(lineData, idx, seriesScope)); + + this._updateEffectSymbol(lineData, idx); +} + +var effectLineProto = EffectLine.prototype; + +effectLineProto.createLine = function (lineData, idx, seriesScope) { + return new Line$1(lineData, idx, seriesScope); +}; + +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 (!isArray(size)) { + size = [size, size]; + } + var color = effectModel.get('color') || lineData.getItemVisual(idx, 'color'); + var symbol = this.childAt(1); + + if (this._symbolType !== symbolType) { + // Remove previous + this.remove(symbol); + + symbol = createSymbol( + symbolType, -0.5, -0.5, 1, 1, color + ); + symbol.z2 = 100; + symbol.culling = true; + + this.add(symbol); + } + + // Symbol may be removed if loop is false + if (!symbol) { + return; + } + + // Shadow color is same with color in default + symbol.setStyle('shadowColor', color); + symbol.setStyle(effectModel.getItemStyle(['color'])); + + symbol.attr('scale', size); + + symbol.setColor(color); + symbol.attr('scale', size); + + this._symbolType = symbolType; + + this._updateEffectAnimation(lineData, effectModel, idx); +}; + +effectLineProto._updateEffectAnimation = function (lineData, effectModel, idx) { + + var symbol = this.childAt(1); + if (!symbol) { + return; + } + + var self = this; + + var points = lineData.getItemLayout(idx); + + var period = effectModel.get('period') * 1000; + var loop = effectModel.get('loop'); + var constantSpeed = effectModel.get('constantSpeed'); + var delayExpr = retrieve(effectModel.get('delay'), function (idx) { + return idx / lineData.count() * period / 3; + }); + var isDelayFunc = typeof delayExpr === 'function'; + + // Ignore when updating + symbol.ignore = true; + + this.updateAnimationPoints(symbol, points); + + if (constantSpeed > 0) { + period = this.getLineLength(symbol) / constantSpeed * 1000; + } + + if (period !== this._period || loop !== this._loop) { + + symbol.stopAnimation(); + + var delay = delayExpr; + if (isDelayFunc) { + delay = delayExpr(idx); + } + if (symbol.__t > 0) { + delay = -period * symbol.__t; + } + symbol.__t = 0; + var animator = symbol.animate('', loop) + .when(period, { + __t: 1 + }) + .delay(delay) + .during(function () { + self.updateSymbolPosition(symbol); + }); + if (!loop) { + animator.done(function () { + self.remove(symbol); + }); + } + animator.start(); + } + + this._period = period; + this._loop = loop; +}; + +effectLineProto.getLineLength = function (symbol) { + // Not so accurate + return (dist(symbol.__p1, symbol.__cp1) + + dist(symbol.__cp1, symbol.__p2)); +}; + +effectLineProto.updateAnimationPoints = function (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 + ]; +}; + +effectLineProto.updateData = function (lineData, idx, seriesScope) { + this.childAt(0).updateData(lineData, idx, seriesScope); + this._updateEffectSymbol(lineData, idx); +}; + +effectLineProto.updateSymbolPosition = function (symbol) { + var p1 = symbol.__p1; + var p2 = symbol.__p2; + var cp1 = symbol.__cp1; + var t = symbol.__t; + var pos = symbol.position; + var quadraticAt$$1 = quadraticAt; + var quadraticDerivativeAt$$1 = quadraticDerivativeAt; + pos[0] = quadraticAt$$1(p1[0], cp1[0], p2[0], t); + pos[1] = quadraticAt$$1(p1[1], cp1[1], p2[1], t); + + // Tangent + var tx = quadraticDerivativeAt$$1(p1[0], cp1[0], p2[0], t); + var ty = quadraticDerivativeAt$$1(p1[1], cp1[1], p2[1], t); + + symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; + + symbol.ignore = false; +}; + + +effectLineProto.updateLayout = function (lineData, idx) { + this.childAt(0).updateLayout(lineData, idx); + + var effectModel = lineData.getItemModel(idx).getModel('effect'); + this._updateEffectAnimation(lineData, effectModel, idx); +}; + +inherits(EffectLine, Group); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @module echarts/chart/helper/Line + */ + +/** + * @constructor + * @extends {module:zrender/graphic/Group} + * @alias {module:echarts/chart/helper/Polyline} + */ +function Polyline$2(lineData, idx, seriesScope) { + Group.call(this); + + this._createPolyline(lineData, idx, seriesScope); +} + +var polylineProto = Polyline$2.prototype; + +polylineProto._createPolyline = function (lineData, idx, seriesScope) { + // var seriesModel = lineData.hostModel; + var points = lineData.getItemLayout(idx); + + var line = new Polyline({ + shape: { + points: points + } + }); + + this.add(line); + + this._updateCommonStl(lineData, idx, seriesScope); +}; + +polylineProto.updateData = function (lineData, idx, seriesScope) { + var seriesModel = lineData.hostModel; + + var line = this.childAt(0); + var target = { + shape: { + points: lineData.getItemLayout(idx) + } + }; + updateProps(line, target, seriesModel, idx); + + this._updateCommonStl(lineData, idx, seriesScope); +}; + +polylineProto._updateCommonStl = function (lineData, idx, seriesScope) { + var line = this.childAt(0); + var itemModel = lineData.getItemModel(idx); + + var visualColor = lineData.getItemVisual(idx, 'color'); + + var lineStyle = seriesScope && seriesScope.lineStyle; + var hoverLineStyle = seriesScope && seriesScope.hoverLineStyle; + + if (!seriesScope || lineData.hasItemOption) { + lineStyle = itemModel.getModel('lineStyle').getLineStyle(); + hoverLineStyle = itemModel.getModel('emphasis.lineStyle').getLineStyle(); + } + line.useStyle(defaults( + { + strokeNoScale: true, + fill: 'none', + stroke: visualColor + }, + lineStyle + )); + line.hoverStyle = hoverLineStyle; + + setHoverStyle(this); +}; + +polylineProto.updateLayout = function (lineData, idx) { + var polyline = this.childAt(0); + polyline.setShape('points', lineData.getItemLayout(idx)); +}; + +inherits(Polyline$2, Group); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Provide effect for line + * @module echarts/chart/helper/EffectLine + */ + +/** + * @constructor + * @extends {module:echarts/chart/helper/EffectLine} + * @alias {module:echarts/chart/helper/Polyline} + */ +function EffectPolyline(lineData, idx, seriesScope) { + EffectLine.call(this, lineData, idx, seriesScope); + this._lastFrame = 0; + this._lastFramePercent = 0; +} + +var effectPolylineProto = EffectPolyline.prototype; + +// Overwrite +effectPolylineProto.createLine = function (lineData, idx, seriesScope) { + return new Polyline$2(lineData, idx, seriesScope); +}; + +// Overwrite +effectPolylineProto.updateAnimationPoints = function (symbol, points) { + this._points = points; + var accLenArr = [0]; + var len$$1 = 0; + for (var i = 1; i < points.length; i++) { + var p1 = points[i - 1]; + var p2 = points[i]; + len$$1 += dist(p1, p2); + accLenArr.push(len$$1); + } + if (len$$1 === 0) { + return; + } + + for (var i = 0; i < accLenArr.length; i++) { + accLenArr[i] /= len$$1; + } + this._offsets = accLenArr; + this._length = len$$1; +}; + +// Overwrite +effectPolylineProto.getLineLength = function (symbol) { + return this._length; +}; + +// Overwrite +effectPolylineProto.updateSymbolPosition = function (symbol) { + var t = symbol.__t; + var points = this._points; + var offsets = this._offsets; + var len$$1 = points.length; + + if (!offsets) { + // Has length 0 + return; + } + + var lastFrame = this._lastFrame; + var frame; + + if (t < this._lastFramePercent) { + // Start from the next frame + // PENDING start from lastFrame ? + var start = Math.min(lastFrame + 1, len$$1 - 1); + for (frame = start; frame >= 0; frame--) { + if (offsets[frame] <= t) { + break; + } + } + // PENDING really need to do this ? + frame = Math.min(frame, len$$1 - 2); + } + else { + for (var frame = lastFrame; frame < len$$1; frame++) { + if (offsets[frame] > t) { + break; + } + } + frame = Math.min(frame - 1, len$$1 - 2); + } + + lerp( + symbol.position, points[frame], points[frame + 1], + (t - offsets[frame]) / (offsets[frame + 1] - offsets[frame]) + ); + + var tx = points[frame + 1][0] - points[frame][0]; + var ty = points[frame + 1][1] - points[frame][1]; + symbol.rotation = -Math.atan2(ty, tx) - Math.PI / 2; + + this._lastFrame = frame; + this._lastFramePercent = t; + + symbol.ignore = false; +}; + +inherits(EffectPolyline, EffectLine); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// TODO Batch by color + +var LargeLineShape = extendShape({ + + shape: { + polyline: false, + curveness: 0, + segs: [] + }, + + buildPath: function (path, shape) { + var segs = shape.segs; + var curveness = shape.curveness; + + if (shape.polyline) { + for (var i = 0; i < segs.length;) { + var count = segs[i++]; + if (count > 0) { + path.moveTo(segs[i++], segs[i++]); + for (var k = 1; k < count; k++) { + path.lineTo(segs[i++], segs[i++]); + } + } + } + } + else { + for (var i = 0; i < segs.length;) { + var x0 = segs[i++]; + var y0 = segs[i++]; + var x1 = segs[i++]; + var y1 = segs[i++]; + path.moveTo(x0, y0); + if (curveness > 0) { + var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; + var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; + path.quadraticCurveTo(x2, y2, x1, y1); + } + else { + path.lineTo(x1, y1); + } + } + } + }, + + findDataIndex: function (x, y) { + + var shape = this.shape; + var segs = shape.segs; + var curveness = shape.curveness; + + if (shape.polyline) { + var dataIndex = 0; + for (var i = 0; i < segs.length;) { + var count = segs[i++]; + if (count > 0) { + var x0 = segs[i++]; + var y0 = segs[i++]; + for (var k = 1; k < count; k++) { + var x1 = segs[i++]; + var y1 = segs[i++]; + if (containStroke$1(x0, y0, x1, y1)) { + return dataIndex; + } + } + } + + dataIndex++; + } + } + else { + var dataIndex = 0; + for (var i = 0; i < segs.length;) { + var x0 = segs[i++]; + var y0 = segs[i++]; + var x1 = segs[i++]; + var y1 = segs[i++]; + if (curveness > 0) { + var x2 = (x0 + x1) / 2 - (y0 - y1) * curveness; + var y2 = (y0 + y1) / 2 - (x1 - x0) * curveness; + + if (containStroke$3(x0, y0, x2, y2, x1, y1)) { + return dataIndex; + } + } + else { + if (containStroke$1(x0, y0, x1, y1)) { + return dataIndex; + } + } + + dataIndex++; + } + } + + return -1; + } +}); + +function LargeLineDraw() { + this.group = new Group(); +} + +var largeLineProto = LargeLineDraw.prototype; + +largeLineProto.isPersistent = function () { + return !this._incremental; +}; + +/** + * Update symbols draw by new data + * @param {module:echarts/data/List} data + */ +largeLineProto.updateData = function (data) { + this.group.removeAll(); + + var lineEl = new LargeLineShape({ + rectHover: true, + cursor: 'default' + }); + lineEl.setShape({ + segs: data.getLayout('linesPoints') + }); + + this._setCommon(lineEl, data); + + // Add back + this.group.add(lineEl); + + this._incremental = null; +}; + +/** + * @override + */ +largeLineProto.incrementalPrepareUpdate = function (data) { + this.group.removeAll(); + + this._clearIncremental(); + + if (data.count() > 5e5) { + if (!this._incremental) { + this._incremental = new IncrementalDisplayble({ + silent: true + }); + } + this.group.add(this._incremental); + } + else { + this._incremental = null; + } +}; + +/** + * @override + */ +largeLineProto.incrementalUpdate = function (taskParams, data) { + var lineEl = new LargeLineShape(); + lineEl.setShape({ + segs: data.getLayout('linesPoints') + }); + + this._setCommon(lineEl, data, !!this._incremental); + + if (!this._incremental) { + lineEl.rectHover = true; + lineEl.cursor = 'default'; + lineEl.__startIndex = taskParams.start; + this.group.add(lineEl); + } + else { + this._incremental.addDisplayable(lineEl, true); + } +}; + +/** + * @override + */ +largeLineProto.remove = function () { + this._clearIncremental(); + this._incremental = null; + this.group.removeAll(); +}; + +largeLineProto._setCommon = function (lineEl, data, isIncremental) { + var hostModel = data.hostModel; + + lineEl.setShape({ + polyline: hostModel.get('polyline'), + curveness: hostModel.get('lineStyle.curveness') + }); + + lineEl.useStyle( + hostModel.getModel('lineStyle').getLineStyle() + ); + lineEl.style.strokeNoScale = true; + + var visualColor = data.getVisual('color'); + if (visualColor) { + lineEl.setStyle('stroke', visualColor); + } + lineEl.setStyle('fill'); + + if (!isIncremental) { + // Enable tooltip + // PENDING May have performance issue when path is extremely large + lineEl.seriesIndex = hostModel.seriesIndex; + lineEl.on('mousemove', function (e) { + lineEl.dataIndex = null; + var dataIndex = lineEl.findDataIndex(e.offsetX, e.offsetY); + if (dataIndex > 0) { + // Provide dataIndex for tooltip + lineEl.dataIndex = dataIndex + lineEl.__startIndex; + } + }); + } +}; + +largeLineProto._clearIncremental = function () { + var incremental = this._incremental; + if (incremental) { + incremental.clearDisplaybles(); + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 linesLayout = { + seriesType: 'lines', + + plan: createRenderPlanner(), + + reset: function (seriesModel) { + var coordSys = seriesModel.coordinateSystem; + var isPolyline = seriesModel.get('polyline'); + var isLarge = seriesModel.pipelineContext.large; + + function progress(params, lineData) { + var lineCoords = []; + if (isLarge) { + var points; + var segCount = params.end - params.start; + if (isPolyline) { + var totalCoordsCount = 0; + for (var i = params.start; i < params.end; i++) { + totalCoordsCount += seriesModel.getLineCoordsCount(i); + } + points = new Float32Array(segCount + totalCoordsCount * 2); + } + else { + points = new Float32Array(segCount * 4); + } + + var offset = 0; + var pt = []; + for (var i = params.start; i < params.end; i++) { + var len = seriesModel.getLineCoords(i, lineCoords); + if (isPolyline) { + points[offset++] = len; + } + for (var k = 0; k < len; k++) { + pt = coordSys.dataToPoint(lineCoords[k], false, pt); + points[offset++] = pt[0]; + points[offset++] = pt[1]; + } + } + + lineData.setLayout('linesPoints', points); + } + else { + for (var i = params.start; i < params.end; i++) { + var itemModel = lineData.getItemModel(i); + var len = seriesModel.getLineCoords(i, lineCoords); + + var pts = []; + if (isPolyline) { + for (var j = 0; j < len; j++) { + pts.push(coordSys.dataToPoint(lineCoords[j])); + } + } + else { + pts[0] = coordSys.dataToPoint(lineCoords[0]); + pts[1] = coordSys.dataToPoint(lineCoords[1]); + + var curveness = itemModel.get('lineStyle.curveness'); + if (+curveness) { + pts[2] = [ + (pts[0][0] + pts[1][0]) / 2 - (pts[0][1] - pts[1][1]) * curveness, + (pts[0][1] + pts[1][1]) / 2 - (pts[1][0] - pts[0][0]) * curveness + ]; + } + } + lineData.setItemLayout(i, pts); + } + } + } + + return { progress: progress }; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +extendChartView({ + + type: 'lines', + + init: function () {}, + + render: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + + var lineDraw = this._updateLineDraw(data, seriesModel); + + var zlevel = seriesModel.get('zlevel'); + var trailLength = seriesModel.get('effect.trailLength'); + + var zr = api.getZr(); + // Avoid the drag cause ghost shadow + // FIXME Better way ? + // SVG doesn't support + var isSvg = zr.painter.getType() === 'svg'; + if (!isSvg) { + zr.painter.getLayer(zlevel).clear(true); + } + // Config layer with motion blur + if (this._lastZlevel != null && !isSvg) { + zr.configLayer(this._lastZlevel, { + motionBlur: false + }); + } + if (this._showEffect(seriesModel) && trailLength) { + if (__DEV__) { + var notInIndividual = false; + ecModel.eachSeries(function (otherSeriesModel) { + if (otherSeriesModel !== seriesModel && otherSeriesModel.get('zlevel') === zlevel) { + notInIndividual = true; + } + }); + notInIndividual && console.warn('Lines with trail effect should have an individual zlevel'); + } + + if (!isSvg) { + zr.configLayer(zlevel, { + motionBlur: true, + lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0) + }); + } + } + + lineDraw.updateData(data); + + this._lastZlevel = zlevel; + + this._finished = true; + }, + + incrementalPrepareRender: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + + var lineDraw = this._updateLineDraw(data, seriesModel); + + lineDraw.incrementalPrepareUpdate(data); + + this._clearLayer(api); + + this._finished = false; + }, + + incrementalRender: function (taskParams, seriesModel, ecModel) { + this._lineDraw.incrementalUpdate(taskParams, seriesModel.getData()); + + this._finished = taskParams.end === seriesModel.getData().count(); + }, + + updateTransform: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + var pipelineContext = seriesModel.pipelineContext; + + if (!this._finished || pipelineContext.large || pipelineContext.progressiveRender) { + // TODO Don't have to do update in large mode. Only do it when there are millions of data. + return { + update: true + }; + } + else { + // TODO Use same logic with ScatterView. + // Manually update layout + var res = linesLayout.reset(seriesModel); + if (res.progress) { + res.progress({ start: 0, end: data.count() }, data); + } + this._lineDraw.updateLayout(); + this._clearLayer(api); + } + }, + + _updateLineDraw: function (data, seriesModel) { + var lineDraw = this._lineDraw; + var hasEffect = this._showEffect(seriesModel); + var isPolyline = !!seriesModel.get('polyline'); + var pipelineContext = seriesModel.pipelineContext; + var isLargeDraw = pipelineContext.large; + + if (__DEV__) { + if (hasEffect && isLargeDraw) { + console.warn('Large lines not support effect'); + } + } + if (!lineDraw + || hasEffect !== this._hasEffet + || isPolyline !== this._isPolyline + || isLargeDraw !== this._isLargeDraw + ) { + if (lineDraw) { + lineDraw.remove(); + } + lineDraw = this._lineDraw = isLargeDraw + ? new LargeLineDraw() + : new LineDraw( + isPolyline + ? (hasEffect ? EffectPolyline : Polyline$2) + : (hasEffect ? EffectLine : Line$1) + ); + this._hasEffet = hasEffect; + this._isPolyline = isPolyline; + this._isLargeDraw = isLargeDraw; + this.group.removeAll(); + } + + this.group.add(lineDraw.group); + + return lineDraw; + }, + + _showEffect: function (seriesModel) { + return !!seriesModel.get('effect.show'); + }, + + _clearLayer: function (api) { + // Not use motion when dragging or zooming + var zr = api.getZr(); + var isSvg = zr.painter.getType() === 'svg'; + if (!isSvg && this._lastZlevel != null) { + zr.painter.getLayer(this._lastZlevel).clear(true); + } + }, + + remove: function (ecModel, api) { + this._lineDraw && this._lineDraw.remove(); + this._lineDraw = null; + // Clear motion when lineDraw is removed + this._clearLayer(api); + }, + + dispose: function () {} +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 normalize$2(a) { + if (!(a instanceof Array)) { + a = [a, a]; + } + return a; +} + +var opacityQuery = 'lineStyle.opacity'.split('.'); + +var linesVisual = { + seriesType: 'lines', + reset: function (seriesModel, ecModel, api) { + var symbolType = normalize$2(seriesModel.get('symbol')); + var symbolSize = normalize$2(seriesModel.get('symbolSize')); + var data = seriesModel.getData(); + + data.setVisual('fromSymbol', symbolType && symbolType[0]); + data.setVisual('toSymbol', symbolType && symbolType[1]); + data.setVisual('fromSymbolSize', symbolSize && symbolSize[0]); + data.setVisual('toSymbolSize', symbolSize && symbolSize[1]); + data.setVisual('opacity', seriesModel.get(opacityQuery)); + + function dataEach(data, idx) { + var itemModel = data.getItemModel(idx); + var symbolType = normalize$2(itemModel.getShallow('symbol', true)); + var symbolSize = normalize$2(itemModel.getShallow('symbolSize', true)); + var opacity = itemModel.get(opacityQuery); + + symbolType[0] && data.setItemVisual(idx, 'fromSymbol', symbolType[0]); + symbolType[1] && data.setItemVisual(idx, 'toSymbol', symbolType[1]); + symbolSize[0] && data.setItemVisual(idx, 'fromSymbolSize', symbolSize[0]); + symbolSize[1] && data.setItemVisual(idx, 'toSymbolSize', symbolSize[1]); + + data.setItemVisual(idx, 'opacity', opacity); + } + + return {dataEach: data.hasItemOption ? dataEach : null}; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerLayout(linesLayout); +registerVisual(linesVisual); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +SeriesModel.extend({ + type: 'series.heatmap', + + getInitialData: function (option, ecModel) { + return createListFromArray(this.getSource(), this, { + generateCoord: 'value' + }); + }, + + preventIncremental: function () { + var coordSysCreator = CoordinateSystemManager.get(this.get('coordinateSystem')); + if (coordSysCreator && coordSysCreator.dimensions) { + return coordSysCreator.dimensions[0] === 'lng' && coordSysCreator.dimensions[1] === 'lat'; + } + }, + + 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 + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file defines echarts Heatmap Chart + * @author Ovilia (me@zhangwenli.com) + * Inspired by https://github.com/mourner/simpleheat + * + * @module + */ + +var GRADIENT_LEVELS = 256; + +/** + * Heatmap Chart + * + * @class + */ +function Heatmap() { + var canvas = 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); + } + + if (!canvas.width || !canvas.height) { + // Avoid "Uncaught DOMException: Failed to execute 'getImageData' on + // 'CanvasRenderingContext2D': The source height is 0." + return canvas; + } + + // 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 = 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 = [0, 0, 0, 0]; + 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; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 getIsInPiecewiseRange(dataExtent, pieceList, selected) { + var dataSpan = dataExtent[1] - dataExtent[0]; + pieceList = 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'; +} + +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 (__DEV__) { + if (!visualMapOfThisSeries) { + throw new Error('Heatmap must use with visualMap'); + } + } + + this.group.removeAll(); + + this._incrementalDisplayable = null; + + var coordSys = seriesModel.coordinateSystem; + if (coordSys.type === 'cartesian2d' || coordSys.type === 'calendar') { + this._renderOnCartesianAndCalendar(seriesModel, api, 0, seriesModel.getData().count()); + } + else if (isGeoCoordSys(coordSys)) { + this._renderOnGeo( + coordSys, seriesModel, visualMapOfThisSeries, api + ); + } + }, + + incrementalPrepareRender: function (seriesModel, ecModel, api) { + this.group.removeAll(); + }, + + incrementalRender: function (params, seriesModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + if (coordSys) { + this._renderOnCartesianAndCalendar(seriesModel, api, params.start, params.end, true); + } + }, + + _renderOnCartesianAndCalendar: function (seriesModel, api, start, end, incremental) { + + var coordSys = seriesModel.coordinateSystem; + var width; + var height; + + if (coordSys.type === 'cartesian2d') { + var xAxis = coordSys.getAxis('x'); + var yAxis = coordSys.getAxis('y'); + + if (__DEV__) { + 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'); + } + } + + width = xAxis.getBandWidth(); + height = yAxis.getBandWidth(); + } + + var group = this.group; + var data = seriesModel.getData(); + + var itemStyleQuery = 'itemStyle'; + var hoverItemStyleQuery = 'emphasis.itemStyle'; + var labelQuery = 'label'; + var hoverLabelQuery = 'emphasis.label'; + var style = seriesModel.getModel(itemStyleQuery).getItemStyle(['color']); + var hoverStl = seriesModel.getModel(hoverItemStyleQuery).getItemStyle(); + var labelModel = seriesModel.getModel(labelQuery); + var hoverLabelModel = seriesModel.getModel(hoverLabelQuery); + var coordSysType = coordSys.type; + + + var dataDims = coordSysType === 'cartesian2d' + ? [ + data.mapDimension('x'), + data.mapDimension('y'), + data.mapDimension('value') + ] + : [ + data.mapDimension('time'), + data.mapDimension('value') + ]; + + for (var idx = start; idx < end; idx++) { + var rect; + + if (coordSysType === 'cartesian2d') { + // Ignore empty data + if (isNaN(data.get(dataDims[2], idx))) { + continue; + } + + var point = coordSys.dataToPoint([ + data.get(dataDims[0], idx), + data.get(dataDims[1], idx) + ]); + + rect = new Rect({ + shape: { + x: point[0] - width / 2, + y: point[1] - height / 2, + width: width, + height: height + }, + style: { + fill: data.getItemVisual(idx, 'color'), + opacity: data.getItemVisual(idx, 'opacity') + } + }); + } + else { + // Ignore empty data + if (isNaN(data.get(dataDims[1], idx))) { + continue; + } + + rect = new Rect({ + z2: 1, + shape: coordSys.dataToRect([data.get(dataDims[0], idx)]).contentShape, + style: { + fill: data.getItemVisual(idx, 'color'), + opacity: data.getItemVisual(idx, 'opacity') + } + }); + } + + var itemModel = data.getItemModel(idx); + + // Optimization for large datset + if (data.hasItemOption) { + style = itemModel.getModel(itemStyleQuery).getItemStyle(['color']); + hoverStl = itemModel.getModel(hoverItemStyleQuery).getItemStyle(); + labelModel = itemModel.getModel(labelQuery); + hoverLabelModel = itemModel.getModel(hoverLabelQuery); + } + + var rawValue = seriesModel.getRawValue(idx); + var defaultText = '-'; + if (rawValue && rawValue[2] != null) { + defaultText = rawValue[2]; + } + + setLabelStyle( + style, hoverStl, labelModel, hoverLabelModel, + { + labelFetcher: seriesModel, + labelDataIndex: idx, + defaultText: defaultText, + isRectText: true + } + ); + + rect.setStyle(style); + setHoverStyle(rect, data.hasItemOption ? hoverStl : extend({}, hoverStl)); + + rect.incremental = incremental; + // PENDING + if (incremental) { + // Rect must use hover layer if it's incremental. + rect.useHoverLayer = true; + } + + 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 Heatmap()); + 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 dims = [ + data.mapDimension('lng'), + data.mapDimension('lat'), + data.mapDimension('value') + ]; + + var points = data.mapArray(dims, 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 ZImage({ + style: { + width: width, + height: height, + x: x, + y: y, + image: hmLayer.canvas + }, + silent: true + }); + this.group.add(img); + }, + + dispose: function () {} +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 PictorialBarSeries = BaseBarSeries.extend({ + + type: 'series.pictorialBar', + + dependencies: ['grid'], + + defaultOption: { + symbol: 'circle', // Customized bar shape + symbolSize: null, // Can be ['100%', '100%'], null means auto. + symbolRotate: null, + + symbolPosition: null, // 'start' or 'end' or 'center', null means auto. + symbolOffset: null, + symbolMargin: null, // start margin and end margin. Can be a number or a percent string. + // Auto margin by defualt. + symbolRepeat: false, // false/null/undefined, means no repeat. + // Can be true, means auto calculate repeat times and cut by data. + // Can be a number, specifies repeat times, and do not cut by data. + // Can be 'fixed', means auto calculate repeat times but do not cut by data. + symbolRepeatDirection: 'end', // 'end' means from 'start' to 'end'. + + symbolClip: false, + symbolBoundingData: null, // Can be 60 or -40 or [-40, 60] + symbolPatternSize: 400, // 400 * 400 px + + barGap: '-100%', // In most case, overlap is needed. + + // z can be set in data item, which is z2 actually. + + // Disable progressive + progressive: 0, + hoverAnimation: false // Open only when needed. + }, + + getInitialData: function (option) { + // Disable stack. + option.stack = null; + return PictorialBarSeries.superApply(this, 'getInitialData', arguments); + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 BAR_BORDER_WIDTH_QUERY$1 = ['itemStyle', 'borderWidth']; + +// index: +isHorizontal +var LAYOUT_ATTRS = [ + {xy: 'x', wh: 'width', index: 0, posDesc: ['left', 'right']}, + {xy: 'y', wh: 'height', index: 1, posDesc: ['top', 'bottom']} +]; + +var pathForLineWidth = new Circle(); + +var BarView$1 = extendChartView({ + + type: 'pictorialBar', + + render: 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 coordSysRect = cartesian.grid.getRect(); + + var opt = { + ecSize: {width: api.getWidth(), height: api.getHeight()}, + seriesModel: seriesModel, + coordSys: cartesian, + coordSysExtent: [ + [coordSysRect.x, coordSysRect.x + coordSysRect.width], + [coordSysRect.y, coordSysRect.y + coordSysRect.height] + ], + isHorizontal: isHorizontal, + valueDim: LAYOUT_ATTRS[+isHorizontal], + categoryDim: LAYOUT_ATTRS[1 - isHorizontal] + }; + + data.diff(oldData) + .add(function (dataIndex) { + if (!data.hasValue(dataIndex)) { + return; + } + + var itemModel = getItemModel(data, dataIndex); + var symbolMeta = getSymbolMeta(data, dataIndex, itemModel, opt); + + var bar = createBar(data, opt, symbolMeta); + + data.setItemGraphicEl(dataIndex, bar); + group.add(bar); + + updateCommon$1(bar, opt, symbolMeta); + }) + .update(function (newIndex, oldIndex) { + var bar = oldData.getItemGraphicEl(oldIndex); + + if (!data.hasValue(newIndex)) { + group.remove(bar); + return; + } + + var itemModel = getItemModel(data, newIndex); + var symbolMeta = getSymbolMeta(data, newIndex, itemModel, opt); + + var pictorialShapeStr = getShapeStr(data, symbolMeta); + if (bar && pictorialShapeStr !== bar.__pictorialShapeStr) { + group.remove(bar); + data.setItemGraphicEl(newIndex, null); + bar = null; + } + + if (bar) { + updateBar(bar, opt, symbolMeta); + } + else { + bar = createBar(data, opt, symbolMeta, true); + } + + data.setItemGraphicEl(newIndex, bar); + bar.__pictorialSymbolMeta = symbolMeta; + // Add back + group.add(bar); + + updateCommon$1(bar, opt, symbolMeta); + }) + .remove(function (dataIndex) { + var bar = oldData.getItemGraphicEl(dataIndex); + bar && removeBar(oldData, dataIndex, bar.__pictorialSymbolMeta.animationModel, bar); + }) + .execute(); + + this._data = data; + + return this.group; + }, + + dispose: noop, + + remove: function (ecModel, api) { + var group = this.group; + var data = this._data; + if (ecModel.get('animation')) { + if (data) { + data.eachItemGraphicEl(function (bar) { + removeBar(data, bar.dataIndex, ecModel, bar); + }); + } + } + else { + group.removeAll(); + } + } +}); + + +// Set or calculate default value about symbol, and calculate layout info. +function getSymbolMeta(data, dataIndex, itemModel, opt) { + var layout = data.getItemLayout(dataIndex); + var symbolRepeat = itemModel.get('symbolRepeat'); + var symbolClip = itemModel.get('symbolClip'); + var symbolPosition = itemModel.get('symbolPosition') || 'start'; + var symbolRotate = itemModel.get('symbolRotate'); + var rotation = (symbolRotate || 0) * Math.PI / 180 || 0; + var symbolPatternSize = itemModel.get('symbolPatternSize') || 2; + var isAnimationEnabled = itemModel.isAnimationEnabled(); + + var symbolMeta = { + dataIndex: dataIndex, + layout: layout, + itemModel: itemModel, + symbolType: data.getItemVisual(dataIndex, 'symbol') || 'circle', + color: data.getItemVisual(dataIndex, 'color'), + symbolClip: symbolClip, + symbolRepeat: symbolRepeat, + symbolRepeatDirection: itemModel.get('symbolRepeatDirection'), + symbolPatternSize: symbolPatternSize, + rotation: rotation, + animationModel: isAnimationEnabled ? itemModel : null, + hoverAnimation: isAnimationEnabled && itemModel.get('hoverAnimation'), + z2: itemModel.getShallow('z', true) || 0 + }; + + prepareBarLength(itemModel, symbolRepeat, layout, opt, symbolMeta); + + prepareSymbolSize( + data, dataIndex, layout, symbolRepeat, symbolClip, symbolMeta.boundingLength, + symbolMeta.pxSign, symbolPatternSize, opt, symbolMeta + ); + + prepareLineWidth(itemModel, symbolMeta.symbolScale, rotation, opt, symbolMeta); + + var symbolSize = symbolMeta.symbolSize; + var symbolOffset = itemModel.get('symbolOffset'); + if (isArray(symbolOffset)) { + symbolOffset = [ + parsePercent$1(symbolOffset[0], symbolSize[0]), + parsePercent$1(symbolOffset[1], symbolSize[1]) + ]; + } + + prepareLayoutInfo( + itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, + symbolPosition, symbolMeta.valueLineWidth, symbolMeta.boundingLength, symbolMeta.repeatCutLength, + opt, symbolMeta + ); + + return symbolMeta; +} + +// bar length can be negative. +function prepareBarLength(itemModel, symbolRepeat, layout, opt, output) { + var valueDim = opt.valueDim; + var symbolBoundingData = itemModel.get('symbolBoundingData'); + var valueAxis = opt.coordSys.getOtherAxis(opt.coordSys.getBaseAxis()); + var zeroPx = valueAxis.toGlobalCoord(valueAxis.dataToCoord(0)); + var pxSignIdx = 1 - +(layout[valueDim.wh] <= 0); + var boundingLength; + + if (isArray(symbolBoundingData)) { + var symbolBoundingExtent = [ + convertToCoordOnAxis(valueAxis, symbolBoundingData[0]) - zeroPx, + convertToCoordOnAxis(valueAxis, symbolBoundingData[1]) - zeroPx + ]; + symbolBoundingExtent[1] < symbolBoundingExtent[0] && (symbolBoundingExtent.reverse()); + boundingLength = symbolBoundingExtent[pxSignIdx]; + } + else if (symbolBoundingData != null) { + boundingLength = convertToCoordOnAxis(valueAxis, symbolBoundingData) - zeroPx; + } + else if (symbolRepeat) { + boundingLength = opt.coordSysExtent[valueDim.index][pxSignIdx] - zeroPx; + } + else { + boundingLength = layout[valueDim.wh]; + } + + output.boundingLength = boundingLength; + + if (symbolRepeat) { + output.repeatCutLength = layout[valueDim.wh]; + } + + output.pxSign = boundingLength > 0 ? 1 : boundingLength < 0 ? -1 : 0; +} + +function convertToCoordOnAxis(axis, value) { + return axis.toGlobalCoord(axis.dataToCoord(axis.scale.parse(value))); +} + +// Support ['100%', '100%'] +function prepareSymbolSize( + data, dataIndex, layout, symbolRepeat, symbolClip, boundingLength, + pxSign, symbolPatternSize, opt, output +) { + var valueDim = opt.valueDim; + var categoryDim = opt.categoryDim; + var categorySize = Math.abs(layout[categoryDim.wh]); + + var symbolSize = data.getItemVisual(dataIndex, 'symbolSize'); + if (isArray(symbolSize)) { + symbolSize = symbolSize.slice(); + } + else { + if (symbolSize == null) { + symbolSize = '100%'; + } + symbolSize = [symbolSize, symbolSize]; + } + + // Note: percentage symbolSize (like '100%') do not consider lineWidth, because it is + // to complicated to calculate real percent value if considering scaled lineWidth. + // So the actual size will bigger than layout size if lineWidth is bigger than zero, + // which can be tolerated in pictorial chart. + + symbolSize[categoryDim.index] = parsePercent$1( + symbolSize[categoryDim.index], + categorySize + ); + symbolSize[valueDim.index] = parsePercent$1( + symbolSize[valueDim.index], + symbolRepeat ? categorySize : Math.abs(boundingLength) + ); + + output.symbolSize = symbolSize; + + // If x or y is less than zero, show reversed shape. + var symbolScale = output.symbolScale = [ + symbolSize[0] / symbolPatternSize, + symbolSize[1] / symbolPatternSize + ]; + // Follow convention, 'right' and 'top' is the normal scale. + symbolScale[valueDim.index] *= (opt.isHorizontal ? -1 : 1) * pxSign; +} + +function prepareLineWidth(itemModel, symbolScale, rotation, opt, output) { + // In symbols are drawn with scale, so do not need to care about the case that width + // or height are too small. But symbol use strokeNoScale, where acture lineWidth should + // be calculated. + var valueLineWidth = itemModel.get(BAR_BORDER_WIDTH_QUERY$1) || 0; + + if (valueLineWidth) { + pathForLineWidth.attr({ + scale: symbolScale.slice(), + rotation: rotation + }); + pathForLineWidth.updateTransform(); + valueLineWidth /= pathForLineWidth.getLineScale(); + valueLineWidth *= symbolScale[opt.valueDim.index]; + } + + output.valueLineWidth = valueLineWidth; +} + +function prepareLayoutInfo( + itemModel, symbolSize, layout, symbolRepeat, symbolClip, symbolOffset, + symbolPosition, valueLineWidth, boundingLength, repeatCutLength, opt, output +) { + var categoryDim = opt.categoryDim; + var valueDim = opt.valueDim; + var pxSign = output.pxSign; + + var unitLength = Math.max(symbolSize[valueDim.index] + valueLineWidth, 0); + var pathLen = unitLength; + + // Note: rotation will not effect the layout of symbols, because user may + // want symbols to rotate on its center, which should not be translated + // when rotating. + + if (symbolRepeat) { + var absBoundingLength = Math.abs(boundingLength); + + var symbolMargin = retrieve(itemModel.get('symbolMargin'), '15%') + ''; + var hasEndGap = false; + if (symbolMargin.lastIndexOf('!') === symbolMargin.length - 1) { + hasEndGap = true; + symbolMargin = symbolMargin.slice(0, symbolMargin.length - 1); + } + symbolMargin = parsePercent$1(symbolMargin, symbolSize[valueDim.index]); + + var uLenWithMargin = Math.max(unitLength + symbolMargin * 2, 0); + + // When symbol margin is less than 0, margin at both ends will be subtracted + // to ensure that all of the symbols will not be overflow the given area. + var endFix = hasEndGap ? 0 : symbolMargin * 2; + + // Both final repeatTimes and final symbolMargin area calculated based on + // boundingLength. + var repeatSpecified = isNumeric(symbolRepeat); + var repeatTimes = repeatSpecified + ? symbolRepeat + : toIntTimes((absBoundingLength + endFix) / uLenWithMargin); + + // Adjust calculate margin, to ensure each symbol is displayed + // entirely in the given layout area. + var mDiff = absBoundingLength - repeatTimes * unitLength; + symbolMargin = mDiff / 2 / (hasEndGap ? repeatTimes : repeatTimes - 1); + uLenWithMargin = unitLength + symbolMargin * 2; + endFix = hasEndGap ? 0 : symbolMargin * 2; + + // Update repeatTimes when not all symbol will be shown. + if (!repeatSpecified && symbolRepeat !== 'fixed') { + repeatTimes = repeatCutLength + ? toIntTimes((Math.abs(repeatCutLength) + endFix) / uLenWithMargin) + : 0; + } + + pathLen = repeatTimes * uLenWithMargin - endFix; + output.repeatTimes = repeatTimes; + output.symbolMargin = symbolMargin; + } + + var sizeFix = pxSign * (pathLen / 2); + var pathPosition = output.pathPosition = []; + pathPosition[categoryDim.index] = layout[categoryDim.wh] / 2; + pathPosition[valueDim.index] = symbolPosition === 'start' + ? sizeFix + : symbolPosition === 'end' + ? boundingLength - sizeFix + : boundingLength / 2; // 'center' + if (symbolOffset) { + pathPosition[0] += symbolOffset[0]; + pathPosition[1] += symbolOffset[1]; + } + + var bundlePosition = output.bundlePosition = []; + bundlePosition[categoryDim.index] = layout[categoryDim.xy]; + bundlePosition[valueDim.index] = layout[valueDim.xy]; + + var barRectShape = output.barRectShape = extend({}, layout); + barRectShape[valueDim.wh] = pxSign * Math.max( + Math.abs(layout[valueDim.wh]), Math.abs(pathPosition[valueDim.index] + sizeFix) + ); + barRectShape[categoryDim.wh] = layout[categoryDim.wh]; + + var clipShape = output.clipShape = {}; + // Consider that symbol may be overflow layout rect. + clipShape[categoryDim.xy] = -layout[categoryDim.xy]; + clipShape[categoryDim.wh] = opt.ecSize[categoryDim.wh]; + clipShape[valueDim.xy] = 0; + clipShape[valueDim.wh] = layout[valueDim.wh]; +} + +function createPath(symbolMeta) { + var symbolPatternSize = symbolMeta.symbolPatternSize; + var path = createSymbol( + // Consider texture img, make a big size. + symbolMeta.symbolType, + -symbolPatternSize / 2, + -symbolPatternSize / 2, + symbolPatternSize, + symbolPatternSize, + symbolMeta.color + ); + path.attr({ + culling: true + }); + path.type !== 'image' && path.setStyle({ + strokeNoScale: true + }); + + return path; +} + +function createOrUpdateRepeatSymbols(bar, opt, symbolMeta, isUpdate) { + var bundle = bar.__pictorialBundle; + var symbolSize = symbolMeta.symbolSize; + var valueLineWidth = symbolMeta.valueLineWidth; + var pathPosition = symbolMeta.pathPosition; + var valueDim = opt.valueDim; + var repeatTimes = symbolMeta.repeatTimes || 0; + + var index = 0; + var unit = symbolSize[opt.valueDim.index] + valueLineWidth + symbolMeta.symbolMargin * 2; + + eachPath(bar, function (path) { + path.__pictorialAnimationIndex = index; + path.__pictorialRepeatTimes = repeatTimes; + if (index < repeatTimes) { + updateAttr(path, null, makeTarget(index), symbolMeta, isUpdate); + } + else { + updateAttr(path, null, {scale: [0, 0]}, symbolMeta, isUpdate, function () { + bundle.remove(path); + }); + } + + updateHoverAnimation(path, symbolMeta); + + index++; + }); + + for (; index < repeatTimes; index++) { + var path = createPath(symbolMeta); + path.__pictorialAnimationIndex = index; + path.__pictorialRepeatTimes = repeatTimes; + bundle.add(path); + + var target = makeTarget(index); + + updateAttr( + path, + { + position: target.position, + scale: [0, 0] + }, + { + scale: target.scale, + rotation: target.rotation + }, + symbolMeta, + isUpdate + ); + + // FIXME + // If all emphasis/normal through action. + path + .on('mouseover', onMouseOver) + .on('mouseout', onMouseOut); + + updateHoverAnimation(path, symbolMeta); + } + + function makeTarget(index) { + var position = pathPosition.slice(); + // (start && pxSign > 0) || (end && pxSign < 0): i = repeatTimes - index + // Otherwise: i = index; + var pxSign = symbolMeta.pxSign; + var i = index; + if (symbolMeta.symbolRepeatDirection === 'start' ? pxSign > 0 : pxSign < 0) { + i = repeatTimes - 1 - index; + } + position[valueDim.index] = unit * (i - repeatTimes / 2 + 0.5) + pathPosition[valueDim.index]; + + return { + position: position, + scale: symbolMeta.symbolScale.slice(), + rotation: symbolMeta.rotation + }; + } + + function onMouseOver() { + eachPath(bar, function (path) { + path.trigger('emphasis'); + }); + } + + function onMouseOut() { + eachPath(bar, function (path) { + path.trigger('normal'); + }); + } +} + +function createOrUpdateSingleSymbol(bar, opt, symbolMeta, isUpdate) { + var bundle = bar.__pictorialBundle; + var mainPath = bar.__pictorialMainPath; + + if (!mainPath) { + mainPath = bar.__pictorialMainPath = createPath(symbolMeta); + bundle.add(mainPath); + + updateAttr( + mainPath, + { + position: symbolMeta.pathPosition.slice(), + scale: [0, 0], + rotation: symbolMeta.rotation + }, + { + scale: symbolMeta.symbolScale.slice() + }, + symbolMeta, + isUpdate + ); + + mainPath + .on('mouseover', onMouseOver) + .on('mouseout', onMouseOut); + } + else { + updateAttr( + mainPath, + null, + { + position: symbolMeta.pathPosition.slice(), + scale: symbolMeta.symbolScale.slice(), + rotation: symbolMeta.rotation + }, + symbolMeta, + isUpdate + ); + } + + updateHoverAnimation(mainPath, symbolMeta); + + function onMouseOver() { + this.trigger('emphasis'); + } + + function onMouseOut() { + this.trigger('normal'); + } +} + +// bar rect is used for label. +function createOrUpdateBarRect(bar, symbolMeta, isUpdate) { + var rectShape = extend({}, symbolMeta.barRectShape); + + var barRect = bar.__pictorialBarRect; + if (!barRect) { + barRect = bar.__pictorialBarRect = new Rect({ + z2: 2, + shape: rectShape, + silent: true, + style: { + stroke: 'transparent', + fill: 'transparent', + lineWidth: 0 + } + }); + + bar.add(barRect); + } + else { + updateAttr(barRect, null, {shape: rectShape}, symbolMeta, isUpdate); + } +} + +function createOrUpdateClip(bar, opt, symbolMeta, isUpdate) { + // If not clip, symbol will be remove and rebuilt. + if (symbolMeta.symbolClip) { + var clipPath = bar.__pictorialClipPath; + var clipShape = extend({}, symbolMeta.clipShape); + var valueDim = opt.valueDim; + var animationModel = symbolMeta.animationModel; + var dataIndex = symbolMeta.dataIndex; + + if (clipPath) { + updateProps( + clipPath, {shape: clipShape}, animationModel, dataIndex + ); + } + else { + clipShape[valueDim.wh] = 0; + clipPath = new Rect({shape: clipShape}); + bar.__pictorialBundle.setClipPath(clipPath); + bar.__pictorialClipPath = clipPath; + + var target = {}; + target[valueDim.wh] = symbolMeta.clipShape[valueDim.wh]; + + graphic[isUpdate ? 'updateProps' : 'initProps']( + clipPath, {shape: target}, animationModel, dataIndex + ); + } + } +} + +function getItemModel(data, dataIndex) { + var itemModel = data.getItemModel(dataIndex); + itemModel.getAnimationDelayParams = getAnimationDelayParams; + itemModel.isAnimationEnabled = isAnimationEnabled; + return itemModel; +} + +function getAnimationDelayParams(path) { + // The order is the same as the z-order, see `symbolRepeatDiretion`. + return { + index: path.__pictorialAnimationIndex, + count: path.__pictorialRepeatTimes + }; +} + +function isAnimationEnabled() { + // `animation` prop can be set on itemModel in pictorial bar chart. + return this.parentModel.isAnimationEnabled() && !!this.getShallow('animation'); +} + +function updateHoverAnimation(path, symbolMeta) { + path.off('emphasis').off('normal'); + + var scale = symbolMeta.symbolScale.slice(); + + symbolMeta.hoverAnimation && path + .on('emphasis', function() { + this.animateTo({ + scale: [scale[0] * 1.1, scale[1] * 1.1] + }, 400, 'elasticOut'); + }) + .on('normal', function() { + this.animateTo({ + scale: scale.slice() + }, 400, 'elasticOut'); + }); +} + +function createBar(data, opt, symbolMeta, isUpdate) { + // bar is the main element for each data. + var bar = new Group(); + // bundle is used for location and clip. + var bundle = new Group(); + bar.add(bundle); + bar.__pictorialBundle = bundle; + bundle.attr('position', symbolMeta.bundlePosition.slice()); + + if (symbolMeta.symbolRepeat) { + createOrUpdateRepeatSymbols(bar, opt, symbolMeta); + } + else { + createOrUpdateSingleSymbol(bar, opt, symbolMeta); + } + + createOrUpdateBarRect(bar, symbolMeta, isUpdate); + + createOrUpdateClip(bar, opt, symbolMeta, isUpdate); + + bar.__pictorialShapeStr = getShapeStr(data, symbolMeta); + bar.__pictorialSymbolMeta = symbolMeta; + + return bar; +} + +function updateBar(bar, opt, symbolMeta) { + var animationModel = symbolMeta.animationModel; + var dataIndex = symbolMeta.dataIndex; + var bundle = bar.__pictorialBundle; + + updateProps( + bundle, {position: symbolMeta.bundlePosition.slice()}, animationModel, dataIndex + ); + + if (symbolMeta.symbolRepeat) { + createOrUpdateRepeatSymbols(bar, opt, symbolMeta, true); + } + else { + createOrUpdateSingleSymbol(bar, opt, symbolMeta, true); + } + + createOrUpdateBarRect(bar, symbolMeta, true); + + createOrUpdateClip(bar, opt, symbolMeta, true); +} + +function removeBar(data, dataIndex, animationModel, bar) { + // Not show text when animating + var labelRect = bar.__pictorialBarRect; + labelRect && (labelRect.style.text = null); + + var pathes = []; + eachPath(bar, function (path) { + pathes.push(path); + }); + bar.__pictorialMainPath && pathes.push(bar.__pictorialMainPath); + + // I do not find proper remove animation for clip yet. + bar.__pictorialClipPath && (animationModel = null); + + each$1(pathes, function (path) { + updateProps( + path, {scale: [0, 0]}, animationModel, dataIndex, + function () { + bar.parent && bar.parent.remove(bar); + } + ); + }); + + data.setItemGraphicEl(dataIndex, null); +} + +function getShapeStr(data, symbolMeta) { + return [ + data.getItemVisual(symbolMeta.dataIndex, 'symbol') || 'none', + !!symbolMeta.symbolRepeat, + !!symbolMeta.symbolClip + ].join(':'); +} + +function eachPath(bar, cb, context) { + // Do not use Group#eachChild, because it do not support remove. + each$1(bar.__pictorialBundle.children(), function (el) { + el !== bar.__pictorialBarRect && cb.call(context, el); + }); +} + +function updateAttr(el, immediateAttrs, animationAttrs, symbolMeta, isUpdate, cb) { + immediateAttrs && el.attr(immediateAttrs); + // when symbolCip used, only clip path has init animation, otherwise it would be weird effect. + if (symbolMeta.symbolClip && !isUpdate) { + animationAttrs && el.attr(animationAttrs); + } + else { + animationAttrs && graphic[isUpdate ? 'updateProps' : 'initProps']( + el, animationAttrs, symbolMeta.animationModel, symbolMeta.dataIndex, cb + ); + } +} + +function updateCommon$1(bar, opt, symbolMeta) { + var color = symbolMeta.color; + var dataIndex = symbolMeta.dataIndex; + var itemModel = symbolMeta.itemModel; + // Color must be excluded. + // Because symbol provide setColor individually to set fill and stroke + var normalStyle = itemModel.getModel('itemStyle').getItemStyle(['color']); + var hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); + var cursorStyle = itemModel.getShallow('cursor'); + + eachPath(bar, function (path) { + // PENDING setColor should be before setStyle!!! + path.setColor(color); + path.setStyle(defaults( + { + fill: color, + opacity: symbolMeta.opacity + }, + normalStyle + )); + setHoverStyle(path, hoverStyle); + + cursorStyle && (path.cursor = cursorStyle); + path.z2 = symbolMeta.z2; + }); + + var barRectHoverStyle = {}; + var barPositionOutside = opt.valueDim.posDesc[+(symbolMeta.boundingLength > 0)]; + var barRect = bar.__pictorialBarRect; + + setLabel( + barRect.style, barRectHoverStyle, itemModel, + color, opt.seriesModel, dataIndex, barPositionOutside + ); + + setHoverStyle(barRect, barRectHoverStyle); +} + +function toIntTimes(times) { + var roundedTimes = Math.round(times); + // Escapse accurate error + return Math.abs(times - roundedTimes) < 1e-4 + ? roundedTimes + : Math.ceil(times); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// In case developer forget to include grid component +registerLayout(curry( + layout, 'pictorialBar' +)); +registerVisual(visualSymbol('pictorialBar', 'roundRect')); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @constructor module:echarts/coord/single/SingleAxis + * @extends {module:echarts/coord/Axis} + * @param {string} dim + * @param {*} scale + * @param {Array.} coordExtent + * @param {string} axisType + * @param {string} position + */ +var SingleAxis = 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' + * @type {string} + */ + this.position = position || 'bottom'; + + /** + * Axis orient + * - 'horizontal' + * - 'vertical' + * @type {[type]} + */ + this.orient = null; + +}; + +SingleAxis.prototype = { + + constructor: SingleAxis, + + /** + * Axis model + * @type {module:echarts/coord/single/AxisModel} + */ + model: null, + + /** + * Judge the orient of the axis. + * @return {boolean} + */ + isHorizontal: function () { + var position = this.position; + return position === 'top' || position === 'bottom'; + + }, + + /** + * @override + */ + pointToData: function (point, clamp) { + return this.coordinateSystem.pointToData(point, clamp)[0]; + }, + + /** + * Convert the local coord(processed by dataToCoord()) + * to global coord(concrete pixel coord). + * designated by module:echarts/coord/single/Single. + * @type {Function} + */ + toGlobalCoord: null, + + /** + * Convert the global coord to local coord. + * designated by module:echarts/coord/single/Single. + * @type {Function} + */ + toLocalCoord: null + +}; + +inherits(SingleAxis, Axis); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Single coordinates system. + */ + +/** + * Create a single coordinates system. + * + * @param {module:echarts/coord/single/AxisModel} axisModel + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + */ +function Single(axisModel, ecModel, api) { + + /** + * @type {string} + * @readOnly + */ + this.dimension = 'single'; + + /** + * Add it just for draw tooltip. + * + * @type {Array.} + * @readOnly + */ + this.dimensions = ['single']; + + /** + * @private + * @type {module:echarts/coord/single/SingleAxis}. + */ + this._axis = null; + + /** + * @private + * @type {module:zrender/core/BoundingRect} + */ + this._rect; + + this._init(axisModel, ecModel, api); + + /** + * @type {module:echarts/coord/single/AxisModel} + */ + this.model = axisModel; +} + +Single.prototype = { + + type: 'singleAxis', + + axisPointerEnabled: true, + + constructor: Single, + + /** + * Initialize single coordinate system. + * + * @param {module:echarts/coord/single/AxisModel} axisModel + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + * @private + */ + _init: function (axisModel, ecModel, api) { + + var dim = this.dimension; + + var axis = new SingleAxis( + dim, + createScaleByModel(axisModel), + [0, 0], + axisModel.get('type'), + axisModel.get('position') + ); + + var isCategory = axis.type === 'category'; + axis.onBand = isCategory && axisModel.get('boundaryGap'); + axis.inverse = axisModel.get('inverse'); + axis.orient = axisModel.get('orient'); + + axisModel.axis = axis; + axis.model = axisModel; + axis.coordinateSystem = this; + this._axis = axis; + }, + + /** + * Update axis scale after data processed + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + */ + update: function (ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.coordinateSystem === this) { + var data = seriesModel.getData(); + each$1(data.mapDimension(this.dimension, true), function (dim) { + this._axis.scale.unionExtentFromData(data, dim); + }, this); + niceScaleExtent(this._axis.scale, this._axis.model); + } + }, this); + }, + + /** + * Resize the single coordinate system. + * + * @param {module:echarts/coord/single/AxisModel} axisModel + * @param {module:echarts/ExtensionAPI} api + */ + resize: function (axisModel, api) { + this._rect = getLayoutRect( + { + left: axisModel.get('left'), + top: axisModel.get('top'), + right: axisModel.get('right'), + bottom: axisModel.get('bottom'), + width: axisModel.get('width'), + height: axisModel.get('height') + }, + { + width: api.getWidth(), + height: api.getHeight() + } + ); + + this._adjustAxis(); + }, + + /** + * @return {module:zrender/core/BoundingRect} + */ + getRect: function () { + return this._rect; + }, + + /** + * @private + */ + _adjustAxis: function () { + + var rect = this._rect; + var axis = this._axis; + + var isHorizontal = axis.isHorizontal(); + var extent = isHorizontal ? [0, rect.width] : [0, rect.height]; + var idx = axis.reverse ? 1 : 0; + + axis.setExtent(extent[idx], extent[1 - idx]); + + this._updateAxisTransform(axis, isHorizontal ? rect.x : rect.y); + + }, + + /** + * @param {module:echarts/coord/single/SingleAxis} axis + * @param {number} coordBase + */ + _updateAxisTransform: function (axis, coordBase) { + + var axisExtent = axis.getExtent(); + var extentSum = axisExtent[0] + axisExtent[1]; + var isHorizontal = axis.isHorizontal(); + + axis.toGlobalCoord = isHorizontal + ? function (coord) { + return coord + coordBase; + } + : function (coord) { + return extentSum - coord + coordBase; + }; + + axis.toLocalCoord = isHorizontal + ? function (coord) { + return coord - coordBase; + } + : function (coord) { + return extentSum - coord + coordBase; + }; + }, + + /** + * Get axis. + * + * @return {module:echarts/coord/single/SingleAxis} + */ + getAxis: function () { + return this._axis; + }, + + /** + * Get axis, add it just for draw tooltip. + * + * @return {[type]} [description] + */ + getBaseAxis: function () { + return this._axis; + }, + + /** + * @return {Array.} + */ + getAxes: function () { + return [this._axis]; + }, + + /** + * @return {Object} {baseAxes: [], otherAxes: []} + */ + getTooltipAxes: function () { + return {baseAxes: [this.getAxis()]}; + }, + + /** + * If contain point. + * + * @param {Array.} point + * @return {boolean} + */ + containPoint: function (point) { + var rect = this.getRect(); + var axis = this.getAxis(); + var orient = axis.orient; + if (orient === 'horizontal') { + return axis.contain(axis.toLocalCoord(point[0])) + && (point[1] >= rect.y && point[1] <= (rect.y + rect.height)); + } + else { + return axis.contain(axis.toLocalCoord(point[1])) + && (point[0] >= rect.y && point[0] <= (rect.y + rect.height)); + } + }, + + /** + * @param {Array.} point + * @return {Array.} + */ + pointToData: function (point) { + var axis = this.getAxis(); + return [axis.coordToData(axis.toLocalCoord( + point[axis.orient === 'horizontal' ? 0 : 1] + ))]; + }, + + /** + * Convert the series data to concrete point. + * + * @param {number|Array.} val + * @return {Array.} + */ + dataToPoint: function (val) { + var axis = this.getAxis(); + var rect = this.getRect(); + var pt = []; + var idx = axis.orient === 'horizontal' ? 0 : 1; + + if (val instanceof Array) { + val = val[0]; + } + + pt[idx] = axis.toGlobalCoord(axis.dataToCoord(+val)); + pt[1 - idx] = idx === 0 ? (rect.y + rect.height / 2) : (rect.x + rect.width / 2); + return pt; + } + +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Single coordinate system creator. + */ + +/** + * Create single coordinate system and inject it into seriesModel. + * + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + * @return {Array.} + */ +function create$3(ecModel, api) { + var singles = []; + + ecModel.eachComponent('singleAxis', function(axisModel, idx) { + + var single = new Single(axisModel, ecModel, api); + single.name = 'single_' + idx; + single.resize(axisModel, api); + axisModel.coordinateSystem = single; + singles.push(single); + + }); + + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.get('coordinateSystem') === 'singleAxis') { + var singleAxisModel = ecModel.queryComponents({ + mainType: 'singleAxis', + index: seriesModel.get('singleAxisIndex'), + id: seriesModel.get('singleAxisId') + })[0]; + seriesModel.coordinateSystem = singleAxisModel && singleAxisModel.coordinateSystem; + } + }); + + return singles; +} + +CoordinateSystemManager.register('single', { + create: create$3, + dimensions: Single.prototype.dimensions +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @param {Object} opt {labelInside} + * @return {Object} { + * position, rotation, labelDirection, labelOffset, + * tickDirection, labelRotate, z2 + * } + */ +function layout$2(axisModel, opt) { + opt = opt || {}; + var single = axisModel.coordinateSystem; + var axis = axisModel.axis; + var layout = {}; + + var axisPosition = axis.position; + var orient = axis.orient; + + var rect = single.getRect(); + var rectBound = [rect.x, rect.x + rect.width, rect.y, rect.y + rect.height]; + + var positionMap = { + horizontal: {top: rectBound[2], bottom: rectBound[3]}, + vertical: {left: rectBound[0], right: rectBound[1]} + }; + + layout.position = [ + orient === 'vertical' + ? positionMap.vertical[axisPosition] + : rectBound[0], + orient === 'horizontal' + ? positionMap.horizontal[axisPosition] + : rectBound[3] + ]; + + var r = {horizontal: 0, vertical: 1}; + layout.rotation = Math.PI / 2 * r[orient]; + + var directionMap = {top: -1, bottom: 1, right: 1, left: -1}; + + layout.labelDirection = layout.tickDirection + = layout.nameDirection + = directionMap[axisPosition]; + + if (axisModel.get('axisTick.inside')) { + layout.tickDirection = -layout.tickDirection; + } + + if (retrieve(opt.labelInside, axisModel.get('axisLabel.inside'))) { + layout.labelDirection = -layout.labelDirection; + } + + var labelRotation = opt.rotate; + labelRotation == null && (labelRotation = axisModel.get('axisLabel.rotate')); + layout.labelRotation = axisPosition === 'top' ? -labelRotation : labelRotation; + + layout.z2 = 1; + + return layout; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 axisBuilderAttrs$2 = [ + 'axisLine', 'axisTickLabel', 'axisName' +]; + +var selfBuilderAttr = 'splitLine'; + +var SingleAxisView = AxisView.extend({ + + type: 'singleAxis', + + axisPointerClass: 'SingleAxisPointer', + + render: function (axisModel, ecModel, api, payload) { + + var group = this.group; + + group.removeAll(); + + var layout = layout$2(axisModel); + + var axisBuilder = new AxisBuilder(axisModel, layout); + + each$1(axisBuilderAttrs$2, axisBuilder.add, axisBuilder); + + group.add(axisBuilder.getGroup()); + + if (axisModel.get(selfBuilderAttr + '.show')) { + this['_' + selfBuilderAttr](axisModel); + } + + SingleAxisView.superCall(this, 'render', axisModel, ecModel, api, payload); + }, + + _splitLine: function(axisModel) { + var axis = axisModel.axis; + + if (axis.scale.isBlank()) { + return; + } + + var splitLineModel = axisModel.getModel('splitLine'); + var lineStyleModel = splitLineModel.getModel('lineStyle'); + var lineWidth = lineStyleModel.get('width'); + var lineColors = lineStyleModel.get('color'); + + lineColors = lineColors instanceof Array ? lineColors : [lineColors]; + + var gridRect = axisModel.coordinateSystem.getRect(); + var isHorizontal = axis.isHorizontal(); + + var splitLines = []; + var lineCount = 0; + + var ticksCoords = axis.getTicksCoords({ + tickModel: splitLineModel + }); + + var p1 = []; + var p2 = []; + + for (var i = 0; i < ticksCoords.length; ++i) { + var tickCoord = axis.toGlobalCoord(ticksCoords[i].coord); + 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 Line( + subPixelOptimizeLine({ + shape: { + x1: p1[0], + y1: p1[1], + x2: p2[0], + y2: p2[1] + }, + style: { + lineWidth: lineWidth + }, + silent: true + }))); + } + + for (var i = 0; i < splitLines.length; ++i) { + this.group.add(mergePath(splitLines[i], { + style: { + stroke: lineColors[i % lineColors.length], + lineDash: lineStyleModel.getLineDash(lineWidth), + lineWidth: lineWidth + }, + silent: true + })); + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 AxisModel$4 = ComponentModel.extend({ + + type: 'singleAxis', + + layoutMode: 'box', + + /** + * @type {module:echarts/coord/single/SingleAxis} + */ + axis: null, + + /** + * @type {module:echarts/coord/single/Single} + */ + coordinateSystem: null, + + /** + * @override + */ + getCoordSysModel: function () { + return this; + } + +}); + +var defaultOption$2 = { + + left: '5%', + top: '5%', + right: '5%', + bottom: '5%', + + type: 'value', + + position: 'bottom', + + orient: 'horizontal', + + axisLine: { + show: true, + lineStyle: { + width: 2, + type: 'solid' + } + }, + + // Single coordinate system and single axis is the, + // which is used as the parent tooltip model. + // same model, so we set default tooltip show as true. + tooltip: { + show: true + }, + + axisTick: { + show: true, + length: 6, + lineStyle: { + width: 2 + } + }, + + axisLabel: { + show: true, + interval: 'auto' + }, + + splitLine: { + show: true, + lineStyle: { + type: 'dashed', + opacity: 0.2 + } + } +}; + +function getAxisType$2(axisName, option) { + return option.type || (option.data ? 'category' : 'value'); +} + +merge(AxisModel$4.prototype, axisModelCommonMixin); + +axisModelCreator('single', AxisModel$4, getAxisType$2, defaultOption$2); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @param {Object} finder contains {seriesIndex, dataIndex, dataIndexInside} + * @param {module:echarts/model/Global} ecModel + * @return {Object} {point: [x, y], el: ...} point Will not be null. + */ +var findPointFromSeries = function (finder, ecModel) { + var point = []; + var seriesIndex = finder.seriesIndex; + var seriesModel; + if (seriesIndex == null || !( + seriesModel = ecModel.getSeriesByIndex(seriesIndex) + )) { + return {point: []}; + } + + var data = seriesModel.getData(); + var dataIndex = queryDataIndex(data, finder); + if (dataIndex == null || dataIndex < 0 || isArray(dataIndex)) { + return {point: []}; + } + + var el = data.getItemGraphicEl(dataIndex); + var coordSys = seriesModel.coordinateSystem; + + if (seriesModel.getTooltipPosition) { + point = seriesModel.getTooltipPosition(dataIndex) || []; + } + else if (coordSys && coordSys.dataToPoint) { + point = coordSys.dataToPoint( + data.getValues( + map(coordSys.dimensions, function (dim) { + return data.mapDimension(dim); + }), dataIndex, true + ) + ) || []; + } + else if (el) { + // Use graphic bounding rect + var rect = el.getBoundingRect().clone(); + rect.applyTransform(el.transform); + point = [ + rect.x + rect.width / 2, + rect.y + rect.height / 2 + ]; + } + + return {point: point, el: el}; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$14 = each$1; +var curry$3 = curry; +var inner$9 = makeInner(); + +/** + * Basic logic: check all axis, if they do not demand show/highlight, + * then hide/downplay them. + * + * @param {Object} coordSysAxesInfo + * @param {Object} payload + * @param {string} [payload.currTrigger] 'click' | 'mousemove' | 'leave' + * @param {Array.} [payload.x] x and y, which are mandatory, specify a point to + * trigger axisPointer and tooltip. + * @param {Array.} [payload.y] x and y, which are mandatory, specify a point to + * trigger axisPointer and tooltip. + * @param {Object} [payload.seriesIndex] finder, optional, restrict target axes. + * @param {Object} [payload.dataIndex] finder, restrict target axes. + * @param {Object} [payload.axesInfo] finder, restrict target axes. + * [{ + * axisDim: 'x'|'y'|'angle'|..., + * axisIndex: ..., + * value: ... + * }, ...] + * @param {Function} [payload.dispatchAction] + * @param {Object} [payload.tooltipOption] + * @param {Object|Array.|Function} [payload.position] Tooltip position, + * which can be specified in dispatchAction + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + * @return {Object} content of event obj for echarts.connect. + */ +var axisTrigger = function (payload, ecModel, api) { + var currTrigger = payload.currTrigger; + var point = [payload.x, payload.y]; + var finder = payload; + var dispatchAction = payload.dispatchAction || bind(api.dispatchAction, api); + var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; + + // Pending + // See #6121. But we are not able to reproduce it yet. + if (!coordSysAxesInfo) { + return; + } + + if (illegalPoint(point)) { + // Used in the default behavior of `connection`: use the sample seriesIndex + // and dataIndex. And also used in the tooltipView trigger. + point = findPointFromSeries({ + seriesIndex: finder.seriesIndex, + // Do not use dataIndexInside from other ec instance. + // FIXME: auto detect it? + dataIndex: finder.dataIndex + }, ecModel).point; + } + var isIllegalPoint = illegalPoint(point); + + // Axis and value can be specified when calling dispatchAction({type: 'updateAxisPointer'}). + // Notice: In this case, it is difficult to get the `point` (which is necessary to show + // tooltip, so if point is not given, we just use the point found by sample seriesIndex + // and dataIndex. + var inputAxesInfo = finder.axesInfo; + + var axesInfo = coordSysAxesInfo.axesInfo; + var shouldHide = currTrigger === 'leave' || illegalPoint(point); + var outputFinder = {}; + + var showValueMap = {}; + var dataByCoordSys = {list: [], map: {}}; + var updaters = { + showPointer: curry$3(showPointer, showValueMap), + showTooltip: curry$3(showTooltip, dataByCoordSys) + }; + + // Process for triggered axes. + each$14(coordSysAxesInfo.coordSysMap, function (coordSys, coordSysKey) { + // If a point given, it must be contained by the coordinate system. + var coordSysContainsPoint = isIllegalPoint || coordSys.containPoint(point); + + each$14(coordSysAxesInfo.coordSysAxesInfo[coordSysKey], function (axisInfo, key) { + var axis = axisInfo.axis; + var inputAxisInfo = findInputAxisInfo(inputAxesInfo, axisInfo); + // If no inputAxesInfo, no axis is restricted. + if (!shouldHide && coordSysContainsPoint && (!inputAxesInfo || inputAxisInfo)) { + var val = inputAxisInfo && inputAxisInfo.value; + if (val == null && !isIllegalPoint) { + val = axis.pointToData(point); + } + val != null && processOnAxis(axisInfo, val, updaters, false, outputFinder); + } + }); + }); + + // Process for linked axes. + var linkTriggers = {}; + each$14(axesInfo, function (tarAxisInfo, tarKey) { + var linkGroup = tarAxisInfo.linkGroup; + + // If axis has been triggered in the previous stage, it should not be triggered by link. + if (linkGroup && !showValueMap[tarKey]) { + each$14(linkGroup.axesInfo, function (srcAxisInfo, srcKey) { + var srcValItem = showValueMap[srcKey]; + // If srcValItem exist, source axis is triggered, so link to target axis. + if (srcAxisInfo !== tarAxisInfo && srcValItem) { + var val = srcValItem.value; + linkGroup.mapper && (val = tarAxisInfo.axis.scale.parse(linkGroup.mapper( + val, makeMapperParam(srcAxisInfo), makeMapperParam(tarAxisInfo) + ))); + linkTriggers[tarAxisInfo.key] = val; + } + }); + } + }); + each$14(linkTriggers, function (val, tarKey) { + processOnAxis(axesInfo[tarKey], val, updaters, true, outputFinder); + }); + + updateModelActually(showValueMap, axesInfo, outputFinder); + dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction); + dispatchHighDownActually(axesInfo, dispatchAction, api); + + return outputFinder; +}; + +function processOnAxis(axisInfo, newValue, updaters, dontSnap, outputFinder) { + var axis = axisInfo.axis; + + if (axis.scale.isBlank() || !axis.containData(newValue)) { + return; + } + + if (!axisInfo.involveSeries) { + updaters.showPointer(axisInfo, newValue); + return; + } + + // Heavy calculation. So put it after axis.containData checking. + var payloadInfo = buildPayloadsBySeries(newValue, axisInfo); + var payloadBatch = payloadInfo.payloadBatch; + var snapToValue = payloadInfo.snapToValue; + + // Fill content of event obj for echarts.connect. + // By defualt use the first involved series data as a sample to connect. + if (payloadBatch[0] && outputFinder.seriesIndex == null) { + extend(outputFinder, payloadBatch[0]); + } + + // If no linkSource input, this process is for collecting link + // target, where snap should not be accepted. + if (!dontSnap && axisInfo.snap) { + if (axis.containData(snapToValue) && snapToValue != null) { + newValue = snapToValue; + } + } + + updaters.showPointer(axisInfo, newValue, payloadBatch, outputFinder); + // Tooltip should always be snapToValue, otherwise there will be + // incorrect "axis value ~ series value" mapping displayed in tooltip. + updaters.showTooltip(axisInfo, payloadInfo, snapToValue); +} + +function buildPayloadsBySeries(value, axisInfo) { + var axis = axisInfo.axis; + var dim = axis.dim; + var snapToValue = value; + var payloadBatch = []; + var minDist = Number.MAX_VALUE; + var minDiff = -1; + + each$14(axisInfo.seriesModels, function (series, idx) { + var dataDim = series.getData().mapDimension(dim, true); + var seriesNestestValue; + var dataIndices; + + if (series.getAxisTooltipData) { + var result = series.getAxisTooltipData(dataDim, value, axis); + dataIndices = result.dataIndices; + seriesNestestValue = result.nestestValue; + } + else { + dataIndices = series.getData().indicesOfNearest( + dataDim[0], + value, + // Add a threshold to avoid find the wrong dataIndex + // when data length is not same. + // false, + axis.type === 'category' ? 0.5 : null + ); + if (!dataIndices.length) { + return; + } + seriesNestestValue = series.getData().get(dataDim[0], dataIndices[0]); + } + + if (seriesNestestValue == null || !isFinite(seriesNestestValue)) { + return; + } + + var diff = value - seriesNestestValue; + var dist = Math.abs(diff); + // Consider category case + if (dist <= minDist) { + if (dist < minDist || (diff >= 0 && minDiff < 0)) { + minDist = dist; + minDiff = diff; + snapToValue = seriesNestestValue; + payloadBatch.length = 0; + } + each$14(dataIndices, function (dataIndex) { + payloadBatch.push({ + seriesIndex: series.seriesIndex, + dataIndexInside: dataIndex, + dataIndex: series.getData().getRawIndex(dataIndex) + }); + }); + } + }); + + return { + payloadBatch: payloadBatch, + snapToValue: snapToValue + }; +} + +function showPointer(showValueMap, axisInfo, value, payloadBatch) { + showValueMap[axisInfo.key] = {value: value, payloadBatch: payloadBatch}; +} + +function showTooltip(dataByCoordSys, axisInfo, payloadInfo, value) { + var payloadBatch = payloadInfo.payloadBatch; + var axis = axisInfo.axis; + var axisModel = axis.model; + var axisPointerModel = axisInfo.axisPointerModel; + + // If no data, do not create anything in dataByCoordSys, + // whose length will be used to judge whether dispatch action. + if (!axisInfo.triggerTooltip || !payloadBatch.length) { + return; + } + + var coordSysModel = axisInfo.coordSys.model; + var coordSysKey = makeKey(coordSysModel); + var coordSysItem = dataByCoordSys.map[coordSysKey]; + if (!coordSysItem) { + coordSysItem = dataByCoordSys.map[coordSysKey] = { + coordSysId: coordSysModel.id, + coordSysIndex: coordSysModel.componentIndex, + coordSysType: coordSysModel.type, + coordSysMainType: coordSysModel.mainType, + dataByAxis: [] + }; + dataByCoordSys.list.push(coordSysItem); + } + + coordSysItem.dataByAxis.push({ + axisDim: axis.dim, + axisIndex: axisModel.componentIndex, + axisType: axisModel.type, + axisId: axisModel.id, + value: value, + // Caustion: viewHelper.getValueLabel is actually on "view stage", which + // depends that all models have been updated. So it should not be performed + // here. Considering axisPointerModel used here is volatile, which is hard + // to be retrieve in TooltipView, we prepare parameters here. + valueLabelOpt: { + precision: axisPointerModel.get('label.precision'), + formatter: axisPointerModel.get('label.formatter') + }, + seriesDataIndices: payloadBatch.slice() + }); +} + +function updateModelActually(showValueMap, axesInfo, outputFinder) { + var outputAxesInfo = outputFinder.axesInfo = []; + // Basic logic: If no 'show' required, 'hide' this axisPointer. + each$14(axesInfo, function (axisInfo, key) { + var option = axisInfo.axisPointerModel.option; + var valItem = showValueMap[key]; + + if (valItem) { + !axisInfo.useHandle && (option.status = 'show'); + option.value = valItem.value; + // For label formatter param and highlight. + option.seriesDataIndices = (valItem.payloadBatch || []).slice(); + } + // When always show (e.g., handle used), remain + // original value and status. + else { + // If hide, value still need to be set, consider + // click legend to toggle axis blank. + !axisInfo.useHandle && (option.status = 'hide'); + } + + // If status is 'hide', should be no info in payload. + option.status === 'show' && outputAxesInfo.push({ + axisDim: axisInfo.axis.dim, + axisIndex: axisInfo.axis.model.componentIndex, + value: option.value + }); + }); +} + +function dispatchTooltipActually(dataByCoordSys, point, payload, dispatchAction) { + // Basic logic: If no showTip required, hideTip will be dispatched. + if (illegalPoint(point) || !dataByCoordSys.list.length) { + dispatchAction({type: 'hideTip'}); + return; + } + + // In most case only one axis (or event one series is used). It is + // convinient to fetch payload.seriesIndex and payload.dataIndex + // dirtectly. So put the first seriesIndex and dataIndex of the first + // axis on the payload. + var sampleItem = ((dataByCoordSys.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {}; + + dispatchAction({ + type: 'showTip', + escapeConnect: true, + x: point[0], + y: point[1], + tooltipOption: payload.tooltipOption, + position: payload.position, + dataIndexInside: sampleItem.dataIndexInside, + dataIndex: sampleItem.dataIndex, + seriesIndex: sampleItem.seriesIndex, + dataByCoordSys: dataByCoordSys.list + }); +} + +function dispatchHighDownActually(axesInfo, dispatchAction, api) { + // FIXME + // highlight status modification shoule be a stage of main process? + // (Consider confilct (e.g., legend and axisPointer) and setOption) + + var zr = api.getZr(); + var highDownKey = 'axisPointerLastHighlights'; + var lastHighlights = inner$9(zr)[highDownKey] || {}; + var newHighlights = inner$9(zr)[highDownKey] = {}; + + // Update highlight/downplay status according to axisPointer model. + // Build hash map and remove duplicate incidentally. + each$14(axesInfo, function (axisInfo, key) { + var option = axisInfo.axisPointerModel.option; + option.status === 'show' && each$14(option.seriesDataIndices, function (batchItem) { + var key = batchItem.seriesIndex + ' | ' + batchItem.dataIndex; + newHighlights[key] = batchItem; + }); + }); + + // Diff. + var toHighlight = []; + var toDownplay = []; + each$1(lastHighlights, function (batchItem, key) { + !newHighlights[key] && toDownplay.push(batchItem); + }); + each$1(newHighlights, function (batchItem, key) { + !lastHighlights[key] && toHighlight.push(batchItem); + }); + + toDownplay.length && api.dispatchAction({ + type: 'downplay', escapeConnect: true, batch: toDownplay + }); + toHighlight.length && api.dispatchAction({ + type: 'highlight', escapeConnect: true, batch: toHighlight + }); +} + +function findInputAxisInfo(inputAxesInfo, axisInfo) { + for (var i = 0; i < (inputAxesInfo || []).length; i++) { + var inputAxisInfo = inputAxesInfo[i]; + if (axisInfo.axis.dim === inputAxisInfo.axisDim + && axisInfo.axis.model.componentIndex === inputAxisInfo.axisIndex + ) { + return inputAxisInfo; + } + } +} + +function makeMapperParam(axisInfo) { + var axisModel = axisInfo.axis.model; + var item = {}; + var dim = item.axisDim = axisInfo.axis.dim; + item.axisIndex = item[dim + 'AxisIndex'] = axisModel.componentIndex; + item.axisName = item[dim + 'AxisName'] = axisModel.name; + item.axisId = item[dim + 'AxisId'] = axisModel.id; + return item; +} + +function illegalPoint(point) { + return !point || point[0] == null || isNaN(point[0]) || point[1] == null || isNaN(point[1]); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 AxisPointerModel = extendComponentModel({ + + type: 'axisPointer', + + coordSysAxesInfo: null, + + defaultOption: { + // 'auto' means that show when triggered by tooltip or handle. + show: 'auto', + // 'click' | 'mousemove' | 'none' + triggerOn: null, // set default in AxisPonterView.js + + zlevel: 0, + z: 50, + + type: 'line', + // axispointer triggered by tootip determine snap automatically, + // see `modelHelper`. + snap: false, + triggerTooltip: true, + + value: null, + status: null, // Init value depends on whether handle is used. + + // [group0, group1, ...] + // Each group can be: { + // mapper: function () {}, + // singleTooltip: 'multiple', // 'multiple' or 'single' + // xAxisId: ..., + // yAxisName: ..., + // angleAxisIndex: ... + // } + // mapper: can be ignored. + // input: {axisInfo, value} + // output: {axisInfo, value} + link: [], + + // Do not set 'auto' here, otherwise global animation: false + // will not effect at this axispointer. + animation: null, + animationDurationUpdate: 200, + + lineStyle: { + color: '#aaa', + width: 1, + type: 'solid' + }, + + shadowStyle: { + color: 'rgba(150,150,150,0.3)' + }, + + label: { + show: true, + formatter: null, // string | Function + precision: 'auto', // Or a number like 0, 1, 2 ... + margin: 3, + color: '#fff', + padding: [5, 7, 5, 7], + backgroundColor: 'auto', // default: axis line color + borderColor: null, + borderWidth: 0, + shadowBlur: 3, + shadowColor: '#aaa' + // Considering applicability, common style should + // better not have shadowOffset. + // shadowOffsetX: 0, + // shadowOffsetY: 2 + }, + + handle: { + show: false, + icon: 'M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z', // jshint ignore:line + size: 45, + // handle margin is from symbol center to axis, which is stable when circular move. + margin: 50, + // color: '#1b8bbd' + // color: '#2f4554' + color: '#333', + shadowBlur: 3, + shadowColor: '#aaa', + shadowOffsetX: 0, + shadowOffsetY: 2, + + // For mobile performance + throttle: 40 + } + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 inner$10 = makeInner(); +var each$15 = each$1; + +/** + * @param {string} key + * @param {module:echarts/ExtensionAPI} api + * @param {Function} handler + * param: {string} currTrigger + * param: {Array.} point + */ +function register(key, api, handler) { + if (env$1.node) { + return; + } + + var zr = api.getZr(); + inner$10(zr).records || (inner$10(zr).records = {}); + + initGlobalListeners(zr, api); + + var record = inner$10(zr).records[key] || (inner$10(zr).records[key] = {}); + record.handler = handler; +} + +function initGlobalListeners(zr, api) { + if (inner$10(zr).initialized) { + return; + } + + inner$10(zr).initialized = true; + + useHandler('click', curry(doEnter, 'click')); + useHandler('mousemove', curry(doEnter, 'mousemove')); + // useHandler('mouseout', onLeave); + useHandler('globalout', onLeave); + + function useHandler(eventType, cb) { + zr.on(eventType, function (e) { + var dis = makeDispatchAction(api); + + each$15(inner$10(zr).records, function (record) { + record && cb(record, e, dis.dispatchAction); + }); + + dispatchTooltipFinally(dis.pendings, api); + }); + } +} + +function dispatchTooltipFinally(pendings, api) { + var showLen = pendings.showTip.length; + var hideLen = pendings.hideTip.length; + + var actuallyPayload; + if (showLen) { + actuallyPayload = pendings.showTip[showLen - 1]; + } + else if (hideLen) { + actuallyPayload = pendings.hideTip[hideLen - 1]; + } + if (actuallyPayload) { + actuallyPayload.dispatchAction = null; + api.dispatchAction(actuallyPayload); + } +} + +function onLeave(record, e, dispatchAction) { + record.handler('leave', null, dispatchAction); +} + +function doEnter(currTrigger, record, e, dispatchAction) { + record.handler(currTrigger, e, dispatchAction); +} + +function makeDispatchAction(api) { + var pendings = { + showTip: [], + hideTip: [] + }; + // FIXME + // better approach? + // 'showTip' and 'hideTip' can be triggered by axisPointer and tooltip, + // which may be conflict, (axisPointer call showTip but tooltip call hideTip); + // So we have to add "final stage" to merge those dispatched actions. + var dispatchAction = function (payload) { + var pendingList = pendings[payload.type]; + if (pendingList) { + pendingList.push(payload); + } + else { + payload.dispatchAction = dispatchAction; + api.dispatchAction(payload); + } + }; + + return { + dispatchAction: dispatchAction, + pendings: pendings + }; +} + +/** + * @param {string} key + * @param {module:echarts/ExtensionAPI} api + */ +function unregister(key, api) { + if (env$1.node) { + return; + } + var zr = api.getZr(); + var record = (inner$10(zr).records || {})[key]; + if (record) { + inner$10(zr).records[key] = null; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 AxisPointerView = extendComponentView({ + + type: 'axisPointer', + + render: function (globalAxisPointerModel, ecModel, api) { + var globalTooltipModel = ecModel.getComponent('tooltip'); + var triggerOn = globalAxisPointerModel.get('triggerOn') + || (globalTooltipModel && globalTooltipModel.get('triggerOn') || 'mousemove|click'); + + // Register global listener in AxisPointerView to enable + // AxisPointerView to be independent to Tooltip. + register( + 'axisPointer', + api, + function (currTrigger, e, dispatchAction) { + // If 'none', it is not controlled by mouse totally. + if (triggerOn !== 'none' + && (currTrigger === 'leave' || triggerOn.indexOf(currTrigger) >= 0) + ) { + dispatchAction({ + type: 'updateAxisPointer', + currTrigger: currTrigger, + x: e && e.offsetX, + y: e && e.offsetY + }); + } + } + ); + }, + + /** + * @override + */ + remove: function (ecModel, api) { + unregister(api.getZr(), 'axisPointer'); + AxisPointerView.superApply(this._model, 'remove', arguments); + }, + + /** + * @override + */ + dispose: function (ecModel, api) { + unregister('axisPointer', api); + AxisPointerView.superApply(this._model, 'dispose', arguments); + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 inner$11 = makeInner(); +var clone$4 = clone; +var bind$2 = bind; + +/** + * Base axis pointer class in 2D. + * Implemenents {module:echarts/component/axis/IAxisPointer}. + */ +function BaseAxisPointer () { +} + +BaseAxisPointer.prototype = { + + /** + * @private + */ + _group: null, + + /** + * @private + */ + _lastGraphicKey: null, + + /** + * @private + */ + _handle: null, + + /** + * @private + */ + _dragging: false, + + /** + * @private + */ + _lastValue: null, + + /** + * @private + */ + _lastStatus: null, + + /** + * @private + */ + _payloadInfo: null, + + /** + * In px, arbitrary value. Do not set too small, + * no animation is ok for most cases. + * @protected + */ + animationThreshold: 15, + + /** + * @implement + */ + render: function (axisModel, axisPointerModel, api, forceRender) { + var value = axisPointerModel.get('value'); + var status = axisPointerModel.get('status'); + + // Bind them to `this`, not in closure, otherwise they will not + // be replaced when user calling setOption in not merge mode. + this._axisModel = axisModel; + this._axisPointerModel = axisPointerModel; + this._api = api; + + // Optimize: `render` will be called repeatly during mouse move. + // So it is power consuming if performing `render` each time, + // especially on mobile device. + if (!forceRender + && this._lastValue === value + && this._lastStatus === status + ) { + return; + } + this._lastValue = value; + this._lastStatus = status; + + var group = this._group; + var handle = this._handle; + + if (!status || status === 'hide') { + // Do not clear here, for animation better. + group && group.hide(); + handle && handle.hide(); + return; + } + group && group.show(); + handle && handle.show(); + + // Otherwise status is 'show' + var elOption = {}; + this.makeElOption(elOption, value, axisModel, axisPointerModel, api); + + // Enable change axis pointer type. + var graphicKey = elOption.graphicKey; + if (graphicKey !== this._lastGraphicKey) { + this.clear(api); + } + this._lastGraphicKey = graphicKey; + + var moveAnimation = this._moveAnimation = + this.determineAnimation(axisModel, axisPointerModel); + + if (!group) { + group = this._group = new Group(); + this.createPointerEl(group, elOption, axisModel, axisPointerModel); + this.createLabelEl(group, elOption, axisModel, axisPointerModel); + api.getZr().add(group); + } + else { + var doUpdateProps = curry(updateProps$1, axisPointerModel, moveAnimation); + this.updatePointerEl(group, elOption, doUpdateProps, axisPointerModel); + this.updateLabelEl(group, elOption, doUpdateProps, axisPointerModel); + } + + updateMandatoryProps(group, axisPointerModel, true); + + this._renderHandle(value); + }, + + /** + * @implement + */ + remove: function (api) { + this.clear(api); + }, + + /** + * @implement + */ + dispose: function (api) { + this.clear(api); + }, + + /** + * @protected + */ + determineAnimation: function (axisModel, axisPointerModel) { + var animation = axisPointerModel.get('animation'); + var axis = axisModel.axis; + var isCategoryAxis = axis.type === 'category'; + var useSnap = axisPointerModel.get('snap'); + + // Value axis without snap always do not snap. + if (!useSnap && !isCategoryAxis) { + return false; + } + + if (animation === 'auto' || animation == null) { + var animationThreshold = this.animationThreshold; + if (isCategoryAxis && axis.getBandWidth() > animationThreshold) { + return true; + } + + // It is important to auto animation when snap used. Consider if there is + // a dataZoom, animation will be disabled when too many points exist, while + // it will be enabled for better visual effect when little points exist. + if (useSnap) { + var seriesDataCount = getAxisInfo(axisModel).seriesDataCount; + var axisExtent = axis.getExtent(); + // Approximate band width + return Math.abs(axisExtent[0] - axisExtent[1]) / seriesDataCount > animationThreshold; + } + + return false; + } + + return animation === true; + }, + + /** + * add {pointer, label, graphicKey} to elOption + * @protected + */ + makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { + // Shoule be implemenented by sub-class. + }, + + /** + * @protected + */ + createPointerEl: function (group, elOption, axisModel, axisPointerModel) { + var pointerOption = elOption.pointer; + if (pointerOption) { + var pointerEl = inner$11(group).pointerEl = new graphic[pointerOption.type]( + clone$4(elOption.pointer) + ); + group.add(pointerEl); + } + }, + + /** + * @protected + */ + createLabelEl: function (group, elOption, axisModel, axisPointerModel) { + if (elOption.label) { + var labelEl = inner$11(group).labelEl = new Rect( + clone$4(elOption.label) + ); + + group.add(labelEl); + updateLabelShowHide(labelEl, axisPointerModel); + } + }, + + /** + * @protected + */ + updatePointerEl: function (group, elOption, updateProps$$1) { + var pointerEl = inner$11(group).pointerEl; + if (pointerEl) { + pointerEl.setStyle(elOption.pointer.style); + updateProps$$1(pointerEl, {shape: elOption.pointer.shape}); + } + }, + + /** + * @protected + */ + updateLabelEl: function (group, elOption, updateProps$$1, axisPointerModel) { + var labelEl = inner$11(group).labelEl; + if (labelEl) { + labelEl.setStyle(elOption.label.style); + updateProps$$1(labelEl, { + // Consider text length change in vertical axis, animation should + // be used on shape, otherwise the effect will be weird. + shape: elOption.label.shape, + position: elOption.label.position + }); + + updateLabelShowHide(labelEl, axisPointerModel); + } + }, + + /** + * @private + */ + _renderHandle: function (value) { + if (this._dragging || !this.updateHandleTransform) { + return; + } + + var axisPointerModel = this._axisPointerModel; + var zr = this._api.getZr(); + var handle = this._handle; + var handleModel = axisPointerModel.getModel('handle'); + + var status = axisPointerModel.get('status'); + if (!handleModel.get('show') || !status || status === 'hide') { + handle && zr.remove(handle); + this._handle = null; + return; + } + + var isInit; + if (!this._handle) { + isInit = true; + handle = this._handle = createIcon( + handleModel.get('icon'), + { + cursor: 'move', + draggable: true, + onmousemove: function (e) { + // Fot mobile devicem, prevent screen slider on the button. + stop(e.event); + }, + onmousedown: bind$2(this._onHandleDragMove, this, 0, 0), + drift: bind$2(this._onHandleDragMove, this), + ondragend: bind$2(this._onHandleDragEnd, this) + } + ); + zr.add(handle); + } + + updateMandatoryProps(handle, axisPointerModel, false); + + // update style + var includeStyles = [ + 'color', 'borderColor', 'borderWidth', 'opacity', + 'shadowColor', 'shadowBlur', 'shadowOffsetX', 'shadowOffsetY' + ]; + handle.setStyle(handleModel.getItemStyle(null, includeStyles)); + + // update position + var handleSize = handleModel.get('size'); + if (!isArray(handleSize)) { + handleSize = [handleSize, handleSize]; + } + handle.attr('scale', [handleSize[0] / 2, handleSize[1] / 2]); + + createOrUpdate( + this, + '_doDispatchAxisPointer', + handleModel.get('throttle') || 0, + 'fixRate' + ); + + this._moveHandleToValue(value, isInit); + }, + + /** + * @private + */ + _moveHandleToValue: function (value, isInit) { + updateProps$1( + this._axisPointerModel, + !isInit && this._moveAnimation, + this._handle, + getHandleTransProps(this.getHandleTransform( + value, this._axisModel, this._axisPointerModel + )) + ); + }, + + /** + * @private + */ + _onHandleDragMove: function (dx, dy) { + var handle = this._handle; + if (!handle) { + return; + } + + this._dragging = true; + + // Persistent for throttle. + var trans = this.updateHandleTransform( + getHandleTransProps(handle), + [dx, dy], + this._axisModel, + this._axisPointerModel + ); + this._payloadInfo = trans; + + handle.stopAnimation(); + handle.attr(getHandleTransProps(trans)); + inner$11(handle).lastProp = null; + + this._doDispatchAxisPointer(); + }, + + /** + * Throttled method. + * @private + */ + _doDispatchAxisPointer: function () { + var handle = this._handle; + if (!handle) { + return; + } + + var payloadInfo = this._payloadInfo; + var axisModel = this._axisModel; + this._api.dispatchAction({ + type: 'updateAxisPointer', + x: payloadInfo.cursorPoint[0], + y: payloadInfo.cursorPoint[1], + tooltipOption: payloadInfo.tooltipOption, + axesInfo: [{ + axisDim: axisModel.axis.dim, + axisIndex: axisModel.componentIndex + }] + }); + }, + + /** + * @private + */ + _onHandleDragEnd: function (moveAnimation) { + this._dragging = false; + var handle = this._handle; + if (!handle) { + return; + } + + var value = this._axisPointerModel.get('value'); + // Consider snap or categroy axis, handle may be not consistent with + // axisPointer. So move handle to align the exact value position when + // drag ended. + this._moveHandleToValue(value); + + // For the effect: tooltip will be shown when finger holding on handle + // button, and will be hidden after finger left handle button. + this._api.dispatchAction({ + type: 'hideTip' + }); + }, + + /** + * Should be implemenented by sub-class if support `handle`. + * @protected + * @param {number} value + * @param {module:echarts/model/Model} axisModel + * @param {module:echarts/model/Model} axisPointerModel + * @return {Object} {position: [x, y], rotation: 0} + */ + getHandleTransform: null, + + /** + * * Should be implemenented by sub-class if support `handle`. + * @protected + * @param {Object} transform {position, rotation} + * @param {Array.} delta [dx, dy] + * @param {module:echarts/model/Model} axisModel + * @param {module:echarts/model/Model} axisPointerModel + * @return {Object} {position: [x, y], rotation: 0, cursorPoint: [x, y]} + */ + updateHandleTransform: null, + + /** + * @private + */ + clear: function (api) { + this._lastValue = null; + this._lastStatus = null; + + var zr = api.getZr(); + var group = this._group; + var handle = this._handle; + if (zr && group) { + this._lastGraphicKey = null; + group && zr.remove(group); + handle && zr.remove(handle); + this._group = null; + this._handle = null; + this._payloadInfo = null; + } + }, + + /** + * @protected + */ + doClear: function () { + // Implemented by sub-class if necessary. + }, + + /** + * @protected + * @param {Array.} xy + * @param {Array.} wh + * @param {number} [xDimIndex=0] or 1 + */ + buildLabel: function (xy, wh, xDimIndex) { + xDimIndex = xDimIndex || 0; + return { + x: xy[xDimIndex], + y: xy[1 - xDimIndex], + width: wh[xDimIndex], + height: wh[1 - xDimIndex] + }; + } +}; + +BaseAxisPointer.prototype.constructor = BaseAxisPointer; + + +function updateProps$1(animationModel, moveAnimation, el, props) { + // Animation optimize. + if (!propsEqual(inner$11(el).lastProp, props)) { + inner$11(el).lastProp = props; + moveAnimation + ? updateProps(el, props, animationModel) + : (el.stopAnimation(), el.attr(props)); + } +} + +function propsEqual(lastProps, newProps) { + if (isObject$1(lastProps) && isObject$1(newProps)) { + var equals = true; + each$1(newProps, function (item, key) { + equals = equals && propsEqual(lastProps[key], item); + }); + return !!equals; + } + else { + return lastProps === newProps; + } +} + +function updateLabelShowHide(labelEl, axisPointerModel) { + labelEl[axisPointerModel.get('label.show') ? 'show' : 'hide'](); +} + +function getHandleTransProps(trans) { + return { + position: trans.position.slice(), + rotation: trans.rotation || 0 + }; +} + +function updateMandatoryProps(group, axisPointerModel, silent) { + var z = axisPointerModel.get('z'); + var zlevel = axisPointerModel.get('zlevel'); + + group && group.traverse(function (el) { + if (el.type !== 'group') { + z != null && (el.z = z); + zlevel != null && (el.zlevel = zlevel); + el.silent = silent; + } + }); +} + +enableClassExtend(BaseAxisPointer); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @param {module:echarts/model/Model} axisPointerModel + */ +function buildElStyle(axisPointerModel) { + var axisPointerType = axisPointerModel.get('type'); + var styleModel = axisPointerModel.getModel(axisPointerType + 'Style'); + var style; + if (axisPointerType === 'line') { + style = styleModel.getLineStyle(); + style.fill = null; + } + else if (axisPointerType === 'shadow') { + style = styleModel.getAreaStyle(); + style.stroke = null; + } + return style; +} + +/** + * @param {Function} labelPos {align, verticalAlign, position} + */ +function buildLabelElOption( + elOption, axisModel, axisPointerModel, api, labelPos +) { + var value = axisPointerModel.get('value'); + var text = getValueLabel( + value, axisModel.axis, axisModel.ecModel, + axisPointerModel.get('seriesDataIndices'), + { + precision: axisPointerModel.get('label.precision'), + formatter: axisPointerModel.get('label.formatter') + } + ); + var labelModel = axisPointerModel.getModel('label'); + var paddings = normalizeCssArray$1(labelModel.get('padding') || 0); + + var font = labelModel.getFont(); + var textRect = getBoundingRect(text, font); + + var position = labelPos.position; + var width = textRect.width + paddings[1] + paddings[3]; + var height = textRect.height + paddings[0] + paddings[2]; + + // Adjust by align. + var align = labelPos.align; + align === 'right' && (position[0] -= width); + align === 'center' && (position[0] -= width / 2); + var verticalAlign = labelPos.verticalAlign; + verticalAlign === 'bottom' && (position[1] -= height); + verticalAlign === 'middle' && (position[1] -= height / 2); + + // Not overflow ec container + confineInContainer(position, width, height, api); + + var bgColor = labelModel.get('backgroundColor'); + if (!bgColor || bgColor === 'auto') { + bgColor = axisModel.get('axisLine.lineStyle.color'); + } + + elOption.label = { + shape: {x: 0, y: 0, width: width, height: height, r: labelModel.get('borderRadius')}, + position: position.slice(), + // TODO: rich + style: { + text: text, + textFont: font, + textFill: labelModel.getTextColor(), + textPosition: 'inside', + fill: bgColor, + stroke: labelModel.get('borderColor') || 'transparent', + lineWidth: labelModel.get('borderWidth') || 0, + shadowBlur: labelModel.get('shadowBlur'), + shadowColor: labelModel.get('shadowColor'), + shadowOffsetX: labelModel.get('shadowOffsetX'), + shadowOffsetY: labelModel.get('shadowOffsetY') + }, + // Lable should be over axisPointer. + z2: 10 + }; +} + +// Do not overflow ec container +function confineInContainer(position, width, height, api) { + var viewWidth = api.getWidth(); + var viewHeight = api.getHeight(); + position[0] = Math.min(position[0] + width, viewWidth) - width; + position[1] = Math.min(position[1] + height, viewHeight) - height; + position[0] = Math.max(position[0], 0); + position[1] = Math.max(position[1], 0); +} + +/** + * @param {number} value + * @param {module:echarts/coord/Axis} axis + * @param {module:echarts/model/Global} ecModel + * @param {Object} opt + * @param {Array.} seriesDataIndices + * @param {number|string} opt.precision 'auto' or a number + * @param {string|Function} opt.formatter label formatter + */ +function getValueLabel(value, axis, ecModel, seriesDataIndices, opt) { + value = axis.scale.parse(value); + var text = axis.scale.getLabel( + // If `precision` is set, width can be fixed (like '12.00500'), which + // helps to debounce when when moving label. + value, {precision: opt.precision} + ); + var formatter = opt.formatter; + + if (formatter) { + var params = { + value: getAxisRawValue(axis, value), + seriesData: [] + }; + each$1(seriesDataIndices, function (idxItem) { + var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); + var dataIndex = idxItem.dataIndexInside; + var dataParams = series && series.getDataParams(dataIndex); + dataParams && params.seriesData.push(dataParams); + }); + + if (isString(formatter)) { + text = formatter.replace('{value}', text); + } + else if (isFunction$1(formatter)) { + text = formatter(params); + } + } + + return text; +} + +/** + * @param {module:echarts/coord/Axis} axis + * @param {number} value + * @param {Object} layoutInfo { + * rotation, position, labelOffset, labelDirection, labelMargin + * } + */ +function getTransformedPosition (axis, value, layoutInfo) { + var transform = create$1(); + rotate(transform, transform, layoutInfo.rotation); + translate(transform, transform, layoutInfo.position); + + return applyTransform$1([ + axis.dataToCoord(value), + (layoutInfo.labelOffset || 0) + + (layoutInfo.labelDirection || 1) * (layoutInfo.labelMargin || 0) + ], transform); +} + +function buildCartesianSingleLabelElOption( + value, elOption, layoutInfo, axisModel, axisPointerModel, api +) { + var textLayout = AxisBuilder.innerTextLayout( + layoutInfo.rotation, 0, layoutInfo.labelDirection + ); + layoutInfo.labelMargin = axisPointerModel.get('label.margin'); + buildLabelElOption(elOption, axisModel, axisPointerModel, api, { + position: getTransformedPosition(axisModel.axis, value, layoutInfo), + align: textLayout.textAlign, + verticalAlign: textLayout.textVerticalAlign + }); +} + +/** + * @param {Array.} p1 + * @param {Array.} p2 + * @param {number} [xDimIndex=0] or 1 + */ +function makeLineShape(p1, p2, xDimIndex) { + xDimIndex = xDimIndex || 0; + return { + x1: p1[xDimIndex], + y1: p1[1 - xDimIndex], + x2: p2[xDimIndex], + y2: p2[1 - xDimIndex] + }; +} + +/** + * @param {Array.} xy + * @param {Array.} wh + * @param {number} [xDimIndex=0] or 1 + */ +function makeRectShape(xy, wh, xDimIndex) { + xDimIndex = xDimIndex || 0; + return { + x: xy[xDimIndex], + y: xy[1 - xDimIndex], + width: wh[xDimIndex], + height: wh[1 - xDimIndex] + }; +} + +function makeSectorShape(cx, cy, r0, r, startAngle, endAngle) { + return { + cx: cx, + cy: cy, + r0: r0, + r: r, + startAngle: startAngle, + endAngle: endAngle, + clockwise: true + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 CartesianAxisPointer = BaseAxisPointer.extend({ + + /** + * @override + */ + makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { + var axis = axisModel.axis; + var grid = axis.grid; + var axisPointerType = axisPointerModel.get('type'); + var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); + var pixelValue = axis.toGlobalCoord(axis.dataToCoord(value, true)); + + if (axisPointerType && axisPointerType !== 'none') { + var elStyle = buildElStyle(axisPointerModel); + var pointerOption = pointerShapeBuilder[axisPointerType]( + axis, pixelValue, otherExtent, elStyle + ); + pointerOption.style = elStyle; + elOption.graphicKey = pointerOption.type; + elOption.pointer = pointerOption; + } + + var layoutInfo = layout$1(grid.model, axisModel); + buildCartesianSingleLabelElOption( + value, elOption, layoutInfo, axisModel, axisPointerModel, api + ); + }, + + /** + * @override + */ + getHandleTransform: function (value, axisModel, axisPointerModel) { + var layoutInfo = layout$1(axisModel.axis.grid.model, axisModel, { + labelInside: false + }); + layoutInfo.labelMargin = axisPointerModel.get('handle.margin'); + return { + position: getTransformedPosition(axisModel.axis, value, layoutInfo), + rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) + }; + }, + + /** + * @override + */ + updateHandleTransform: function (transform, delta, axisModel, axisPointerModel) { + var axis = axisModel.axis; + var grid = axis.grid; + var axisExtent = axis.getGlobalExtent(true); + var otherExtent = getCartesian(grid, axis).getOtherAxis(axis).getGlobalExtent(); + var dimIndex = axis.dim === 'x' ? 0 : 1; + + var currPosition = transform.position; + currPosition[dimIndex] += delta[dimIndex]; + currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); + currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); + + var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; + var cursorPoint = [cursorOtherValue, cursorOtherValue]; + cursorPoint[dimIndex] = currPosition[dimIndex]; + + // Make tooltip do not overlap axisPointer and in the middle of the grid. + var tooltipOptions = [{verticalAlign: 'middle'}, {align: 'center'}]; + + return { + position: currPosition, + rotation: transform.rotation, + cursorPoint: cursorPoint, + tooltipOption: tooltipOptions[dimIndex] + }; + } + +}); + +function getCartesian(grid, axis) { + var opt = {}; + opt[axis.dim + 'AxisIndex'] = axis.index; + return grid.getCartesian(opt); +} + +var pointerShapeBuilder = { + + line: function (axis, pixelValue, otherExtent, elStyle) { + var targetShape = makeLineShape( + [pixelValue, otherExtent[0]], + [pixelValue, otherExtent[1]], + getAxisDimIndex(axis) + ); + subPixelOptimizeLine({ + shape: targetShape, + style: elStyle + }); + return { + type: 'Line', + shape: targetShape + }; + }, + + shadow: function (axis, pixelValue, otherExtent, elStyle) { + var bandWidth = Math.max(1, axis.getBandWidth()); + var span = otherExtent[1] - otherExtent[0]; + return { + type: 'Rect', + shape: makeRectShape( + [pixelValue - bandWidth / 2, otherExtent[0]], + [bandWidth, span], + getAxisDimIndex(axis) + ) + }; + } +}; + +function getAxisDimIndex(axis) { + return axis.dim === 'x' ? 0 : 1; +} + +AxisView.registerAxisPointerClass('CartesianAxisPointer', CartesianAxisPointer); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// CartesianAxisPointer is not supposed to be required here. But consider +// echarts.simple.js and online build tooltip, which only require gridSimple, +// CartesianAxisPointer should be able to required somewhere. +registerPreprocessor(function (option) { + // Always has a global axisPointerModel for default setting. + if (option) { + (!option.axisPointer || option.axisPointer.length === 0) + && (option.axisPointer = {}); + + var link = option.axisPointer.link; + // Normalize to array to avoid object mergin. But if link + // is not set, remain null/undefined, otherwise it will + // override existent link setting. + if (link && !isArray(link)) { + option.axisPointer.link = [link]; + } + } +}); + +// This process should proformed after coordinate systems created +// and series data processed. So put it on statistic processing stage. +registerProcessor(PRIORITY.PROCESSOR.STATISTIC, function (ecModel, api) { + // Build axisPointerModel, mergin tooltip.axisPointer model for each axis. + // allAxesInfo should be updated when setOption performed. + ecModel.getComponent('axisPointer').coordSysAxesInfo + = collect(ecModel, api); +}); + +// Broadcast to all views. +registerAction({ + type: 'updateAxisPointer', + event: 'updateAxisPointer', + update: ':updateAxisPointer' +}, axisTrigger); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 XY = ['x', 'y']; +var WH = ['width', 'height']; + +var SingleAxisPointer = BaseAxisPointer.extend({ + + /** + * @override + */ + makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { + var axis = axisModel.axis; + var coordSys = axis.coordinateSystem; + var otherExtent = getGlobalExtent(coordSys, 1 - getPointDimIndex(axis)); + var pixelValue = coordSys.dataToPoint(value)[0]; + + var axisPointerType = axisPointerModel.get('type'); + if (axisPointerType && axisPointerType !== 'none') { + var elStyle = buildElStyle(axisPointerModel); + var pointerOption = pointerShapeBuilder$1[axisPointerType]( + axis, pixelValue, otherExtent, elStyle + ); + pointerOption.style = elStyle; + + elOption.graphicKey = pointerOption.type; + elOption.pointer = pointerOption; + } + + var layoutInfo = layout$2(axisModel); + buildCartesianSingleLabelElOption( + value, elOption, layoutInfo, axisModel, axisPointerModel, api + ); + }, + + /** + * @override + */ + getHandleTransform: function (value, axisModel, axisPointerModel) { + var layoutInfo = layout$2(axisModel, {labelInside: false}); + layoutInfo.labelMargin = axisPointerModel.get('handle.margin'); + return { + position: getTransformedPosition(axisModel.axis, value, layoutInfo), + rotation: layoutInfo.rotation + (layoutInfo.labelDirection < 0 ? Math.PI : 0) + }; + }, + + /** + * @override + */ + updateHandleTransform: function (transform, delta, axisModel, axisPointerModel) { + var axis = axisModel.axis; + var coordSys = axis.coordinateSystem; + var dimIndex = getPointDimIndex(axis); + var axisExtent = getGlobalExtent(coordSys, dimIndex); + var currPosition = transform.position; + currPosition[dimIndex] += delta[dimIndex]; + currPosition[dimIndex] = Math.min(axisExtent[1], currPosition[dimIndex]); + currPosition[dimIndex] = Math.max(axisExtent[0], currPosition[dimIndex]); + var otherExtent = getGlobalExtent(coordSys, 1 - dimIndex); + var cursorOtherValue = (otherExtent[1] + otherExtent[0]) / 2; + var cursorPoint = [cursorOtherValue, cursorOtherValue]; + cursorPoint[dimIndex] = currPosition[dimIndex]; + + return { + position: currPosition, + rotation: transform.rotation, + cursorPoint: cursorPoint, + tooltipOption: { + verticalAlign: 'middle' + } + }; + } +}); + +var pointerShapeBuilder$1 = { + + line: function (axis, pixelValue, otherExtent, elStyle) { + var targetShape = makeLineShape( + [pixelValue, otherExtent[0]], + [pixelValue, otherExtent[1]], + getPointDimIndex(axis) + ); + subPixelOptimizeLine({ + shape: targetShape, + style: elStyle + }); + return { + type: 'Line', + shape: targetShape + }; + }, + + shadow: function (axis, pixelValue, otherExtent, elStyle) { + var bandWidth = axis.getBandWidth(); + var span = otherExtent[1] - otherExtent[0]; + return { + type: 'Rect', + shape: makeRectShape( + [pixelValue - bandWidth / 2, otherExtent[0]], + [bandWidth, span], + getPointDimIndex(axis) + ) + }; + } +}; + +function getPointDimIndex(axis) { + return axis.isHorizontal() ? 0 : 1; +} + +function getGlobalExtent(coordSys, dimIndex) { + var rect = coordSys.getRect(); + return [rect[XY[dimIndex]], rect[XY[dimIndex]] + rect[WH[dimIndex]]]; +} + +AxisView.registerAxisPointerClass('SingleAxisPointer', SingleAxisPointer); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +extendComponentView({ + type: 'single' +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Define the themeRiver view's series model + * @author Deqing Li(annong035@gmail.com) + */ + +var DATA_NAME_INDEX = 2; + +var ThemeRiverSeries = SeriesModel.extend({ + + type: 'series.themeRiver', + + dependencies: ['singleAxis'], + + /** + * @readOnly + * @type {module:zrender/core/util#HashMap} + */ + nameMap: null, + + /** + * @override + */ + init: function (option) { + ThemeRiverSeries.superApply(this, 'init', arguments); + + // Put this function here is for the sake of consistency of code style. + // Enable legend selection for each data item + // Use a function instead of direct access because data reference may changed + this.legendDataProvider = function () { + return this.getRawData(); + }; + }, + + /** + * If there is no value of a certain point in the time for some event,set it value to 0. + * + * @param {Array} data initial data in the option + * @return {Array} + */ + fixData: function (data) { + var rawDataLength = data.length; + + // grouped data by name + var dataByName = nest() + .key(function (dataItem) { + return dataItem[2]; + }) + .entries(data); + + // data group in each layer + var layData = map(dataByName, function (d) { + return { + name: d.key, + dataList: d.values + }; + }); + + var layerNum = layData.length; + var largestLayer = -1; + var index = -1; + for (var i = 0; i < layerNum; ++i) { + var len = layData[i].dataList.length; + if (len > largestLayer) { + largestLayer = len; + index = i; + } + } + + for (var k = 0; k < layerNum; ++k) { + if (k === index) { + continue; + } + var name = layData[k].name; + for (var j = 0; j < largestLayer; ++j) { + var timeValue = layData[index].dataList[j][0]; + var length = layData[k].dataList.length; + var keyIndex = -1; + for (var l = 0; l < length; ++l) { + var value = layData[k].dataList[l][0]; + if (value === timeValue) { + keyIndex = l; + break; + } + } + if (keyIndex === -1) { + data[rawDataLength] = []; + data[rawDataLength][0] = timeValue; + data[rawDataLength][1] = 0; + data[rawDataLength][2] = name; + rawDataLength++; + + } + } + } + return data; + }, + + /** + * @override + * @param {Object} option the initial option that user gived + * @param {module:echarts/model/Model} ecModel the model object for themeRiver option + * @return {module:echarts/data/List} + */ + getInitialData: function (option, ecModel) { + + var singleAxisModel = ecModel.queryComponents({ + mainType: 'singleAxis', + index: this.get('singleAxisIndex'), + id: this.get('singleAxisId') + })[0]; + + var axisType = singleAxisModel.get('type'); + + // filter the data item with the value of label is undefined + var filterData = filter(option.data, function (dataItem) { + return dataItem[2] !== undefined; + }); + + // ??? TODO design a stage to transfer data for themeRiver and lines? + var data = this.fixData(filterData || []); + var nameList = []; + var nameMap = this.nameMap = createHashMap(); + var count = 0; + + for (var i = 0; i < data.length; ++i) { + nameList.push(data[i][DATA_NAME_INDEX]); + if (!nameMap.get(data[i][DATA_NAME_INDEX])) { + nameMap.set(data[i][DATA_NAME_INDEX], count); + count++; + } + } + + var dimensionsInfo = createDimensions(data, { + coordDimensions: ['single'], + dimensionsDefine: [ + { + name: 'time', + type: getDimensionTypeByAxis(axisType) + }, + { + name: 'value', + type: 'float' + }, + { + name: 'name', + type: 'ordinal' + } + ], + encodeDefine: { + single: 0, + value: 1, + itemName: 2 + } + }); + + var list = new List(dimensionsInfo, this); + list.initData(data); + + return list; + }, + + /** + * The raw data is divided into multiple layers and each layer + * has same name. + * + * @return {Array.>} + */ + getLayerSeries: function () { + var data = this.getData(); + var lenCount = data.count(); + var indexArr = []; + + for (var i = 0; i < lenCount; ++i) { + indexArr[i] = i; + } + // data group by name + var dataByName = nest() + .key(function (index) { + return data.get('name', index); + }) + .entries(indexArr); + + var layerSeries = map(dataByName, function (d) { + return { + name: d.key, + indices: d.values + }; + }); + + var timeDim = data.mapDimension('single'); + + for (var j = 0; j < layerSeries.length; ++j) { + layerSeries[j].indices.sort(comparer); + } + + function comparer(index1, index2) { + return data.get(timeDim, index1) - data.get(timeDim, index2); + } + + return layerSeries; + }, + + /** + * Get data indices for show tooltip content + * + * @param {Array.|string} dim single coordinate dimension + * @param {number} value axis value + * @param {module:echarts/coord/single/SingleAxis} baseAxis single Axis used + * the themeRiver. + * @return {Object} {dataIndices, nestestValue} + */ + getAxisTooltipData: function (dim, value, baseAxis) { + if (!isArray(dim)) { + dim = dim ? [dim] : []; + } + + var data = this.getData(); + var layerSeries = this.getLayerSeries(); + var indices = []; + var layerNum = layerSeries.length; + var nestestValue; + + for (var i = 0; i < layerNum; ++i) { + var minDist = Number.MAX_VALUE; + var nearestIdx = -1; + var pointNum = layerSeries[i].indices.length; + for (var j = 0; j < pointNum; ++j) { + var theValue = data.get(dim[0], layerSeries[i].indices[j]); + var dist = Math.abs(theValue - value); + if (dist <= minDist) { + nestestValue = theValue; + minDist = dist; + nearestIdx = layerSeries[i].indices[j]; + } + } + indices.push(nearestIdx); + } + + return {dataIndices: indices, nestestValue: nestestValue}; + }, + + /** + * @override + * @param {number} dataIndex index of data + */ + formatTooltip: function (dataIndex) { + var data = this.getData(); + var htmlName = data.getName(dataIndex); + var htmlValue = data.get(data.mapDimension('value'), dataIndex); + if (isNaN(htmlValue) || htmlValue == null) { + htmlValue = '-'; + } + return encodeHTML(htmlName + ' : ' + htmlValue); + }, + + defaultOption: { + zlevel: 0, + z: 2, + + coordinateSystem: 'singleAxis', + + // gap in axis's orthogonal orientation + boundaryGap: ['10%', '10%'], + + // legendHoverLink: true, + + singleAxisIndex: 0, + + animationEasing: 'linear', + + label: { + margin: 4, + show: true, + position: 'left', + color: '#000', + fontSize: 11 + }, + + emphasis: { + label: { + show: true + } + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file The file used to draw themeRiver view + * @author Deqing Li(annong035@gmail.com) + */ + +extendChartView({ + + type: 'themeRiver', + + init: function () { + this._layers = []; + }, + + render: function (seriesModel, ecModel, api) { + var data = seriesModel.getData(); + + var group = this.group; + + var layerSeries = seriesModel.getLayerSeries(); + + var layoutInfo = data.getLayout('layoutInfo'); + var rect = layoutInfo.rect; + var boundaryGap = layoutInfo.boundaryGap; + + group.attr('position', [0, rect.y + boundaryGap[0]]); + + function keyGetter(item) { + return item.name; + } + var dataDiffer = new DataDiffer( + this._layersSeries || [], layerSeries, + keyGetter, keyGetter + ); + + var newLayersGroups = {}; + + dataDiffer + .add(bind(process, this, 'add')) + .update(bind(process, this, 'update')) + .remove(bind(process, this, 'remove')) + .execute(); + + function process(status, idx, oldIdx) { + var oldLayersGroups = this._layers; + if (status === 'remove') { + group.remove(oldLayersGroups[idx]); + return; + } + var points0 = []; + var points1 = []; + var color; + var indices = layerSeries[idx].indices; + for (var j = 0; j < indices.length; j++) { + var layout = data.getItemLayout(indices[j]); + var x = layout.x; + var y0 = layout.y0; + var y = layout.y; + + points0.push([x, y0]); + points1.push([x, y0 + y]); + + color = data.getItemVisual(indices[j], 'color'); + } + + var polygon; + var text; + var textLayout = data.getItemLayout(indices[0]); + var itemModel = data.getItemModel(indices[j - 1]); + var labelModel = itemModel.getModel('label'); + var margin = labelModel.get('margin'); + if (status === 'add') { + var layerGroup = newLayersGroups[idx] = new Group(); + polygon = new Polygon$1({ + shape: { + points: points0, + stackedOnPoints: points1, + smooth: 0.4, + stackedOnSmooth: 0.4, + smoothConstraint: false + }, + z2: 0 + }); + text = new Text({ + style: { + x: textLayout.x - margin, + y: textLayout.y0 + textLayout.y / 2 + } + }); + layerGroup.add(polygon); + layerGroup.add(text); + group.add(layerGroup); + + polygon.setClipPath(createGridClipShape$3(polygon.getBoundingRect(), seriesModel, function () { + polygon.removeClipPath(); + })); + } + else { + var layerGroup = oldLayersGroups[oldIdx]; + polygon = layerGroup.childAt(0); + text = layerGroup.childAt(1); + group.add(layerGroup); + + newLayersGroups[idx] = layerGroup; + + updateProps(polygon, { + shape: { + points: points0, + stackedOnPoints: points1 + } + }, seriesModel); + + updateProps(text, { + style: { + x: textLayout.x - margin, + y: textLayout.y0 + textLayout.y / 2 + } + }, seriesModel); + } + + var hoverItemStyleModel = itemModel.getModel('emphasis.itemStyle'); + var itemStyleModel = itemModel.getModel('itemStyle'); + + setTextStyle(text.style, labelModel, { + text: labelModel.get('show') + ? seriesModel.getFormattedLabel(indices[j - 1], 'normal') + || data.getName(indices[j - 1]) + : null, + textVerticalAlign: 'middle' + }); + + polygon.setStyle(extend({ + fill: color + }, itemStyleModel.getItemStyle(['color']))); + + setHoverStyle(polygon, hoverItemStyleModel.getItemStyle()); + } + + this._layersSeries = layerSeries; + this._layers = newLayersGroups; + }, + + dispose: function () {} +}); + +// add animation to the view +function createGridClipShape$3(rect, seriesModel, cb) { + var rectEl = new Rect({ + shape: { + x: rect.x - 10, + y: rect.y - 10, + width: 0, + height: rect.height + 20 + } + }); + initProps(rectEl, { + shape: { + width: rect.width + 20, + height: rect.height + 20 + } + }, seriesModel, cb); + + return rectEl; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Using layout algorithm transform the raw data to layout information. + * @author Deqing Li(annong035@gmail.com) + */ + +var themeRiverLayout = function (ecModel, api) { + + ecModel.eachSeriesByType('themeRiver', function (seriesModel) { + + var data = seriesModel.getData(); + + var single = seriesModel.coordinateSystem; + + var layoutInfo = {}; + + // use the axis boundingRect for view + var rect = single.getRect(); + + layoutInfo.rect = rect; + + var boundaryGap = seriesModel.get('boundaryGap'); + + var axis = single.getAxis(); + + layoutInfo.boundaryGap = boundaryGap; + + if (axis.orient === 'horizontal') { + boundaryGap[0] = parsePercent$1(boundaryGap[0], rect.height); + boundaryGap[1] = parsePercent$1(boundaryGap[1], rect.height); + var height = rect.height - boundaryGap[0] - boundaryGap[1]; + themeRiverLayout$1(data, seriesModel, height); + } + else { + boundaryGap[0] = parsePercent$1(boundaryGap[0], rect.width); + boundaryGap[1] = parsePercent$1(boundaryGap[1], rect.width); + var width = rect.width - boundaryGap[0] - boundaryGap[1]; + themeRiverLayout$1(data, seriesModel, width); + } + + data.setLayout('layoutInfo', layoutInfo); + }); +}; + +/** + * The layout information about themeriver + * + * @param {module:echarts/data/List} data data in the series + * @param {module:echarts/model/Series} seriesModel the model object of themeRiver series + * @param {number} height value used to compute every series height + */ +function themeRiverLayout$1(data, seriesModel, height) { + if (!data.count()) { + return; + } + var coordSys = seriesModel.coordinateSystem; + // the data in each layer are organized into a series. + var layerSeries = seriesModel.getLayerSeries(); + + // the points in each layer. + var timeDim = data.mapDimension('single'); + var valueDim = data.mapDimension('value'); + var layerPoints = map(layerSeries, function (singleLayer) { + return map(singleLayer.indices, function (idx) { + var pt = coordSys.dataToPoint(data.get(timeDim, idx)); + pt[1] = data.get(valueDim, idx); + return pt; + }); + }); + + var base = computeBaseline(layerPoints); + var baseLine = base.y0; + var ky = height / base.max; + + // set layout information for each item. + var n = layerSeries.length; + var m = layerSeries[0].indices.length; + var baseY0; + for (var j = 0; j < m; ++j) { + baseY0 = baseLine[j] * ky; + data.setItemLayout(layerSeries[0].indices[j], { + layerIndex: 0, + x: layerPoints[0][j][0], + y0: baseY0, + y: layerPoints[0][j][1] * ky + }); + for (var i = 1; i < n; ++i) { + baseY0 += layerPoints[i - 1][j][1] * ky; + data.setItemLayout(layerSeries[i].indices[j], { + layerIndex: i, + x: layerPoints[i][j][0], + y0: baseY0, + y: layerPoints[i][j][1] * ky + }); + } + } +} + +/** + * Compute the baseLine of the rawdata + * Inspired by Lee Byron's paper Stacked Graphs - Geometry & Aesthetics + * + * @param {Array.} data the points in each layer + * @return {Object} + */ +function computeBaseline(data) { + var layerNum = data.length; + var pointNum = data[0].length; + var sums = []; + var y0 = []; + var max = 0; + var temp; + var base = {}; + + for (var i = 0; i < pointNum; ++i) { + for (var j = 0, temp = 0; j < layerNum; ++j) { + temp += data[j][i][1]; + } + if (temp > max) { + max = temp; + } + sums.push(temp); + } + + for (var k = 0; k < pointNum; ++k) { + y0[k] = (max - sums[k]) / 2; + } + max = 0; + + for (var l = 0; l < pointNum; ++l) { + var sum = sums[l] + y0[l]; + if (sum > max) { + max = sum; + } + } + base.y0 = y0; + base.max = max; + + return base; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Visual encoding for themeRiver view + * @author Deqing Li(annong035@gmail.com) + */ + +var themeRiverVisual = function (ecModel) { + ecModel.eachSeriesByType('themeRiver', function (seriesModel) { + var data = seriesModel.getData(); + var rawData = seriesModel.getRawData(); + var colorList = seriesModel.get('color'); + var idxMap = createHashMap(); + + data.each(function (idx) { + idxMap.set(data.getRawIndex(idx), idx); + }); + + rawData.each(function (rawIndex) { + var name = rawData.getName(rawIndex); + var color = colorList[(seriesModel.nameMap.get(name) - 1) % colorList.length]; + + rawData.setItemVisual(rawIndex, 'color', color); + + var idx = idxMap.get(rawIndex); + + if (idx != null) { + data.setItemVisual(idx, 'color', color); + } + }); + }); +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerLayout(themeRiverLayout); +registerVisual(themeRiverVisual); +registerProcessor(dataFilter('themeRiver')); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +SeriesModel.extend({ + + type: 'series.sunburst', + + /** + * @type {module:echarts/data/Tree~Node} + */ + _viewRoot: null, + + getInitialData: function (option, ecModel) { + // Create a virtual root. + var root = { name: option.name, children: option.data }; + + completeTreeValue$1(root); + + var levels = option.levels || []; + + // levels = option.levels = setDefault(levels, ecModel); + + var treeOption = {}; + + treeOption.levels = levels; + + // 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, treeOption).data; + }, + + optionUpdated: function () { + this.resetViewRoot(); + }, + + /* + * @override + */ + getDataParams: function (dataIndex) { + var params = SeriesModel.prototype.getDataParams.apply(this, arguments); + + var node = this.getData().tree.getNodeByDataIndex(dataIndex); + params.treePathInfo = wrapTreePathInfo(node, this); + + return params; + }, + + defaultOption: { + zlevel: 0, + z: 2, + + // 默认全局居中 + center: ['50%', '50%'], + radius: [0, '75%'], + // 默认顺时针 + clockwise: true, + startAngle: 90, + // 最小角度改为0 + minAngle: 0, + + percentPrecision: 2, + + // If still show when all data zero. + stillShowZeroSum: true, + + // Policy of highlighting pieces when hover on one + // Valid values: 'none' (for not downplay others), 'descendant', + // 'ancestor', 'self' + highlightPolicy: 'descendant', + + // 'rootToNode', 'link', or false + nodeClick: 'rootToNode', + + renderLabelForZeroData: false, + + label: { + // could be: 'radial', 'tangential', or 'none' + rotate: 'radial', + show: true, + opacity: 1, + // 'left' is for inner side of inside, and 'right' is for outter + // side for inside + align: 'center', + position: 'inside', + distance: 5, + silent: true, + emphasis: {} + }, + itemStyle: { + borderWidth: 1, + borderColor: 'white', + opacity: 1, + emphasis: {}, + highlight: { + opacity: 1 + }, + downplay: { + opacity: 0.9 + } + }, + + // Animation type canbe expansion, scale + animationType: 'expansion', + animationDuration: 1000, + animationDurationUpdate: 500, + animationEasing: 'cubicOut', + + data: [], + + levels: [], + + /** + * Sort order. + * + * Valid values: 'desc', 'asc', null, or callback function. + * 'desc' and 'asc' for descend and ascendant order; + * null for not sorting; + * example of callback function: + * function(nodeA, nodeB) { + * return nodeA.getValue() - nodeB.getValue(); + * } + */ + sort: 'desc' + }, + + getViewRoot: function () { + return this._viewRoot; + }, + + /** + * @param {module:echarts/data/Tree~Node} [viewRoot] + */ + resetViewRoot: function (viewRoot) { + viewRoot + ? (this._viewRoot = viewRoot) + : (viewRoot = this._viewRoot); + + var root = this.getRawData().tree.root; + + if (!viewRoot + || (viewRoot !== root && !root.contains(viewRoot)) + ) { + this._viewRoot = root; + } + } +}); + + + +/** + * @param {Object} dataNode + */ +function completeTreeValue$1(dataNode) { + // 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; + + each$1(dataNode.children, function (child) { + + completeTreeValue$1(child); + + var childValue = child.value; + isArray(childValue) && (childValue = childValue[0]); + + sum += childValue; + }); + + var thisValue = dataNode.value; + if (isArray(thisValue)) { + thisValue = thisValue[0]; + } + + if (thisValue == null || isNaN(thisValue)) { + thisValue = sum; + } + // Value should not less than 0. + if (thisValue < 0) { + thisValue = 0; + } + + isArray(dataNode.value) + ? (dataNode.value[0] = thisValue) + : (dataNode.value = thisValue); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 NodeHighlightPolicy = { + NONE: 'none', // not downplay others + DESCENDANT: 'descendant', + ANCESTOR: 'ancestor', + SELF: 'self' +}; + +var DEFAULT_SECTOR_Z = 2; +var DEFAULT_TEXT_Z = 4; + +/** + * Sunburstce of Sunburst including Sector, Label, LabelLine + * @constructor + * @extends {module:zrender/graphic/Group} + */ +function SunburstPiece(node, seriesModel, ecModel) { + + Group.call(this); + + var sector = new Sector({ + z2: DEFAULT_SECTOR_Z + }); + sector.seriesIndex = seriesModel.seriesIndex; + + var text = new Text({ + z2: DEFAULT_TEXT_Z, + silent: node.getModel('label').get('silent') + }); + this.add(sector); + this.add(text); + + this.updateData(true, node, 'normal', seriesModel, ecModel); + + // Hover to change label and labelLine + function onEmphasis() { + text.ignore = text.hoverIgnore; + } + function onNormal() { + text.ignore = text.normalIgnore; + } + this.on('emphasis', onEmphasis) + .on('normal', onNormal) + .on('mouseover', onEmphasis) + .on('mouseout', onNormal); +} + +var SunburstPieceProto = SunburstPiece.prototype; + +SunburstPieceProto.updateData = function ( + firstCreate, + node, + state, + seriesModel, + ecModel +) { + this.node = node; + node.piece = this; + + seriesModel = seriesModel || this._seriesModel; + ecModel = ecModel || this._ecModel; + + var sector = this.childAt(0); + sector.dataIndex = node.dataIndex; + + var itemModel = node.getModel(); + var layout = node.getLayout(); + if (!layout) { + console.log(node.getLayout()); + } + var sectorShape = extend({}, layout); + sectorShape.label = null; + + var visualColor = getNodeColor(node, seriesModel, ecModel); + + var normalStyle = itemModel.getModel('itemStyle').getItemStyle(); + var style; + if (state === 'normal') { + style = normalStyle; + } + else { + var stateStyle = itemModel.getModel(state + '.itemStyle') + .getItemStyle(); + style = merge(stateStyle, normalStyle); + } + style = defaults( + { + lineJoin: 'bevel', + fill: style.fill || visualColor + }, + style + ); + + if (firstCreate) { + sector.setShape(sectorShape); + sector.shape.r = layout.r0; + updateProps( + sector, + { + shape: { + r: layout.r + } + }, + seriesModel, + node.dataIndex + ); + sector.useStyle(style); + } + else if (typeof style.fill === 'object' && style.fill.type + || typeof sector.style.fill === 'object' && sector.style.fill.type + ) { + // Disable animation for gradient since no interpolation method + // is supported for gradient + updateProps(sector, { + shape: sectorShape + }, seriesModel); + sector.useStyle(style); + } + else { + updateProps(sector, { + shape: sectorShape, + style: style + }, seriesModel); + } + + this._updateLabel(seriesModel, visualColor, state); + + var cursorStyle = itemModel.getShallow('cursor'); + cursorStyle && sector.attr('cursor', cursorStyle); + + if (firstCreate) { + var highlightPolicy = seriesModel.getShallow('highlightPolicy'); + this._initEvents(sector, node, seriesModel, highlightPolicy); + } + + this._seriesModel = seriesModel || this._seriesModel; + this._ecModel = ecModel || this._ecModel; +}; + +SunburstPieceProto.onEmphasis = function (highlightPolicy) { + var that = this; + this.node.hostTree.root.eachNode(function (n) { + if (n.piece) { + if (that.node === n) { + n.piece.updateData(false, n, 'emphasis'); + } + else if (isNodeHighlighted(n, that.node, highlightPolicy)) { + n.piece.childAt(0).trigger('highlight'); + } + else if (highlightPolicy !== NodeHighlightPolicy.NONE) { + n.piece.childAt(0).trigger('downplay'); + } + } + }); +}; + +SunburstPieceProto.onNormal = function () { + this.node.hostTree.root.eachNode(function (n) { + if (n.piece) { + n.piece.updateData(false, n, 'normal'); + } + }); +}; + +SunburstPieceProto.onHighlight = function () { + this.updateData(false, this.node, 'highlight'); +}; + +SunburstPieceProto.onDownplay = function () { + this.updateData(false, this.node, 'downplay'); +}; + +SunburstPieceProto._updateLabel = function (seriesModel, visualColor, state) { + var itemModel = this.node.getModel(); + var normalModel = itemModel.getModel('label'); + var labelModel = state === 'normal' || state === 'emphasis' + ? normalModel + : itemModel.getModel(state + '.label'); + var labelHoverModel = itemModel.getModel('emphasis.label'); + + var text = retrieve( + seriesModel.getFormattedLabel( + this.node.dataIndex, 'normal', null, null, 'label' + ), + this.node.name + ); + if (getLabelAttr('show') === false) { + text = ''; + } + + var layout = this.node.getLayout(); + var labelMinAngle = labelModel.get('minAngle'); + if (labelMinAngle == null) { + labelMinAngle = normalModel.get('minAngle'); + } + labelMinAngle = labelMinAngle / 180 * Math.PI; + var angle = layout.endAngle - layout.startAngle; + if (labelMinAngle != null && Math.abs(angle) < labelMinAngle) { + // Not displaying text when angle is too small + text = ''; + } + + var label = this.childAt(1); + + setLabelStyle( + label.style, label.hoverStyle || {}, normalModel, labelHoverModel, + { + defaultText: labelModel.getShallow('show') ? text : null, + autoColor: visualColor, + useInsideStyle: true + } + ); + + var midAngle = (layout.startAngle + layout.endAngle) / 2; + var dx = Math.cos(midAngle); + var dy = Math.sin(midAngle); + + var r; + var labelPosition = getLabelAttr('position'); + var labelPadding = getLabelAttr('distance') || 0; + var textAlign = getLabelAttr('align'); + if (labelPosition === 'outside') { + r = layout.r + labelPadding; + textAlign = midAngle > Math.PI / 2 ? 'right' : 'left'; + } + else { + if (!textAlign || textAlign === 'center') { + r = (layout.r + layout.r0) / 2; + textAlign = 'center'; + } + else if (textAlign === 'left') { + r = layout.r0 + labelPadding; + if (midAngle > Math.PI / 2) { + textAlign = 'right'; + } + } + else if (textAlign === 'right') { + r = layout.r - labelPadding; + if (midAngle > Math.PI / 2) { + textAlign = 'left'; + } + } + } + + label.attr('style', { + text: text, + textAlign: textAlign, + textVerticalAlign: getLabelAttr('verticalAlign') || 'middle', + opacity: getLabelAttr('opacity') + }); + + var textX = r * dx + layout.cx; + var textY = r * dy + layout.cy; + label.attr('position', [textX, textY]); + + var rotateType = getLabelAttr('rotate'); + var rotate = 0; + if (rotateType === 'radial') { + rotate = -midAngle; + if (rotate < -Math.PI / 2) { + rotate += Math.PI; + } + } + else if (rotateType === 'tangential') { + rotate = Math.PI / 2 - midAngle; + if (rotate > Math.PI / 2) { + rotate -= Math.PI; + } + else if (rotate < -Math.PI / 2) { + rotate += Math.PI; + } + } else if (typeof rotateType === 'number') { + rotate = rotateType * Math.PI / 180; + } + label.attr('rotation', rotate); + + function getLabelAttr(name) { + var stateAttr = labelModel.get(name); + if (stateAttr == null) { + return normalModel.get(name); + } + else { + return stateAttr; + } + } +}; + +SunburstPieceProto._initEvents = function ( + sector, + node, + seriesModel, + highlightPolicy +) { + sector.off('mouseover').off('mouseout').off('emphasis').off('normal'); + + var that = this; + var onEmphasis = function () { + that.onEmphasis(highlightPolicy); + }; + var onNormal = function () { + that.onNormal(); + }; + var onDownplay = function () { + that.onDownplay(); + }; + var onHighlight = function () { + that.onHighlight(); + }; + + if (seriesModel.isAnimationEnabled()) { + sector + .on('mouseover', onEmphasis) + .on('mouseout', onNormal) + .on('emphasis', onEmphasis) + .on('normal', onNormal) + .on('downplay', onDownplay) + .on('highlight', onHighlight); + } +}; + +inherits(SunburstPiece, Group); + +/** + * Get node color + * + * @param {TreeNode} node the node to get color + * @param {module:echarts/model/Series} seriesModel series + * @param {module:echarts/model/Global} ecModel echarts defaults + */ +function getNodeColor(node, seriesModel, ecModel) { + // Color from visualMap + var visualColor = node.getVisual('color'); + var visualMetaList = node.getVisual('visualMeta'); + if (!visualMetaList || visualMetaList.length === 0) { + // Use first-generation color if has no visualMap + visualColor = null; + } + + // Self color or level color + var color = node.getModel('itemStyle').get('color'); + if (color) { + return color; + } + else if (visualColor) { + // Color mapping + return visualColor; + } + else if (node.depth === 0) { + // Virtual root node + return ecModel.option.color[0]; + } + else { + // First-generation color + var length = ecModel.option.color.length; + color = ecModel.option.color[getRootId(node) % length]; + } + return color; +} + +/** + * Get index of root in sorted order + * + * @param {TreeNode} node current node + * @return {number} index in root + */ +function getRootId(node) { + var ancestor = node; + while (ancestor.depth > 1) { + ancestor = ancestor.parentNode; + } + + var virtualRoot = node.getAncestors()[0]; + return indexOf(virtualRoot.children, ancestor); +} + +function isNodeHighlighted(node, activeNode, policy) { + if (policy === NodeHighlightPolicy.NONE) { + return false; + } + else if (policy === NodeHighlightPolicy.SELF) { + return node === activeNode; + } + else if (policy === NodeHighlightPolicy.ANCESTOR) { + return node === activeNode || node.isAncestorOf(activeNode); + } + else { + return node === activeNode || node.isDescendantOf(activeNode); + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 ROOT_TO_NODE_ACTION = 'sunburstRootToNode'; + +var SunburstView = Chart.extend({ + + type: 'sunburst', + + init: function () { + }, + + render: function (seriesModel, ecModel, api, payload) { + var that = this; + + this.seriesModel = seriesModel; + this.api = api; + this.ecModel = ecModel; + + var data = seriesModel.getData(); + var virtualRoot = data.tree.root; + + var newRoot = seriesModel.getViewRoot(); + + var group = this.group; + + var renderLabelForZeroData = seriesModel.get('renderLabelForZeroData'); + + var newChildren = []; + newRoot.eachNode(function (node) { + newChildren.push(node); + }); + var oldChildren = this._oldChildren || []; + + dualTravel(newChildren, oldChildren); + + renderRollUp(virtualRoot, newRoot); + + if (payload && payload.highlight && payload.highlight.piece) { + var highlightPolicy = seriesModel.getShallow('highlightPolicy'); + payload.highlight.piece.onEmphasis(highlightPolicy); + } + else if (payload && payload.unhighlight) { + var piece = this.virtualPiece; + if (!piece && virtualRoot.children.length) { + piece = virtualRoot.children[0].piece; + } + if (piece) { + piece.onNormal(); + } + } + + this._initEvents(); + + this._oldChildren = newChildren; + + function dualTravel(newChildren, oldChildren) { + if (newChildren.length === 0 && oldChildren.length === 0) { + return; + } + + new DataDiffer(oldChildren, newChildren, getKey, getKey) + .add(processNode) + .update(processNode) + .remove(curry(processNode, null)) + .execute(); + + function getKey(node) { + return node.getId(); + } + + function processNode(newId, oldId) { + var newNode = newId == null ? null : newChildren[newId]; + var oldNode = oldId == null ? null : oldChildren[oldId]; + + doRenderNode(newNode, oldNode); + } + } + + function doRenderNode(newNode, oldNode) { + if (!renderLabelForZeroData && newNode && !newNode.getValue()) { + // Not render data with value 0 + newNode = null; + } + + if (newNode !== virtualRoot && oldNode !== virtualRoot) { + if (oldNode && oldNode.piece) { + if (newNode) { + // Update + oldNode.piece.updateData( + false, newNode, 'normal', seriesModel, ecModel); + + // For tooltip + data.setItemGraphicEl(newNode.dataIndex, oldNode.piece); + } + else { + // Remove + removeNode(oldNode); + } + } + else if (newNode) { + // Add + var piece = new SunburstPiece( + newNode, + seriesModel, + ecModel + ); + group.add(piece); + + // For tooltip + data.setItemGraphicEl(newNode.dataIndex, piece); + } + } + } + + function removeNode(node) { + if (!node) { + return; + } + + if (node.piece) { + group.remove(node.piece); + node.piece = null; + } + } + + function renderRollUp(virtualRoot, viewRoot) { + if (viewRoot.depth > 0) { + // Render + if (that.virtualPiece) { + // Update + that.virtualPiece.updateData( + false, virtualRoot, 'normal', seriesModel, ecModel); + } + else { + // Add + that.virtualPiece = new SunburstPiece( + virtualRoot, + seriesModel, + ecModel + ); + group.add(that.virtualPiece); + } + + if (viewRoot.piece._onclickEvent) { + viewRoot.piece.off('click', viewRoot.piece._onclickEvent); + } + var event = function (e) { + that._rootToNode(viewRoot.parentNode); + }; + viewRoot.piece._onclickEvent = event; + that.virtualPiece.on('click', event); + } + else if (that.virtualPiece) { + // Remove + group.remove(that.virtualPiece); + that.virtualPiece = null; + } + } + }, + + dispose: function () { + }, + + /** + * @private + */ + _initEvents: function () { + var that = this; + + var event = function (e) { + var targetFound = false; + var viewRoot = that.seriesModel.getViewRoot(); + viewRoot.eachNode(function (node) { + if (!targetFound + && node.piece && node.piece.childAt(0) === e.target + ) { + var nodeClick = node.getModel().get('nodeClick'); + if (nodeClick === 'rootToNode') { + that._rootToNode(node); + } + else if (nodeClick === 'link') { + var itemModel = node.getModel(); + var link = itemModel.get('link'); + if (link) { + var linkTarget = itemModel.get('target', true) + || '_blank'; + window.open(link, linkTarget); + } + } + targetFound = true; + } + }); + }; + + if (this.group._onclickEvent) { + this.group.off('click', this.group._onclickEvent); + } + this.group.on('click', event); + this.group._onclickEvent = event; + }, + + /** + * @private + */ + _rootToNode: function (node) { + if (node !== this.seriesModel.getViewRoot()) { + this.api.dispatchAction({ + type: ROOT_TO_NODE_ACTION, + from: this.uid, + seriesId: this.seriesModel.id, + targetNode: node + }); + } + }, + + /** + * @implement + */ + containPoint: function (point, seriesModel) { + var treeRoot = seriesModel.getData(); + var itemLayout = treeRoot.getItemLayout(0); + if (itemLayout) { + var dx = point[0] - itemLayout.cx; + var dy = point[1] - itemLayout.cy; + var radius = Math.sqrt(dx * dx + dy * dy); + return radius <= itemLayout.r && radius >= itemLayout.r0; + } + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Sunburst action + */ + +var ROOT_TO_NODE_ACTION$1 = 'sunburstRootToNode'; + +registerAction( + {type: ROOT_TO_NODE_ACTION$1, update: 'updateView'}, + function (payload, ecModel) { + + ecModel.eachComponent( + {mainType: 'series', subType: 'sunburst', query: payload}, + handleRootToNode + ); + + function handleRootToNode(model, index) { + var targetInfo = retrieveTargetInfo(payload, [ROOT_TO_NODE_ACTION$1], model); + + if (targetInfo) { + var originViewRoot = model.getViewRoot(); + if (originViewRoot) { + payload.direction = aboveViewRoot(originViewRoot, targetInfo.node) + ? 'rollUp' : 'drillDown'; + } + model.resetViewRoot(targetInfo.node); + } + } + } +); + + +var HIGHLIGHT_ACTION = 'sunburstHighlight'; + +registerAction( + {type: HIGHLIGHT_ACTION, update: 'updateView'}, + function (payload, ecModel) { + + ecModel.eachComponent( + {mainType: 'series', subType: 'sunburst', query: payload}, + handleHighlight + ); + + function handleHighlight(model, index) { + var targetInfo = retrieveTargetInfo(payload, [HIGHLIGHT_ACTION], model); + + if (targetInfo) { + payload.highlight = targetInfo.node; + } + } + } +); + + +var UNHIGHLIGHT_ACTION = 'sunburstUnhighlight'; + +registerAction( + {type: UNHIGHLIGHT_ACTION, update: 'updateView'}, + function (payload, ecModel) { + + ecModel.eachComponent( + {mainType: 'series', subType: 'sunburst', query: payload}, + handleUnhighlight + ); + + function handleUnhighlight(model, index) { + payload.unhighlight = true; + } + } +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 RADIAN$1 = Math.PI / 180; + +var sunburstLayout = function (seriesType, ecModel, api, payload) { + ecModel.eachSeriesByType(seriesType, function (seriesModel) { + var center = seriesModel.get('center'); + var radius = seriesModel.get('radius'); + + if (!isArray(radius)) { + radius = [0, radius]; + } + if (!isArray(center)) { + center = [center, center]; + } + + var width = api.getWidth(); + var height = api.getHeight(); + var size = Math.min(width, height); + var cx = parsePercent$1(center[0], width); + var cy = parsePercent$1(center[1], height); + var r0 = parsePercent$1(radius[0], size / 2); + var r = parsePercent$1(radius[1], size / 2); + + var startAngle = -seriesModel.get('startAngle') * RADIAN$1; + var minAngle = seriesModel.get('minAngle') * RADIAN$1; + + var virtualRoot = seriesModel.getData().tree.root; + var treeRoot = seriesModel.getViewRoot(); + var rootDepth = treeRoot.depth; + + var sort = seriesModel.get('sort'); + if (sort != null) { + initChildren$1(treeRoot, sort); + } + + var validDataCount = 0; + each$1(treeRoot.children, function (child) { + !isNaN(child.getValue()) && validDataCount++; + }); + + var sum = treeRoot.getValue(); + // Sum may be 0 + var unitRadian = Math.PI / (sum || validDataCount) * 2; + + var renderRollupNode = treeRoot.depth > 0; + var levels = treeRoot.height - (renderRollupNode ? -1 : 1); + var rPerLevel = (r - r0) / (levels || 1); + + var clockwise = seriesModel.get('clockwise'); + + var stillShowZeroSum = seriesModel.get('stillShowZeroSum'); + + // In the case some sector angle is smaller than minAngle + var dir = clockwise ? 1 : -1; + + /** + * Render a tree + * @return increased angle + */ + var renderNode = function (node, startAngle) { + if (!node) { + return; + } + + var endAngle = startAngle; + + // Render self + if (node !== virtualRoot) { + // Tree node is virtual, so it doesn't need to be drawn + var value = node.getValue(); + + var angle = (sum === 0 && stillShowZeroSum) + ? unitRadian : (value * unitRadian); + if (angle < minAngle) { + angle = minAngle; + + } + else { + + } + + endAngle = startAngle + dir * angle; + + var depth = node.depth - rootDepth + - (renderRollupNode ? -1 : 1); + var rStart = r0 + rPerLevel * depth; + var rEnd = r0 + rPerLevel * (depth + 1); + + var itemModel = node.getModel(); + if (itemModel.get('r0') != null) { + rStart = parsePercent$1(itemModel.get('r0'), size / 2); + } + if (itemModel.get('r') != null) { + rEnd = parsePercent$1(itemModel.get('r'), size / 2); + } + + node.setLayout({ + angle: angle, + startAngle: startAngle, + endAngle: endAngle, + clockwise: clockwise, + cx: cx, + cy: cy, + r0: rStart, + r: rEnd + }); + } + + // Render children + if (node.children && node.children.length) { + // currentAngle = startAngle; + var siblingAngle = 0; + each$1(node.children, function (node) { + siblingAngle += renderNode(node, startAngle + siblingAngle); + }); + } + + return endAngle - startAngle; + }; + + // Virtual root node for roll up + if (renderRollupNode) { + var rStart = r0; + var rEnd = r0 + rPerLevel; + + var angle = Math.PI * 2; + virtualRoot.setLayout({ + angle: angle, + startAngle: startAngle, + endAngle: startAngle + angle, + clockwise: clockwise, + cx: cx, + cy: cy, + r0: rStart, + r: rEnd + }); + } + + renderNode(treeRoot, startAngle); + }); +}; + +/** + * Init node children by order and update visual + * + * @param {TreeNode} node root node + * @param {boolean} isAsc if is in ascendant order + */ +function initChildren$1(node, isAsc) { + var children = node.children || []; + + node.children = sort$2(children, isAsc); + + // Init children recursively + if (children.length) { + each$1(node.children, function (child) { + initChildren$1(child, isAsc); + }); + } +} + +/** + * Sort children nodes + * + * @param {TreeNode[]} children children of node to be sorted + * @param {string | function | null} sort sort method + * See SunburstSeries.js for details. + */ +function sort$2(children, sortOrder) { + if (typeof sortOrder === 'function') { + return children.sort(sortOrder); + } + else { + var isAsc = sortOrder === 'asc'; + return children.sort(function (a, b) { + var diff = (a.getValue() - b.getValue()) * (isAsc ? 1 : -1); + return diff === 0 + ? (a.dataIndex - b.dataIndex) * (isAsc ? -1 : 1) + : diff; + }); + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerVisual(curry(dataColor, 'sunburst')); +registerLayout(curry(sunburstLayout, 'sunburst')); +registerProcessor(curry(dataFilter, 'sunburst')); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 dataToCoordSize(dataSize, dataItem) { + // dataItem is necessary in log axis. + dataItem = dataItem || [0, 0]; + return map(['x', 'y'], function (dim, dimIdx) { + var axis = this.getAxis(dim); + var val = dataItem[dimIdx]; + var halfSize = dataSize[dimIdx] / 2; + return axis.type === 'category' + ? axis.getBandWidth() + : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); + }, this); +} + +var prepareCartesian2d = function (coordSys) { + var rect = coordSys.grid.getRect(); + return { + coordSys: { + // The name exposed to user is always 'cartesian2d' but not 'grid'. + type: 'cartesian2d', + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + api: { + coord: function (data) { + // do not provide "out" param + return coordSys.dataToPoint(data); + }, + size: bind(dataToCoordSize, coordSys) + } + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 dataToCoordSize$1(dataSize, dataItem) { + dataItem = dataItem || [0, 0]; + return map([0, 1], function (dimIdx) { + var val = dataItem[dimIdx]; + var halfSize = dataSize[dimIdx] / 2; + var p1 = []; + var p2 = []; + p1[dimIdx] = val - halfSize; + p2[dimIdx] = val + halfSize; + p1[1 - dimIdx] = p2[1 - dimIdx] = dataItem[1 - dimIdx]; + return Math.abs(this.dataToPoint(p1)[dimIdx] - this.dataToPoint(p2)[dimIdx]); + }, this); +} + +var prepareGeo = function (coordSys) { + var rect = coordSys.getBoundingRect(); + return { + coordSys: { + type: 'geo', + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height, + zoom: coordSys.getZoom() + }, + api: { + coord: function (data) { + // do not provide "out" and noRoam param, + // Compatible with this usage: + // echarts.util.map(item.points, api.coord) + return coordSys.dataToPoint(data); + }, + size: bind(dataToCoordSize$1, coordSys) + } + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 dataToCoordSize$2(dataSize, dataItem) { + // dataItem is necessary in log axis. + var axis = this.getAxis(); + var val = dataItem instanceof Array ? dataItem[0] : dataItem; + var halfSize = (dataSize instanceof Array ? dataSize[0] : dataSize) / 2; + return axis.type === 'category' + ? axis.getBandWidth() + : Math.abs(axis.dataToCoord(val - halfSize) - axis.dataToCoord(val + halfSize)); +} + +var prepareSingleAxis = function (coordSys) { + var rect = coordSys.getRect(); + + return { + coordSys: { + type: 'singleAxis', + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height + }, + api: { + coord: function (val) { + // do not provide "out" param + return coordSys.dataToPoint(val); + }, + size: bind(dataToCoordSize$2, coordSys) + } + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 dataToCoordSize$3(dataSize, dataItem) { + // dataItem is necessary in log axis. + return map(['Radius', 'Angle'], function (dim, dimIdx) { + var axis = this['get' + dim + 'Axis'](); + var val = dataItem[dimIdx]; + var halfSize = dataSize[dimIdx] / 2; + var method = 'dataTo' + dim; + + var result = axis.type === 'category' + ? axis.getBandWidth() + : Math.abs(axis[method](val - halfSize) - axis[method](val + halfSize)); + + if (dim === 'Angle') { + result = result * Math.PI / 180; + } + + return result; + + }, this); +} + +var preparePolar = function (coordSys) { + var radiusAxis = coordSys.getRadiusAxis(); + var angleAxis = coordSys.getAngleAxis(); + var radius = radiusAxis.getExtent(); + radius[0] > radius[1] && radius.reverse(); + + return { + coordSys: { + type: 'polar', + cx: coordSys.cx, + cy: coordSys.cy, + r: radius[1], + r0: radius[0] + }, + api: { + coord: bind(function (data) { + var radius = radiusAxis.dataToRadius(data[0]); + var angle = angleAxis.dataToAngle(data[1]); + var coord = coordSys.coordToPoint([radius, angle]); + coord.push(radius, angle * Math.PI / 180); + return coord; + }), + size: bind(dataToCoordSize$3, coordSys) + } + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 prepareCalendar = function (coordSys) { + var rect = coordSys.getRect(); + var rangeInfo = coordSys.getRangeInfo(); + + return { + coordSys: { + type: 'calendar', + x: rect.x, + y: rect.y, + width: rect.width, + height: rect.height, + cellWidth: coordSys.getCellWidth(), + cellHeight: coordSys.getCellHeight(), + rangeInfo: { + start: rangeInfo.start, + end: rangeInfo.end, + weeks: rangeInfo.weeks, + dayCount: rangeInfo.allDay + } + }, + api: { + coord: function (data, clamp) { + return coordSys.dataToPoint(data, clamp); + } + } + }; +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 ITEM_STYLE_NORMAL_PATH = ['itemStyle']; +var ITEM_STYLE_EMPHASIS_PATH = ['emphasis', 'itemStyle']; +var LABEL_NORMAL = ['label']; +var LABEL_EMPHASIS = ['emphasis', 'label']; +// Use prefix to avoid index to be the same as el.name, +// which will cause weird udpate animation. +var GROUP_DIFF_PREFIX = 'e\0\0'; + +/** + * To reduce total package size of each coordinate systems, the modules `prepareCustom` + * of each coordinate systems are not required by each coordinate systems directly, but + * required by the module `custom`. + * + * prepareInfoForCustomSeries {Function}: optional + * @return {Object} {coordSys: {...}, api: { + * coord: function (data, clamp) {}, // return point in global. + * size: function (dataSize, dataItem) {} // return size of each axis in coordSys. + * }} + */ +var prepareCustoms = { + cartesian2d: prepareCartesian2d, + geo: prepareGeo, + singleAxis: prepareSingleAxis, + polar: preparePolar, + calendar: prepareCalendar +}; + +// ------ +// Model +// ------ + +extendSeriesModel({ + + type: 'series.custom', + + dependencies: ['grid', 'polar', 'geo', 'singleAxis', 'calendar'], + + defaultOption: { + coordinateSystem: 'cartesian2d', // Can be set as 'none' + zlevel: 0, + z: 2, + legendHoverLink: true, + + useTransform: true + + // Cartesian coordinate system + // xAxisIndex: 0, + // yAxisIndex: 0, + + // Polar coordinate system + // polarIndex: 0, + + // Geo coordinate system + // geoIndex: 0, + + // label: {} + // itemStyle: {} + }, + + getInitialData: function (option, ecModel) { + return createListFromArray(this.getSource(), this); + } +}); + +// ----- +// View +// ----- + +extendChartView({ + + type: 'custom', + + /** + * @private + * @type {module:echarts/data/List} + */ + _data: null, + + /** + * @override + */ + render: function (customSeries, ecModel, api, payload) { + var oldData = this._data; + var data = customSeries.getData(); + var group = this.group; + var renderItem = makeRenderItem(customSeries, data, ecModel, api); + + // By default, merge mode is applied. In most cases, custom series is + // used in the scenario that data amount is not large but graphic elements + // is complicated, where merge mode is probably necessary for optimization. + // For example, reuse graphic elements and only update the transform when + // roam or data zoom according to `actionType`. + data.diff(oldData) + .add(function (newIdx) { + createOrUpdate$1( + null, newIdx, renderItem(newIdx, payload), customSeries, group, data + ); + }) + .update(function (newIdx, oldIdx) { + var el = oldData.getItemGraphicEl(oldIdx); + createOrUpdate$1( + el, newIdx, renderItem(newIdx, payload), customSeries, group, data + ); + }) + .remove(function (oldIdx) { + var el = oldData.getItemGraphicEl(oldIdx); + el && group.remove(el); + }) + .execute(); + + this._data = data; + }, + + incrementalPrepareRender: function (customSeries, ecModel, api) { + this.group.removeAll(); + this._data = null; + }, + + incrementalRender: function (params, customSeries, ecModel, api, payload) { + var data = customSeries.getData(); + var renderItem = makeRenderItem(customSeries, data, ecModel, api); + function setIncrementalAndHoverLayer(el) { + if (!el.isGroup) { + el.incremental = true; + el.useHoverLayer = true; + } + } + for (var idx = params.start; idx < params.end; idx++) { + var el = createOrUpdate$1(null, idx, renderItem(idx, payload), customSeries, this.group, data); + el.traverse(setIncrementalAndHoverLayer); + } + }, + + /** + * @override + */ + dispose: noop, + + /** + * @override + */ + filterForExposedEvent: function (eventType, query, targetEl, packedEvent) { + var targetName = query.target; + if (targetName == null || targetEl.name === targetName) { + return true; + } + + // Enable to give a name on a group made by `renderItem`, and listen + // events that triggerd by its descendents. + while ((targetEl = targetEl.parent) && targetEl !== this.group) { + if (targetEl.name === targetName) { + return true; + } + } + + return false; + } +}); + + +function createEl(elOption) { + var graphicType = elOption.type; + var el; + + if (graphicType === 'path') { + var shape = elOption.shape; + el = makePath( + shape.pathData, + null, + { + x: shape.x || 0, + y: shape.y || 0, + width: shape.width || 0, + height: shape.height || 0 + }, + 'center' + ); + el.__customPathData = elOption.pathData; + } + else if (graphicType === 'image') { + el = new ZImage({ + }); + el.__customImagePath = elOption.style.image; + } + else if (graphicType === 'text') { + el = new Text({ + }); + el.__customText = elOption.style.text; + } + else { + var Clz = graphic[graphicType.charAt(0).toUpperCase() + graphicType.slice(1)]; + + if (__DEV__) { + assert$1(Clz, 'graphic type "' + graphicType + '" can not be found.'); + } + + el = new Clz(); + } + + el.__customGraphicType = graphicType; + el.name = elOption.name; + + return el; +} + +function updateEl(el, dataIndex, elOption, animatableModel, data, isInit, isRoot) { + var targetProps = {}; + var elOptionStyle = elOption.style || {}; + + elOption.shape && (targetProps.shape = clone(elOption.shape)); + elOption.position && (targetProps.position = elOption.position.slice()); + elOption.scale && (targetProps.scale = elOption.scale.slice()); + elOption.origin && (targetProps.origin = elOption.origin.slice()); + elOption.rotation && (targetProps.rotation = elOption.rotation); + + if (el.type === 'image' && elOption.style) { + var targetStyle = targetProps.style = {}; + each$1(['x', 'y', 'width', 'height'], function (prop) { + prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit); + }); + } + + if (el.type === 'text' && elOption.style) { + var targetStyle = targetProps.style = {}; + each$1(['x', 'y'], function (prop) { + prepareStyleTransition(prop, targetStyle, elOptionStyle, el.style, isInit); + }); + // Compatible with previous: both support + // textFill and fill, textStroke and stroke in 'text' element. + !elOptionStyle.hasOwnProperty('textFill') && elOptionStyle.fill && ( + elOptionStyle.textFill = elOptionStyle.fill + ); + !elOptionStyle.hasOwnProperty('textStroke') && elOptionStyle.stroke && ( + elOptionStyle.textStroke = elOptionStyle.stroke + ); + } + + if (el.type !== 'group') { + el.useStyle(elOptionStyle); + + // Init animation. + if (isInit) { + el.style.opacity = 0; + var targetOpacity = elOptionStyle.opacity; + targetOpacity == null && (targetOpacity = 1); + initProps(el, {style: {opacity: targetOpacity}}, animatableModel, dataIndex); + } + } + + if (isInit) { + el.attr(targetProps); + } + else { + updateProps(el, targetProps, animatableModel, dataIndex); + } + + // z2 must not be null/undefined, otherwise sort error may occur. + el.attr({ + z2: elOption.z2 || 0, + silent: elOption.silent, + invisible: elOption.invisible, + ignore: elOption.ignore + }); + + // If `elOption.styleEmphasis` is `false`, remove hover style. The + // logic is ensured by `graphicUtil.setElementHoverStyle`. + var styleEmphasis = elOption.styleEmphasis; + var disableStyleEmphasis = styleEmphasis === false; + if (!( + // Try to escapse setting hover style for performance. + (el.__cusHasEmphStl && styleEmphasis == null) + || (!el.__cusHasEmphStl && disableStyleEmphasis) + )) { + // Should not use graphicUtil.setHoverStyle, since the styleEmphasis + // should not be share by group and its descendants. + setElementHoverStyle(el, styleEmphasis); + el.__cusHasEmphStl = !disableStyleEmphasis; + } + isRoot && setAsHoverStyleTrigger(el, !disableStyleEmphasis); +} + +function prepareStyleTransition(prop, targetStyle, elOptionStyle, oldElStyle, isInit) { + if (elOptionStyle[prop] != null && !isInit) { + targetStyle[prop] = elOptionStyle[prop]; + elOptionStyle[prop] = oldElStyle[prop]; + } +} + +function makeRenderItem(customSeries, data, ecModel, api) { + var renderItem = customSeries.get('renderItem'); + var coordSys = customSeries.coordinateSystem; + var prepareResult = {}; + + if (coordSys) { + if (__DEV__) { + assert$1(renderItem, 'series.render is required.'); + assert$1( + coordSys.prepareCustoms || prepareCustoms[coordSys.type], + 'This coordSys does not support custom series.' + ); + } + + prepareResult = coordSys.prepareCustoms + ? coordSys.prepareCustoms() + : prepareCustoms[coordSys.type](coordSys); + } + + var userAPI = defaults({ + getWidth: api.getWidth, + getHeight: api.getHeight, + getZr: api.getZr, + getDevicePixelRatio: api.getDevicePixelRatio, + value: value, + style: style, + styleEmphasis: styleEmphasis, + visual: visual, + barLayout: barLayout, + currentSeriesIndices: currentSeriesIndices, + font: font + }, prepareResult.api || {}); + + var userParams = { + // The life cycle of context: current round of rendering. + // The global life cycle is probably not necessary, because + // user can store global status by themselves. + context: {}, + seriesId: customSeries.id, + seriesName: customSeries.name, + seriesIndex: customSeries.seriesIndex, + coordSys: prepareResult.coordSys, + dataInsideLength: data.count(), + encode: wrapEncodeDef(customSeries.getData()) + }; + + // Do not support call `api` asynchronously without dataIndexInside input. + var currDataIndexInside; + var currDirty = true; + var currItemModel; + var currLabelNormalModel; + var currLabelEmphasisModel; + var currVisualColor; + + return function (dataIndexInside, payload) { + currDataIndexInside = dataIndexInside; + currDirty = true; + + return renderItem && renderItem( + defaults({ + dataIndexInside: dataIndexInside, + dataIndex: data.getRawIndex(dataIndexInside), + // Can be used for optimization when zoom or roam. + actionType: payload ? payload.type : null + }, userParams), + userAPI + ) || {}; + }; + + // Do not update cache until api called. + function updateCache(dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + if (currDirty) { + currItemModel = data.getItemModel(dataIndexInside); + currLabelNormalModel = currItemModel.getModel(LABEL_NORMAL); + currLabelEmphasisModel = currItemModel.getModel(LABEL_EMPHASIS); + currVisualColor = data.getItemVisual(dataIndexInside, 'color'); + + currDirty = false; + } + } + + /** + * @public + * @param {number|string} dim + * @param {number} [dataIndexInside=currDataIndexInside] + * @return {number|string} value + */ + function value(dim, dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + return data.get(data.getDimension(dim || 0), dataIndexInside); + } + + /** + * By default, `visual` is applied to style (to support visualMap). + * `visual.color` is applied at `fill`. If user want apply visual.color on `stroke`, + * it can be implemented as: + * `api.style({stroke: api.visual('color'), fill: null})`; + * @public + * @param {Object} [extra] + * @param {number} [dataIndexInside=currDataIndexInside] + */ + function style(extra, dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + updateCache(dataIndexInside); + + var itemStyle = currItemModel.getModel(ITEM_STYLE_NORMAL_PATH).getItemStyle(); + + currVisualColor != null && (itemStyle.fill = currVisualColor); + var opacity = data.getItemVisual(dataIndexInside, 'opacity'); + opacity != null && (itemStyle.opacity = opacity); + + setTextStyle(itemStyle, currLabelNormalModel, null, { + autoColor: currVisualColor, + isRectText: true + }); + + itemStyle.text = currLabelNormalModel.getShallow('show') + ? retrieve2( + customSeries.getFormattedLabel(dataIndexInside, 'normal'), + getDefaultLabel(data, dataIndexInside) + ) + : null; + + extra && extend(itemStyle, extra); + return itemStyle; + } + + /** + * @public + * @param {Object} [extra] + * @param {number} [dataIndexInside=currDataIndexInside] + */ + function styleEmphasis(extra, dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + updateCache(dataIndexInside); + + var itemStyle = currItemModel.getModel(ITEM_STYLE_EMPHASIS_PATH).getItemStyle(); + + setTextStyle(itemStyle, currLabelEmphasisModel, null, { + isRectText: true + }, true); + + itemStyle.text = currLabelEmphasisModel.getShallow('show') + ? retrieve3( + customSeries.getFormattedLabel(dataIndexInside, 'emphasis'), + customSeries.getFormattedLabel(dataIndexInside, 'normal'), + getDefaultLabel(data, dataIndexInside) + ) + : null; + + extra && extend(itemStyle, extra); + return itemStyle; + } + + /** + * @public + * @param {string} visualType + * @param {number} [dataIndexInside=currDataIndexInside] + */ + function visual(visualType, dataIndexInside) { + dataIndexInside == null && (dataIndexInside = currDataIndexInside); + return data.getItemVisual(dataIndexInside, visualType); + } + + /** + * @public + * @param {number} opt.count Positive interger. + * @param {number} [opt.barWidth] + * @param {number} [opt.barMaxWidth] + * @param {number} [opt.barGap] + * @param {number} [opt.barCategoryGap] + * @return {Object} {width, offset, offsetCenter} is not support, return undefined. + */ + function barLayout(opt) { + if (coordSys.getBaseAxis) { + var baseAxis = coordSys.getBaseAxis(); + return getLayoutOnAxis(defaults({axis: baseAxis}, opt), api); + } + } + + /** + * @public + * @return {Array.} + */ + function currentSeriesIndices() { + return ecModel.getCurrentSeriesIndices(); + } + + /** + * @public + * @param {Object} opt + * @param {string} [opt.fontStyle] + * @param {number} [opt.fontWeight] + * @param {number} [opt.fontSize] + * @param {string} [opt.fontFamily] + * @return {string} font string + */ + function font(opt) { + return getFont(opt, ecModel); + } +} + +function wrapEncodeDef(data) { + var encodeDef = {}; + each$1(data.dimensions, function (dimName, dataDimIndex) { + var dimInfo = data.getDimensionInfo(dimName); + if (!dimInfo.isExtraCoord) { + var coordDim = dimInfo.coordDim; + var dataDims = encodeDef[coordDim] = encodeDef[coordDim] || []; + dataDims[dimInfo.coordDimIndex] = dataDimIndex; + } + }); + return encodeDef; +} + +function createOrUpdate$1(el, dataIndex, elOption, animatableModel, group, data) { + el = doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data, true); + el && data.setItemGraphicEl(dataIndex, el); + + return el; +} + +function doCreateOrUpdate(el, dataIndex, elOption, animatableModel, group, data, isRoot) { + elOption = elOption || {}; + + var elOptionType = elOption.type; + if (el && ( + // Also consider that if `renderItem` returns nothing, the original element + // (if exists) will be removed (elOption is an empty object in that case). + elOptionType == null + || elOption.$merge === false + || (elOptionType !== el.__customGraphicType + && (elOptionType !== 'path' || elOption.pathData !== el.__customPathData) + && (elOptionType !== 'image' || elOption.style.image !== el.__customImagePath) + && (elOptionType !== 'text' || elOption.style.text !== el.__customText) + ) + )) { + group.remove(el); + el = null; + } + + // `elOption.type` is undefined when `renderItem` returns nothing. + if (elOptionType == null) { + return; + } + + var isInit = !el; + !el && (el = createEl(elOption)); + updateEl(el, dataIndex, elOption, animatableModel, data, isInit, isRoot); + + if (elOptionType === 'group') { + mergeChildren(el, dataIndex, elOption, animatableModel, data); + } + + // Always add whatever already added to ensure sequence. + group.add(el); + + return el; +} + +// Usage: +// (1) By default, `elOption.$mergeChildren` is `'byIndex'`, which indicates that +// the existing children will not be removed, and enables the feature that +// update some of the props of some of the children simply by construct +// the returned children of `renderItem` like: +// `var children = group.children = []; children[3] = {opacity: 0.5};` +// (2) If `elOption.$mergeChildren` is `'byName'`, add/update/remove children +// by child.name. But that might be lower performance. +// (3) If `elOption.$mergeChildren` is `false`, the existing children will be +// replaced totally. +// For implementation simpleness, do not provide a direct way to remove sinlge +// child (otherwise the total indicies of the children array have to be modified). +// User can remove a single child by set its `ignore` as `true` or replace +// it by another element, where its `$merge` can be set as `true` if necessary. +function mergeChildren(el, dataIndex, elOption, animatableModel, data) { + var newChildren = elOption.children; + var newLen = newChildren ? newChildren.length : 0; + var mergeChildren = elOption.$mergeChildren; + // `diffChildrenByName` has been deprecated. + var byName = mergeChildren === 'byName' || elOption.diffChildrenByName; + var notMerge = mergeChildren === false; + + // For better performance on roam update, only enter if necessary. + if (!newLen && !byName && !notMerge) { + return; + } + + if (byName) { + diffGroupChildren({ + oldChildren: el.children() || [], + newChildren: newChildren || [], + dataIndex: dataIndex, + animatableModel: animatableModel, + group: el, + data: data + }); + return; + } + + notMerge && el.removeAll(); + + // Mapping children of a group simply by index, which + // might be better performance. + var index = 0; + for (; index < newLen; index++) { + newChildren[index] && doCreateOrUpdate( + el.childAt(index), + dataIndex, + newChildren[index], + animatableModel, + el, + data + ); + } + if (__DEV__) { + assert$1( + !notMerge || el.childCount() === index, + 'MUST NOT contain empty item in children array when `group.$mergeChildren` is `false`.' + ); + } +} + +function diffGroupChildren(context) { + (new DataDiffer( + context.oldChildren, + context.newChildren, + getKey, + getKey, + context + )) + .add(processAddUpdate) + .update(processAddUpdate) + .remove(processRemove) + .execute(); +} + +function getKey(item, idx) { + var name = item && item.name; + return name != null ? name : GROUP_DIFF_PREFIX + idx; +} + +function processAddUpdate(newIndex, oldIndex) { + var context = this.context; + var childOption = newIndex != null ? context.newChildren[newIndex] : null; + var child = oldIndex != null ? context.oldChildren[oldIndex] : null; + + doCreateOrUpdate( + child, + context.dataIndex, + childOption, + context.animatableModel, + context.group, + context.data + ); +} + +function processRemove(oldIndex) { + var context = this.context; + var child = context.oldChildren[oldIndex]; + child && context.group.remove(child); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// ------------- +// Preprocessor +// ------------- + +registerPreprocessor(function (option) { + var graphicOption = option.graphic; + + // Convert + // {graphic: [{left: 10, type: 'circle'}, ...]} + // or + // {graphic: {left: 10, type: 'circle'}} + // to + // {graphic: [{elements: [{left: 10, type: 'circle'}, ...]}]} + if (isArray(graphicOption)) { + if (!graphicOption[0] || !graphicOption[0].elements) { + option.graphic = [{elements: graphicOption}]; + } + else { + // Only one graphic instance can be instantiated. (We dont + // want that too many views are created in echarts._viewMap) + option.graphic = [option.graphic[0]]; + } + } + else if (graphicOption && !graphicOption.elements) { + option.graphic = [{elements: [graphicOption]}]; + } +}); + +// ------ +// Model +// ------ + +var GraphicModel = extendComponentModel({ + + type: 'graphic', + + defaultOption: { + + // Extra properties for each elements: + // + // left/right/top/bottom: (like 12, '22%', 'center', default undefined) + // If left/rigth is set, shape.x/shape.cx/position will not be used. + // If top/bottom is set, shape.y/shape.cy/position will not be used. + // This mechanism is useful when you want to position a group/element + // against the right side or the center of this container. + // + // width/height: (can only be pixel value, default 0) + // Only be used to specify contianer(group) size, if needed. And + // can not be percentage value (like '33%'). See the reason in the + // layout algorithm below. + // + // bounding: (enum: 'all' (default) | 'raw') + // Specify how to calculate boundingRect when locating. + // 'all': Get uioned and transformed boundingRect + // from both itself and its descendants. + // This mode simplies confining a group of elements in the bounding + // of their ancester container (e.g., using 'right: 0'). + // 'raw': Only use the boundingRect of itself and before transformed. + // This mode is similar to css behavior, which is useful when you + // want an element to be able to overflow its container. (Consider + // a rotated circle needs to be located in a corner.) + + // Note: elements is always behind its ancestors in this elements array. + elements: [], + parentId: null + }, + + /** + * Save el options for the sake of the performance (only update modified graphics). + * The order is the same as those in option. (ancesters -> descendants) + * + * @private + * @type {Array.} + */ + _elOptionsToUpdate: null, + + /** + * @override + */ + mergeOption: function (option) { + // Prevent default merge to elements + var elements = this.option.elements; + this.option.elements = null; + + GraphicModel.superApply(this, 'mergeOption', arguments); + + this.option.elements = elements; + }, + + /** + * @override + */ + optionUpdated: function (newOption, isInit) { + var thisOption = this.option; + var newList = (isInit ? thisOption : newOption).elements; + var existList = thisOption.elements = isInit ? [] : thisOption.elements; + + var flattenedList = []; + this._flatten(newList, flattenedList); + + var mappingResult = mappingToExists(existList, flattenedList); + makeIdAndName(mappingResult); + + // Clear elOptionsToUpdate + var elOptionsToUpdate = this._elOptionsToUpdate = []; + + each$1(mappingResult, function (resultItem, index) { + var newElOption = resultItem.option; + + if (__DEV__) { + assert$1( + isObject$1(newElOption) || resultItem.exist, + 'Empty graphic option definition' + ); + } + + if (!newElOption) { + return; + } + + elOptionsToUpdate.push(newElOption); + + setKeyInfoToNewElOption(resultItem, newElOption); + + mergeNewElOptionToExist(existList, index, newElOption); + + setLayoutInfoToExist(existList[index], newElOption); + + }, this); + + // Clean + for (var i = existList.length - 1; i >= 0; i--) { + if (existList[i] == null) { + existList.splice(i, 1); + } + else { + // $action should be volatile, otherwise option gotten from + // `getOption` will contain unexpected $action. + delete existList[i].$action; + } + } + }, + + /** + * Convert + * [{ + * type: 'group', + * id: 'xx', + * children: [{type: 'circle'}, {type: 'polygon'}] + * }] + * to + * [ + * {type: 'group', id: 'xx'}, + * {type: 'circle', parentId: 'xx'}, + * {type: 'polygon', parentId: 'xx'} + * ] + * + * @private + * @param {Array.} optionList option list + * @param {Array.} result result of flatten + * @param {Object} parentOption parent option + */ + _flatten: function (optionList, result, parentOption) { + each$1(optionList, function (option) { + if (!option) { + return; + } + + if (parentOption) { + option.parentOption = parentOption; + } + + result.push(option); + + var children = option.children; + if (option.type === 'group' && children) { + this._flatten(children, result, option); + } + // Deleting for JSON output, and for not affecting group creation. + delete option.children; + }, this); + }, + + // FIXME + // Pass to view using payload? setOption has a payload? + useElOptionsToUpdate: function () { + var els = this._elOptionsToUpdate; + // Clear to avoid render duplicately when zooming. + this._elOptionsToUpdate = null; + return els; + } +}); + +// ----- +// View +// ----- + +extendComponentView({ + + type: 'graphic', + + /** + * @override + */ + init: function (ecModel, api) { + + /** + * @private + * @type {module:zrender/core/util.HashMap} + */ + this._elMap = createHashMap(); + + /** + * @private + * @type {module:echarts/graphic/GraphicModel} + */ + this._lastGraphicModel; + }, + + /** + * @override + */ + render: function (graphicModel, ecModel, api) { + + // Having leveraged between use cases and algorithm complexity, a very + // simple layout mechanism is used: + // The size(width/height) can be determined by itself or its parent (not + // implemented yet), but can not by its children. (Top-down travel) + // The location(x/y) can be determined by the bounding rect of itself + // (can including its descendants or not) and the size of its parent. + // (Bottom-up travel) + + // When `chart.clear()` or `chart.setOption({...}, true)` with the same id, + // view will be reused. + if (graphicModel !== this._lastGraphicModel) { + this._clear(); + } + this._lastGraphicModel = graphicModel; + + this._updateElements(graphicModel, api); + this._relocate(graphicModel, api); + }, + + /** + * Update graphic elements. + * + * @private + * @param {Object} graphicModel graphic model + * @param {module:echarts/ExtensionAPI} api extension API + */ + _updateElements: function (graphicModel, api) { + var elOptionsToUpdate = graphicModel.useElOptionsToUpdate(); + + if (!elOptionsToUpdate) { + return; + } + + var elMap = this._elMap; + var rootGroup = this.group; + + // Top-down tranverse to assign graphic settings to each elements. + each$1(elOptionsToUpdate, function (elOption) { + var $action = elOption.$action; + var id = elOption.id; + var existEl = elMap.get(id); + var parentId = elOption.parentId; + var targetElParent = parentId != null ? elMap.get(parentId) : rootGroup; + + if (elOption.type === 'text') { + var elOptionStyle = elOption.style; + + // In top/bottom mode, textVerticalAlign should not be used, which cause + // inaccurately locating. + if (elOption.hv && elOption.hv[1]) { + elOptionStyle.textVerticalAlign = elOptionStyle.textBaseline = null; + } + + // Compatible with previous setting: both support fill and textFill, + // stroke and textStroke. + !elOptionStyle.hasOwnProperty('textFill') && elOptionStyle.fill && ( + elOptionStyle.textFill = elOptionStyle.fill + ); + !elOptionStyle.hasOwnProperty('textStroke') && elOptionStyle.stroke && ( + elOptionStyle.textStroke = elOptionStyle.stroke + ); + } + + // Remove unnecessary props to avoid potential problems. + var elOptionCleaned = getCleanedElOption(elOption); + + // For simple, do not support parent change, otherwise reorder is needed. + if (__DEV__) { + existEl && assert$1( + targetElParent === existEl.parent, + 'Changing parent is not supported.' + ); + } + + if (!$action || $action === 'merge') { + existEl + ? existEl.attr(elOptionCleaned) + : createEl$1(id, targetElParent, elOptionCleaned, elMap); + } + else if ($action === 'replace') { + removeEl(existEl, elMap); + createEl$1(id, targetElParent, elOptionCleaned, elMap); + } + else if ($action === 'remove') { + removeEl(existEl, elMap); + } + + var el = elMap.get(id); + if (el) { + el.__ecGraphicWidth = elOption.width; + el.__ecGraphicHeight = elOption.height; + } + }); + }, + + /** + * Locate graphic elements. + * + * @private + * @param {Object} graphicModel graphic model + * @param {module:echarts/ExtensionAPI} api extension API + */ + _relocate: function (graphicModel, api) { + var elOptions = graphicModel.option.elements; + var rootGroup = this.group; + var elMap = this._elMap; + + // Bottom-up tranvese all elements (consider ec resize) to locate elements. + for (var i = elOptions.length - 1; i >= 0; i--) { + var elOption = elOptions[i]; + var el = elMap.get(elOption.id); + + if (!el) { + continue; + } + + var parentEl = el.parent; + var containerInfo = parentEl === rootGroup + ? { + width: api.getWidth(), + height: api.getHeight() + } + : { // Like 'position:absolut' in css, default 0. + width: parentEl.__ecGraphicWidth || 0, + height: parentEl.__ecGraphicHeight || 0 + }; + + positionElement( + el, elOption, containerInfo, null, + {hv: elOption.hv, boundingMode: elOption.bounding} + ); + } + }, + + /** + * Clear all elements. + * + * @private + */ + _clear: function () { + var elMap = this._elMap; + elMap.each(function (el) { + removeEl(el, elMap); + }); + this._elMap = createHashMap(); + }, + + /** + * @override + */ + dispose: function () { + this._clear(); + } +}); + +function createEl$1(id, targetElParent, elOption, elMap) { + var graphicType = elOption.type; + + if (__DEV__) { + assert$1(graphicType, 'graphic type MUST be set'); + } + + var Clz = graphic[graphicType.charAt(0).toUpperCase() + graphicType.slice(1)]; + + if (__DEV__) { + assert$1(Clz, 'graphic type can not be found'); + } + + var el = new Clz(elOption); + targetElParent.add(el); + elMap.set(id, el); + el.__ecGraphicId = id; +} + +function removeEl(existEl, elMap) { + var existElParent = existEl && existEl.parent; + if (existElParent) { + existEl.type === 'group' && existEl.traverse(function (el) { + removeEl(el, elMap); + }); + elMap.removeKey(existEl.__ecGraphicId); + existElParent.remove(existEl); + } +} + +// Remove unnecessary props to avoid potential problems. +function getCleanedElOption(elOption) { + elOption = extend({}, elOption); + each$1( + ['id', 'parentId', '$action', 'hv', 'bounding'].concat(LOCATION_PARAMS), + function (name) { + delete elOption[name]; + } + ); + return elOption; +} + +function isSetLoc(obj, props) { + var isSet; + each$1(props, function (prop) { + obj[prop] != null && obj[prop] !== 'auto' && (isSet = true); + }); + return isSet; +} + +function setKeyInfoToNewElOption(resultItem, newElOption) { + var existElOption = resultItem.exist; + + // Set id and type after id assigned. + newElOption.id = resultItem.keyInfo.id; + !newElOption.type && existElOption && (newElOption.type = existElOption.type); + + // Set parent id if not specified + if (newElOption.parentId == null) { + var newElParentOption = newElOption.parentOption; + if (newElParentOption) { + newElOption.parentId = newElParentOption.id; + } + else if (existElOption) { + newElOption.parentId = existElOption.parentId; + } + } + + // Clear + newElOption.parentOption = null; +} + +function mergeNewElOptionToExist(existList, index, newElOption) { + // Update existing options, for `getOption` feature. + var newElOptCopy = extend({}, newElOption); + var existElOption = existList[index]; + + var $action = newElOption.$action || 'merge'; + if ($action === 'merge') { + if (existElOption) { + + if (__DEV__) { + var newType = newElOption.type; + assert$1( + !newType || existElOption.type === newType, + 'Please set $action: "replace" to change `type`' + ); + } + + // We can ensure that newElOptCopy and existElOption are not + // the same object, so `merge` will not change newElOptCopy. + merge(existElOption, newElOptCopy, true); + // Rigid body, use ignoreSize. + mergeLayoutParam(existElOption, newElOptCopy, {ignoreSize: true}); + // Will be used in render. + copyLayoutParams(newElOption, existElOption); + } + else { + existList[index] = newElOptCopy; + } + } + else if ($action === 'replace') { + existList[index] = newElOptCopy; + } + else if ($action === 'remove') { + // null will be cleaned later. + existElOption && (existList[index] = null); + } +} + +function setLayoutInfoToExist(existItem, newElOption) { + if (!existItem) { + return; + } + existItem.hv = newElOption.hv = [ + // Rigid body, dont care `width`. + isSetLoc(newElOption, ['left', 'right']), + // Rigid body, dont care `height`. + isSetLoc(newElOption, ['top', 'bottom']) + ]; + // Give default group size. Otherwise layout error may occur. + if (existItem.type === 'group') { + existItem.width == null && (existItem.width = newElOption.width = 0); + existItem.height == null && (existItem.height = newElOption.height = 0); + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 LegendModel = extendComponentModel({ + + type: 'legend.plain', + + dependencies: ['series'], + + layoutMode: { + type: 'box', + // legend.width/height are maxWidth/maxHeight actually, + // whereas realy width/height is calculated by its content. + // (Setting {left: 10, right: 10} does not make sense). + // So consider the case: + // `setOption({legend: {left: 10});` + // then `setOption({legend: {right: 10});` + // The previous `left` should be cleared by setting `ignoreSize`. + ignoreSize: true + }, + + init: function (option, parentModel, ecModel) { + this.mergeDefaultAndTheme(option, ecModel); + + option.selected = option.selected || {}; + }, + + mergeOption: function (option) { + LegendModel.superCall(this, 'mergeOption', option); + }, + + optionUpdated: function () { + this._updateData(this.ecModel); + + var legendData = this._data; + + // If selectedMode is single, try to select one + if (legendData[0] && this.get('selectedMode') === 'single') { + var hasSelected = false; + // If has any selected in option.selected + for (var i = 0; i < legendData.length; i++) { + var name = legendData[i].get('name'); + if (this.isSelected(name)) { + // Force to unselect others + this.select(name); + hasSelected = true; + break; + } + } + // Try select the first if selectedMode is single + !hasSelected && this.select(legendData[0].get('name')); + } + }, + + _updateData: function (ecModel) { + var potentialData = []; + var availableNames = []; + + ecModel.eachRawSeries(function (seriesModel) { + var seriesName = seriesModel.name; + availableNames.push(seriesName); + var isPotential; + + if (seriesModel.legendDataProvider) { + var data = seriesModel.legendDataProvider(); + var names = data.mapArray(data.getName); + + if (!ecModel.isSeriesFiltered(seriesModel)) { + availableNames = availableNames.concat(names); + } + + if (names.length) { + potentialData = potentialData.concat(names); + } + else { + isPotential = true; + } + } + else { + isPotential = true; + } + + if (isPotential && isNameSpecified(seriesModel)) { + potentialData.push(seriesModel.name); + } + }); + + /** + * @type {Array.} + * @private + */ + this._availableNames = availableNames; + + // If legend.data not specified in option, use availableNames as data, + // which is convinient for user preparing option. + var rawData = this.get('data') || potentialData; + + var legendData = map(rawData, function (dataItem) { + // Can be string or number + if (typeof dataItem === 'string' || typeof dataItem === 'number') { + dataItem = { + name: dataItem + }; + } + return new Model(dataItem, this, this.ecModel); + }, this); + + /** + * @type {Array.} + * @private + */ + this._data = legendData; + }, + + /** + * @return {Array.} + */ + 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; + each$1(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 (!selected.hasOwnProperty(name)) { + selected[name] = true; + } + this[selected[name] ? 'unSelect' : 'select'](name); + }, + + /** + * @param {string} name + */ + isSelected: function (name) { + var selected = this.option.selected; + return !(selected.hasOwnProperty(name) && !selected[name]) + && indexOf(this._availableNames, name) >= 0; + }, + + defaultOption: { + // 一级层叠 + zlevel: 0, + // 二级层叠 + z: 4, + show: true, + + // 布局方式,默认为水平布局,可选为: + // 'horizontal' | 'vertical' + orient: 'horizontal', + + left: 'center', + // right: 'center', + + top: 0, + // bottom: null, + + // 水平对齐 + // 'auto' | 'left' | 'right' + // 默认为 'auto', 根据 x 的位置判断是左对齐还是右对齐 + align: 'auto', + + backgroundColor: 'rgba(0,0,0,0)', + // 图例边框颜色 + borderColor: '#ccc', + borderRadius: 0, + // 图例边框线宽,单位px,默认为0(无边框) + borderWidth: 0, + // 图例内边距,单位px,默认各方向内边距为5, + // 接受数组分别设定上右下左边距,同css + padding: 5, + // 各个item之间的间隔,单位px,默认为10, + // 横向布局时为水平间隔,纵向布局时为纵向间隔 + itemGap: 10, + // 图例图形宽度 + itemWidth: 25, + // 图例图形高度 + itemHeight: 14, + + // 图例关闭时候的颜色 + inactiveColor: '#ccc', + + textStyle: { + // 图例文字颜色 + color: '#333' + }, + // formatter: '', + // 选择模式,默认开启图例开关 + selectedMode: true, + // 配置默认选中状态,可配合LEGEND.SELECTED事件做动态数据载入 + // selected: null, + // 图例内容(详见legend.data,数组中每一项代表一个item + // data: [], + + // Tooltip 相关配置 + tooltip: { + show: false + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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(); + each$1(legendData, function (model) { + var name = model.get('name'); + // Wrap element + if (name === '\n' || name === '') { + return; + } + var isItemSelected = legendModel.isSelected(name); + if (selectedMap.hasOwnProperty(name)) { + // 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 + */ +registerAction( + 'legendToggleSelect', 'legendselectchanged', + curry(legendSelectActionHandler, 'toggleSelected') +); + +/** + * @event legendSelect + * @type {Object} + * @property {string} type 'legendSelect' + * @property {string} name Series name or data item name + */ +registerAction( + 'legendSelect', 'legendselected', + curry(legendSelectActionHandler, 'select') +); + +/** + * @event legendUnSelect + * @type {Object} + * @property {string} type 'legendUnSelect' + * @property {string} name Series name or data item name + */ +registerAction( + 'legendUnSelect', 'legendunselected', + curry(legendSelectActionHandler, 'unSelect') +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * 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} + */ +function layout$3(group, componentModel, api) { + var boxLayoutParams = componentModel.getBoxLayoutParams(); + var padding = componentModel.get('padding'); + var viewportSize = {width: api.getWidth(), height: api.getHeight()}; + + var rect = getLayoutRect( + boxLayoutParams, + viewportSize, + padding + ); + + box( + componentModel.get('orient'), + group, + componentModel.get('itemGap'), + rect.width, + rect.height + ); + + positionElement( + group, + boxLayoutParams, + viewportSize, + padding + ); +} + +function makeBackground(rect, componentModel) { + var padding = normalizeCssArray$1( + componentModel.get('padding') + ); + var style = componentModel.getItemStyle(['color', 'opacity']); + style.fill = componentModel.get('backgroundColor'); + var rect = new Rect({ + shape: { + x: rect.x - padding[3], + y: rect.y - padding[0], + width: rect.width + padding[1] + padding[3], + height: rect.height + padding[0] + padding[2], + r: componentModel.get('borderRadius') + }, + style: style, + silent: true, + z2: -1 + }); + // FIXME + // `subPixelOptimizeRect` may bring some gap between edge of viewpart + // and background rect when setting like `left: 0`, `top: 0`. + // graphic.subPixelOptimizeRect(rect); + + return rect; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 curry$4 = curry; +var each$16 = each$1; +var Group$3 = Group; + +var LegendView = extendComponentView({ + + type: 'legend.plain', + + newlineDisabled: false, + + /** + * @override + */ + init: function () { + + /** + * @private + * @type {module:zrender/container/Group} + */ + this.group.add(this._contentGroup = new Group$3()); + + /** + * @private + * @type {module:zrender/Element} + */ + this._backgroundEl; + }, + + /** + * @protected + */ + getContentGroup: function () { + return this._contentGroup; + }, + + /** + * @override + */ + render: function (legendModel, ecModel, api) { + + this.resetInner(); + + if (!legendModel.get('show', true)) { + return; + } + + var itemAlign = legendModel.get('align'); + if (!itemAlign || itemAlign === 'auto') { + itemAlign = ( + legendModel.get('left') === 'right' + && legendModel.get('orient') === 'vertical' + ) ? 'right' : 'left'; + } + + this.renderInner(itemAlign, legendModel, ecModel, api); + + // Perform layout. + var positionInfo = legendModel.getBoxLayoutParams(); + var viewportSize = {width: api.getWidth(), height: api.getHeight()}; + var padding = legendModel.get('padding'); + + var maxSize = getLayoutRect(positionInfo, viewportSize, padding); + var mainRect = this.layoutInner(legendModel, itemAlign, maxSize); + + // Place mainGroup, based on the calculated `mainRect`. + var layoutRect = getLayoutRect( + defaults({width: mainRect.width, height: mainRect.height}, positionInfo), + viewportSize, + padding + ); + this.group.attr('position', [layoutRect.x - mainRect.x, layoutRect.y - mainRect.y]); + + // Render background after group is layout. + this.group.add( + this._backgroundEl = makeBackground(mainRect, legendModel) + ); + }, + + /** + * @protected + */ + resetInner: function () { + this.getContentGroup().removeAll(); + this._backgroundEl && this.group.remove(this._backgroundEl); + }, + + /** + * @protected + */ + renderInner: function (itemAlign, legendModel, ecModel, api) { + var contentGroup = this.getContentGroup(); + var legendDrawnMap = createHashMap(); + var selectMode = legendModel.get('selectedMode'); + + var excludeSeriesId = []; + ecModel.eachRawSeries(function (seriesModel) { + !seriesModel.get('legendHoverLink') && excludeSeriesId.push(seriesModel.id); + }); + + each$16(legendModel.getData(), function (itemModel, dataIndex) { + var name = itemModel.get('name'); + + // Use empty string or \n as a newline string + if (!this.newlineDisabled && (name === '' || name === '\n')) { + contentGroup.add(new Group$3({ + newline: true + })); + return; + } + + // Representitive series. + var seriesModel = ecModel.getSeriesByName(name)[0]; + + if (legendDrawnMap.get(name)) { + // Have been drawed + return; + } + + // Series legend + if (seriesModel) { + 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( + name, dataIndex, itemModel, legendModel, + legendSymbolType, symbolType, + itemAlign, color, + selectMode + ); + + itemGroup.on('click', curry$4(dispatchSelectAction, name, api)) + .on('mouseover', curry$4(dispatchHighlightAction, seriesModel, null, api, excludeSeriesId)) + .on('mouseout', curry$4(dispatchDownplayAction, seriesModel, null, api, excludeSeriesId)); + + legendDrawnMap.set(name, true); + } + else { + // Data legend of pie, funnel + ecModel.eachRawSeries(function (seriesModel) { + // In case multiple series has same data name + if (legendDrawnMap.get(name)) { + return; + } + + if (seriesModel.legendDataProvider) { + var data = seriesModel.legendDataProvider(); + var idx = data.indexOfName(name); + if (idx < 0) { + return; + } + + var color = data.getItemVisual(idx, 'color'); + + var legendSymbolType = 'roundRect'; + + var itemGroup = this._createItem( + name, dataIndex, itemModel, legendModel, + legendSymbolType, null, + itemAlign, color, + selectMode + ); + + // FIXME: consider different series has items with the same name. + itemGroup.on('click', curry$4(dispatchSelectAction, name, api)) + // FIXME Should not specify the series name + .on('mouseover', curry$4(dispatchHighlightAction, seriesModel, name, api, excludeSeriesId)) + .on('mouseout', curry$4(dispatchDownplayAction, seriesModel, name, api, excludeSeriesId)); + + legendDrawnMap.set(name, true); + } + + }, this); + } + + if (__DEV__) { + if (!legendDrawnMap.get(name)) { + console.warn(name + ' series not exists. Legend data should be same with series name or data name.'); + } + } + }, this); + }, + + _createItem: function ( + name, dataIndex, itemModel, legendModel, + legendSymbolType, symbolType, + itemAlign, color, selectMode + ) { + var itemWidth = legendModel.get('itemWidth'); + var itemHeight = legendModel.get('itemHeight'); + var inactiveColor = legendModel.get('inactiveColor'); + var symbolKeepAspect = legendModel.get('symbolKeepAspect'); + + var isSelected = legendModel.isSelected(name); + var itemGroup = new Group$3(); + + var textStyleModel = itemModel.getModel('textStyle'); + + var itemIcon = itemModel.get('icon'); + + var tooltipModel = itemModel.getModel('tooltip'); + var legendGlobalTooltipModel = tooltipModel.parentModel; + + // Use user given icon first + legendSymbolType = itemIcon || legendSymbolType; + itemGroup.add(createSymbol( + legendSymbolType, + 0, + 0, + itemWidth, + itemHeight, + isSelected ? color : inactiveColor, + // symbolKeepAspect default true for legend + symbolKeepAspect == null ? true : symbolKeepAspect + )); + + // 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(createSymbol( + symbolType, + (itemWidth - size) / 2, + (itemHeight - size) / 2, + size, + size, + isSelected ? color : inactiveColor, + // symbolKeepAspect default true for legend + symbolKeepAspect == null ? true : symbolKeepAspect + )); + } + + var textX = itemAlign === 'left' ? itemWidth + 5 : -5; + var textAlign = itemAlign; + + var formatter = legendModel.get('formatter'); + var content = name; + if (typeof formatter === 'string' && formatter) { + content = formatter.replace('{name}', name != null ? name : ''); + } + else if (typeof formatter === 'function') { + content = formatter(name); + } + + itemGroup.add(new Text({ + style: setTextStyle({}, textStyleModel, { + text: content, + x: textX, + y: itemHeight / 2, + textFill: isSelected ? textStyleModel.getTextColor() : inactiveColor, + textAlign: textAlign, + textVerticalAlign: 'middle' + }) + })); + + // Add a invisible rect to increase the area of mouse hover + var hitRect = new Rect({ + shape: itemGroup.getBoundingRect(), + invisible: true, + tooltip: tooltipModel.get('show') ? extend({ + content: name, + // Defaul formatter + formatter: legendGlobalTooltipModel.get('formatter', true) || function () { + return name; + }, + formatterParams: { + componentType: 'legend', + legendIndex: legendModel.componentIndex, + name: name, + $vars: ['name'] + } + }, tooltipModel.option) : null + }); + itemGroup.add(hitRect); + + itemGroup.eachChild(function (child) { + child.silent = true; + }); + + hitRect.silent = !selectMode; + + this.getContentGroup().add(itemGroup); + + setHoverStyle(itemGroup); + + itemGroup.__legendDataIndex = dataIndex; + + return itemGroup; + }, + + /** + * @protected + */ + layoutInner: function (legendModel, itemAlign, maxSize) { + var contentGroup = this.getContentGroup(); + + // Place items in contentGroup. + box( + legendModel.get('orient'), + contentGroup, + legendModel.get('itemGap'), + maxSize.width, + maxSize.height + ); + + var contentRect = contentGroup.getBoundingRect(); + contentGroup.attr('position', [-contentRect.x, -contentRect.y]); + + return this.group.getBoundingRect(); + } + +}); + +function dispatchSelectAction(name, api) { + api.dispatchAction({ + type: 'legendToggleSelect', + name: name + }); +} + +function dispatchHighlightAction(seriesModel, dataName, api, excludeSeriesId) { + // If element hover will move to a hoverLayer. + var el = api.getZr().storage.getDisplayList()[0]; + if (!(el && el.useHoverLayer)) { + api.dispatchAction({ + type: 'highlight', + seriesName: seriesModel.name, + name: dataName, + excludeSeriesId: excludeSeriesId + }); + } +} + +function dispatchDownplayAction(seriesModel, dataName, api, excludeSeriesId) { + // If element hover will move to a hoverLayer. + var el = api.getZr().storage.getDisplayList()[0]; + if (!(el && el.useHoverLayer)) { + api.dispatchAction({ + type: 'downplay', + seriesName: seriesModel.name, + name: dataName, + excludeSeriesId: excludeSeriesId + }); + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 legendFilter = 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; + }); + } + +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + + +// Do not contain scrollable legend, for sake of file size. + +// Series Filter +registerProcessor(legendFilter); + +ComponentModel.registerSubTypeDefaulter('legend', function () { + // Default 'plain' when no type specified. + return 'plain'; +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 ScrollableLegendModel = LegendModel.extend({ + + type: 'legend.scroll', + + /** + * @param {number} scrollDataIndex + */ + setScrollDataIndex: function (scrollDataIndex) { + this.option.scrollDataIndex = scrollDataIndex; + }, + + defaultOption: { + scrollDataIndex: 0, + pageButtonItemGap: 5, + pageButtonGap: null, + pageButtonPosition: 'end', // 'start' or 'end' + pageFormatter: '{current}/{total}', // If null/undefined, do not show page. + pageIcons: { + horizontal: ['M0,0L12,-10L12,10z', 'M0,0L-12,-10L-12,10z'], + vertical: ['M0,0L20,0L10,-20z', 'M0,0L20,0L10,20z'] + }, + pageIconColor: '#2f4554', + pageIconInactiveColor: '#aaa', + pageIconSize: 15, // Can be [10, 3], which represents [width, height] + pageTextStyle: { + color: '#333' + }, + + animationDurationUpdate: 800 + }, + + /** + * @override + */ + init: function (option, parentModel, ecModel, extraOpt) { + var inputPositionParams = getLayoutParams(option); + + ScrollableLegendModel.superCall(this, 'init', option, parentModel, ecModel, extraOpt); + + mergeAndNormalizeLayoutParams(this, option, inputPositionParams); + }, + + /** + * @override + */ + mergeOption: function (option, extraOpt) { + ScrollableLegendModel.superCall(this, 'mergeOption', option, extraOpt); + + mergeAndNormalizeLayoutParams(this, this.option, option); + }, + + getOrient: function () { + return this.get('orient') === 'vertical' + ? {index: 1, name: 'vertical'} + : {index: 0, name: 'horizontal'}; + } + +}); + +// Do not `ignoreSize` to enable setting {left: 10, right: 10}. +function mergeAndNormalizeLayoutParams(legendModel, target, raw) { + var orient = legendModel.getOrient(); + var ignoreSize = [1, 1]; + ignoreSize[orient.index] = 0; + mergeLayoutParam(target, raw, { + type: 'box', ignoreSize: ignoreSize + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Separate legend and scrollable legend to reduce package size. + */ + +var Group$4 = Group; + +var WH$1 = ['width', 'height']; +var XY$1 = ['x', 'y']; + +var ScrollableLegendView = LegendView.extend({ + + type: 'legend.scroll', + + newlineDisabled: true, + + init: function () { + + ScrollableLegendView.superCall(this, 'init'); + + /** + * @private + * @type {number} For `scroll`. + */ + this._currentIndex = 0; + + /** + * @private + * @type {module:zrender/container/Group} + */ + this.group.add(this._containerGroup = new Group$4()); + this._containerGroup.add(this.getContentGroup()); + + /** + * @private + * @type {module:zrender/container/Group} + */ + this.group.add(this._controllerGroup = new Group$4()); + + /** + * + * @private + */ + this._showController; + }, + + /** + * @override + */ + resetInner: function () { + ScrollableLegendView.superCall(this, 'resetInner'); + + this._controllerGroup.removeAll(); + this._containerGroup.removeClipPath(); + this._containerGroup.__rectSize = null; + }, + + /** + * @override + */ + renderInner: function (itemAlign, legendModel, ecModel, api) { + var me = this; + + // Render content items. + ScrollableLegendView.superCall(this, 'renderInner', itemAlign, legendModel, ecModel, api); + + var controllerGroup = this._controllerGroup; + + var pageIconSize = legendModel.get('pageIconSize', true); + if (!isArray(pageIconSize)) { + pageIconSize = [pageIconSize, pageIconSize]; + } + + createPageButton('pagePrev', 0); + + var pageTextStyleModel = legendModel.getModel('pageTextStyle'); + controllerGroup.add(new Text({ + name: 'pageText', + style: { + textFill: pageTextStyleModel.getTextColor(), + font: pageTextStyleModel.getFont(), + textVerticalAlign: 'middle', + textAlign: 'center' + }, + silent: true + })); + + createPageButton('pageNext', 1); + + function createPageButton(name, iconIdx) { + var pageDataIndexName = name + 'DataIndex'; + var icon = createIcon( + legendModel.get('pageIcons', true)[legendModel.getOrient().name][iconIdx], + { + // Buttons will be created in each render, so we do not need + // to worry about avoiding using legendModel kept in scope. + onclick: bind( + me._pageGo, me, pageDataIndexName, legendModel, api + ) + }, + { + x: -pageIconSize[0] / 2, + y: -pageIconSize[1] / 2, + width: pageIconSize[0], + height: pageIconSize[1] + } + ); + icon.name = name; + controllerGroup.add(icon); + } + }, + + /** + * @override + */ + layoutInner: function (legendModel, itemAlign, maxSize) { + var contentGroup = this.getContentGroup(); + var containerGroup = this._containerGroup; + var controllerGroup = this._controllerGroup; + + var orientIdx = legendModel.getOrient().index; + var wh = WH$1[orientIdx]; + var hw = WH$1[1 - orientIdx]; + var yx = XY$1[1 - orientIdx]; + + // Place items in contentGroup. + box( + legendModel.get('orient'), + contentGroup, + legendModel.get('itemGap'), + !orientIdx ? null : maxSize.width, + orientIdx ? null : maxSize.height + ); + + box( + // Buttons in controller are layout always horizontally. + 'horizontal', + controllerGroup, + legendModel.get('pageButtonItemGap', true) + ); + + var contentRect = contentGroup.getBoundingRect(); + var controllerRect = controllerGroup.getBoundingRect(); + var showController = this._showController = contentRect[wh] > maxSize[wh]; + + var contentPos = [-contentRect.x, -contentRect.y]; + // Remain contentPos when scroll animation perfroming. + contentPos[orientIdx] = contentGroup.position[orientIdx]; + + // Layout container group based on 0. + var containerPos = [0, 0]; + var controllerPos = [-controllerRect.x, -controllerRect.y]; + var pageButtonGap = retrieve2( + legendModel.get('pageButtonGap', true), legendModel.get('itemGap', true) + ); + + // Place containerGroup and controllerGroup and contentGroup. + if (showController) { + var pageButtonPosition = legendModel.get('pageButtonPosition', true); + // controller is on the right / bottom. + if (pageButtonPosition === 'end') { + controllerPos[orientIdx] += maxSize[wh] - controllerRect[wh]; + } + // controller is on the left / top. + else { + containerPos[orientIdx] += controllerRect[wh] + pageButtonGap; + } + } + + // Always align controller to content as 'middle'. + controllerPos[1 - orientIdx] += contentRect[hw] / 2 - controllerRect[hw] / 2; + + contentGroup.attr('position', contentPos); + containerGroup.attr('position', containerPos); + controllerGroup.attr('position', controllerPos); + + // Calculate `mainRect` and set `clipPath`. + // mainRect should not be calculated by `this.group.getBoundingRect()` + // for sake of the overflow. + var mainRect = this.group.getBoundingRect(); + var mainRect = {x: 0, y: 0}; + // Consider content may be overflow (should be clipped). + mainRect[wh] = showController ? maxSize[wh] : contentRect[wh]; + mainRect[hw] = Math.max(contentRect[hw], controllerRect[hw]); + // `containerRect[yx] + containerPos[1 - orientIdx]` is 0. + mainRect[yx] = Math.min(0, controllerRect[yx] + controllerPos[1 - orientIdx]); + + containerGroup.__rectSize = maxSize[wh]; + if (showController) { + var clipShape = {x: 0, y: 0}; + clipShape[wh] = Math.max(maxSize[wh] - controllerRect[wh] - pageButtonGap, 0); + clipShape[hw] = mainRect[hw]; + containerGroup.setClipPath(new Rect({shape: clipShape})); + // Consider content may be larger than container, container rect + // can not be obtained from `containerGroup.getBoundingRect()`. + containerGroup.__rectSize = clipShape[wh]; + } + else { + // Do not remove or ignore controller. Keep them set as place holders. + controllerGroup.eachChild(function (child) { + child.attr({invisible: true, silent: true}); + }); + } + + // Content translate animation. + var pageInfo = this._getPageInfo(legendModel); + pageInfo.pageIndex != null && updateProps( + contentGroup, + {position: pageInfo.contentPosition}, + // When switch from "show controller" to "not show controller", view should be + // updated immediately without animation, otherwise causes weird efffect. + showController ? legendModel : false + ); + + this._updatePageInfoView(legendModel, pageInfo); + + return mainRect; + }, + + _pageGo: function (to, legendModel, api) { + var scrollDataIndex = this._getPageInfo(legendModel)[to]; + + scrollDataIndex != null && api.dispatchAction({ + type: 'legendScroll', + scrollDataIndex: scrollDataIndex, + legendId: legendModel.id + }); + }, + + _updatePageInfoView: function (legendModel, pageInfo) { + var controllerGroup = this._controllerGroup; + + each$1(['pagePrev', 'pageNext'], function (name) { + var canJump = pageInfo[name + 'DataIndex'] != null; + var icon = controllerGroup.childOfName(name); + if (icon) { + icon.setStyle( + 'fill', + canJump + ? legendModel.get('pageIconColor', true) + : legendModel.get('pageIconInactiveColor', true) + ); + icon.cursor = canJump ? 'pointer' : 'default'; + } + }); + + var pageText = controllerGroup.childOfName('pageText'); + var pageFormatter = legendModel.get('pageFormatter'); + var pageIndex = pageInfo.pageIndex; + var current = pageIndex != null ? pageIndex + 1 : 0; + var total = pageInfo.pageCount; + + pageText && pageFormatter && pageText.setStyle( + 'text', + isString(pageFormatter) + ? pageFormatter.replace('{current}', current).replace('{total}', total) + : pageFormatter({current: current, total: total}) + ); + }, + + /** + * @param {module:echarts/model/Model} legendModel + * @return {Object} { + * contentPosition: Array., null when data item not found. + * pageIndex: number, null when data item not found. + * pageCount: number, always be a number, can be 0. + * pagePrevDataIndex: number, null when no next page. + * pageNextDataIndex: number, null when no previous page. + * } + */ + _getPageInfo: function (legendModel) { + // Align left or top by the current dataIndex. + var currDataIndex = legendModel.get('scrollDataIndex', true); + var contentGroup = this.getContentGroup(); + var contentRect = contentGroup.getBoundingRect(); + var containerRectSize = this._containerGroup.__rectSize; + + var orientIdx = legendModel.getOrient().index; + var wh = WH$1[orientIdx]; + var hw = WH$1[1 - orientIdx]; + var xy = XY$1[orientIdx]; + var contentPos = contentGroup.position.slice(); + + var pageIndex; + var pagePrevDataIndex; + var pageNextDataIndex; + + var targetItemGroup; + if (this._showController) { + contentGroup.eachChild(function (child) { + if (child.__legendDataIndex === currDataIndex) { + targetItemGroup = child; + } + }); + } + else { + targetItemGroup = contentGroup.childAt(0); + } + + var pageCount = containerRectSize ? Math.ceil(contentRect[wh] / containerRectSize) : 0; + + if (targetItemGroup) { + var itemRect = targetItemGroup.getBoundingRect(); + var itemLoc = targetItemGroup.position[orientIdx] + itemRect[xy]; + contentPos[orientIdx] = -itemLoc - contentRect[xy]; + pageIndex = Math.floor( + pageCount * (itemLoc + itemRect[xy] + containerRectSize / 2) / contentRect[wh] + ); + pageIndex = (contentRect[wh] && pageCount) + ? Math.max(0, Math.min(pageCount - 1, pageIndex)) + : -1; + + var winRect = {x: 0, y: 0}; + winRect[wh] = containerRectSize; + winRect[hw] = contentRect[hw]; + winRect[xy] = -contentPos[orientIdx] - contentRect[xy]; + + var startIdx; + var children = contentGroup.children(); + + contentGroup.eachChild(function (child, index) { + var itemRect = getItemRect(child); + + if (itemRect.intersect(winRect)) { + startIdx == null && (startIdx = index); + // It is user-friendly that the last item shown in the + // current window is shown at the begining of next window. + pageNextDataIndex = child.__legendDataIndex; + } + + // If the last item is shown entirely, no next page. + if (index === children.length - 1 + && itemRect[xy] + itemRect[wh] <= winRect[xy] + winRect[wh] + ) { + pageNextDataIndex = null; + } + }); + + // Always align based on the left/top most item, so the left/top most + // item in the previous window is needed to be found here. + if (startIdx != null) { + var startItem = children[startIdx]; + var startRect = getItemRect(startItem); + winRect[xy] = startRect[xy] + startRect[wh] - winRect[wh]; + + // If the first item is shown entirely, no previous page. + if (startIdx <= 0 && startRect[xy] >= winRect[xy]) { + pagePrevDataIndex = null; + } + else { + while (startIdx > 0 && getItemRect(children[startIdx - 1]).intersect(winRect)) { + startIdx--; + } + pagePrevDataIndex = children[startIdx].__legendDataIndex; + } + } + } + + return { + contentPosition: contentPos, + pageIndex: pageIndex, + pageCount: pageCount, + pagePrevDataIndex: pagePrevDataIndex, + pageNextDataIndex: pageNextDataIndex + }; + + function getItemRect(el) { + var itemRect = el.getBoundingRect().clone(); + itemRect[xy] += el.position[orientIdx]; + return itemRect; + } + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @event legendScroll + * @type {Object} + * @property {string} type 'legendScroll' + * @property {string} scrollDataIndex + */ +registerAction( + 'legendScroll', 'legendscroll', + function (payload, ecModel) { + var scrollDataIndex = payload.scrollDataIndex; + + scrollDataIndex != null && ecModel.eachComponent( + {mainType: 'legend', subType: 'scroll', query: payload}, + function (legendModel) { + legendModel.setScrollDataIndex(scrollDataIndex); + } + ); + } +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Legend component entry file8 + */ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +extendComponentModel({ + + type: 'tooltip', + + dependencies: ['axisPointer'], + + defaultOption: { + zlevel: 0, + + z: 8, + + show: true, + + // tooltip主体内容 + showContent: true, + + // 'trigger' only works on coordinate system. + // 'item' | 'axis' | 'none' + trigger: 'item', + + // 'click' | 'mousemove' | 'none' + triggerOn: 'mousemove|click', + + alwaysShowContent: false, + + displayMode: 'single', // 'single' | 'multipleByCoordSys' + + renderMode: 'auto', // 'auto' | 'html' | 'richText' + // 'auto': use html by default, and use non-html if `document` is not defined + // 'html': use html for tooltip + // 'richText': use canvas, svg, and etc. for tooltip + + // 位置 {Array} | {Function} + // position: null + // Consider triggered from axisPointer handle, verticalAlign should be 'middle' + // align: null, + // verticalAlign: null, + + // 是否约束 content 在 viewRect 中。默认 false 是为了兼容以前版本。 + confine: false, + + // 内容格式器:{string}(Template) ¦ {Function} + // formatter: null + + showDelay: 0, + + // 隐藏延迟,单位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',会选择类型为 category 的轴,对于双数值轴,笛卡尔坐标系会默认选择 x 轴 + // 极坐标系会默认选择 angle 轴 + axis: 'auto', + + animation: 'auto', + animationDurationUpdate: 200, + animationEasingUpdate: 'exponentialOut', + + crossStyle: { + color: '#999', + width: 1, + type: 'dashed', + + // TODO formatter + textStyle: {} + } + + // lineStyle and shadowStyle should not be specified here, + // otherwise it will always override those styles on option.axisPointer. + }, + textStyle: { + color: '#fff', + fontSize: 14 + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$18 = each$1; +var toCamelCase$1 = 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 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$18(['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) { + + var cssText = []; + + var transitionDuration = tooltipModel.get('transitionDuration'); + var backgroundColor = tooltipModel.get('backgroundColor'); + var textStyleModel = tooltipModel.getModel('textStyle'); + var padding = tooltipModel.get('padding'); + + // Animation transition. Do not animate when transitionDuration is 0. + transitionDuration && + cssText.push(assembleTransition(transitionDuration)); + + if (backgroundColor) { + if (env$1.canvasSupported) { + cssText.push('background-Color:' + backgroundColor); + } + else { + // for ie + cssText.push( + 'background-Color:#' + toHex(backgroundColor) + ); + cssText.push('filter:alpha(opacity=70)'); + } + } + + // Border style + each$18(['width', 'color', 'radius'], function (name) { + var borderName = 'border-' + name; + var camelCase = toCamelCase$1(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:' + normalizeCssArray$1(padding).join('px ') + 'px'); + } + + return cssText.join(';') + ';'; +} + +/** + * @alias module:echarts/component/tooltip/TooltipContent + * @constructor + */ +function TooltipContent(container, api) { + if (env$1.wxa) { + return null; + } + + var el = document.createElement('div'); + var zr = this._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) { + e = e || window.event; + if (!self._enterable) { + // Try trigger zrender event to avoid mouse + // in and out shape too frequently + var handler = zr.handler; + normalizeEvent(container, e, true); + handler.dispatch('mousemove', e); + } + }; + el.onmouseleave = function () { + if (self._enterable) { + if (self._show) { + self.hideLater(self._hideDelay); + } + } + self._inContent = false; + }; +} + +TooltipContent.prototype = { + + constructor: TooltipContent, + + /** + * @private + * @type {boolean} + */ + _enterable: true, + + /** + * Update when tooltip is rendered + */ + update: function () { + // FIXME + // Move this logic to ec main? + 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); + var el = this.el; + + 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') || ''); + + el.style.display = el.innerHTML ? 'block' : 'none'; + + // If mouse occsionally move over the tooltip, a mouseout event will be + // triggered by canvas, and cuase some unexpectable result like dragging + // stop, "unfocusAdjacency". Here `pointer-events: none` is used to solve + // it. Although it is not suppored by IE8~IE10, fortunately it is a rare + // scenario. + el.style.pointerEvents = this._enterable ? 'auto' : 'none'; + + this._show = true; + }, + + setContent: function (content) { + this.el.innerHTML = content == null ? '' : content; + }, + + setEnterable: function (enterable) { + this._enterable = enterable; + }, + + getSize: function () { + var el = this.el; + return [el.clientWidth, el.clientHeight]; + }, + + moveTo: function (x, y) { + // xy should be based on canvas root. But tooltipContent is + // the sibling of canvas root. So padding of ec container + // should be considered here. + var zr = this._zr; + var viewportRootOffset; + if (zr && zr.painter && (viewportRootOffset = zr.painter.getViewportRootOffset())) { + x += viewportRootOffset.offsetLeft; + y += viewportRootOffset.offsetTop; + } + + 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; + }, + + 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(bind(this.hide, this), time); + } + else { + this.hide(); + } + } + }, + + isShow: function () { + return this._show; + }, + + getOuterSize: function () { + var width = this.el.clientWidth; + var height = this.el.clientHeight; + + // Consider browser compatibility. + // IE8 does not support getComputedStyle. + if (document.defaultView && document.defaultView.getComputedStyle) { + var stl = document.defaultView.getComputedStyle(this.el); + if (stl) { + width += parseInt(stl.paddingLeft, 10) + parseInt(stl.paddingRight, 10) + + parseInt(stl.borderLeftWidth, 10) + parseInt(stl.borderRightWidth, 10); + height += parseInt(stl.paddingTop, 10) + parseInt(stl.paddingBottom, 10) + + parseInt(stl.borderTopWidth, 10) + parseInt(stl.borderBottomWidth, 10); + } + } + + return {width: width, height: height}; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @alias module:echarts/component/tooltip/TooltipRichContent + * @constructor + */ +function TooltipRichContent(api) { + // this.el = new Group(); + + var zr = this._zr = api.getZr(); + // zr.add(this.el); + + this._show = false; + + /** + * @private + */ + this._hideTimeout; +} + +TooltipRichContent.prototype = { + + constructor: TooltipRichContent, + + /** + * @private + * @type {boolean} + */ + _enterable: true, + + /** + * Update when tooltip is rendered + */ + update: function () { + // noop + }, + + show: function (tooltipModel) { + if (this._hideTimeout) { + clearTimeout(this._hideTimeout); + } + + this.el.attr('show', true); + this._show = true; + }, + + /** + * Set tooltip content + * + * @param {string} content rich text string of content + * @param {Object} markerRich rich text style + * @param {Object} tooltipModel tooltip model + */ + setContent: function (content, markerRich, tooltipModel) { + if (this.el) { + this._zr.remove(this.el); + } + + var markers = {}; + var text = content; + var prefix = '{marker'; + var suffix = '|}'; + var startId = text.indexOf(prefix); + while (startId >= 0) { + var endId = text.indexOf(suffix); + var name = text.substr(startId + prefix.length, endId - startId - prefix.length); + markers['marker' + name] = { + textWidth: 12, + textHeight: 12, + textBorderRadius: 6, + textBackgroundColor: markerRich[name] + }; + + text = text.substr(endId + 1); + startId = text.indexOf('{marker'); + } + + this.el = new Text({ + style: { + rich: markers, + text: content, + textLineHeight: 20, + textBackgroundColor: tooltipModel.get('backgroundColor'), + textBorderRadius: tooltipModel.get('borderRadius'), + textFill: tooltipModel.get('textStyle.color'), + textPadding: tooltipModel.get('padding') + }, + z: tooltipModel.get('z') + }); + this._zr.add(this.el); + + var self = this; + this.el.on('mouseover', function () { + // clear the timeout in hideLater and keep showing tooltip + if (self._enterable) { + clearTimeout(self._hideTimeout); + self._show = true; + } + self._inContent = true; + }); + this.el.on('mouseout', function () { + if (self._enterable) { + if (self._show) { + self.hideLater(self._hideDelay); + } + } + self._inContent = false; + }); + }, + + setEnterable: function (enterable) { + this._enterable = enterable; + }, + + getSize: function () { + var bounding = this.el.getBoundingRect(); + return [bounding.width, bounding.height]; + }, + + moveTo: function (x, y) { + if (this.el) { + this.el.attr('position', [x, y]); + } + }, + + hide: function () { + this.el.hide(); + this._show = false; + }, + + 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(bind(this.hide, this), time); + } + else { + this.hide(); + } + } + }, + + isShow: function () { + return this._show; + }, + + getOuterSize: function () { + return this.getSize(); + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 bind$3 = bind; +var each$17 = each$1; +var parsePercent$2 = parsePercent$1; + +var proxyRect = new Rect({ + shape: {x: -1, y: -1, width: 2, height: 2} +}); + +extendComponentView({ + + type: 'tooltip', + + init: function (ecModel, api) { + if (env$1.node) { + return; + } + + var tooltipModel = ecModel.getComponent('tooltip'); + var renderMode = tooltipModel.get('renderMode'); + this._renderMode = 'html'; + if (renderMode === 'auto') { + // using html when `document` exists, use richText otherwise + this._renderMode = env$1.domSupported ? 'html' : 'richText'; + } + else { + this._renderMode = renderMode || this._renderMode; + } + + var tooltipContent; + if (this._renderMode === 'html') { + tooltipContent = new TooltipContent(api.getDom(), api); + this._newLine = '
'; + } + else { + tooltipContent = new TooltipRichContent(api); + this._newLine = '\n'; + } + + this._tooltipContent = tooltipContent; + }, + + render: function (tooltipModel, ecModel, api) { + if (env$1.node || env$1.wxa) { + return; + } + + // Reset + this.group.removeAll(); + + /** + * @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; + + /** + * Should be cleaned when render. + * @private + * @type {Array.>} + */ + this._lastDataByCoordSys = null; + + /** + * @private + * @type {boolean} + */ + this._alwaysShowContent = tooltipModel.get('alwaysShowContent'); + + var tooltipContent = this._tooltipContent; + tooltipContent.update(); + tooltipContent.setEnterable(tooltipModel.get('enterable')); + + this._initGlobalListener(); + + this._keepShow(); + }, + + _initGlobalListener: function () { + var tooltipModel = this._tooltipModel; + var triggerOn = tooltipModel.get('triggerOn'); + + register( + 'itemTooltip', + this._api, + bind$3(function (currTrigger, e, dispatchAction) { + // If 'none', it is not controlled by mouse totally. + if (triggerOn !== 'none') { + if (triggerOn.indexOf(currTrigger) >= 0) { + this._tryShow(e, dispatchAction); + } + else if (currTrigger === 'leave') { + this._hide(dispatchAction); + } + } + }, this) + ); + }, + + _keepShow: function () { + var tooltipModel = this._tooltipModel; + var ecModel = this._ecModel; + var api = this._api; + + // Try to keep the tooltip show when refreshing + if (this._lastX != null + && this._lastY != null + // When user is willing to control tooltip totally using API, + // self.manuallyShowTip({x, y}) might cause tooltip hide, + // which is not expected. + && tooltipModel.get('triggerOn') !== 'none' + ) { + 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(tooltipModel, ecModel, api, { + x: self._lastX, + y: self._lastY + }); + }); + } + }, + + /** + * Show tip manually by + * dispatchAction({ + * type: 'showTip', + * x: 10, + * y: 10 + * }); + * Or + * dispatchAction({ + * type: 'showTip', + * seriesIndex: 0, + * dataIndex or dataIndexInside or name + * }); + * + * TODO Batch + */ + manuallyShowTip: function (tooltipModel, ecModel, api, payload) { + if (payload.from === this.uid || env$1.node) { + return; + } + + var dispatchAction = makeDispatchAction$1(payload, api); + + // Reset ticket + this._ticket = ''; + + // When triggered from axisPointer. + var dataByCoordSys = payload.dataByCoordSys; + + if (payload.tooltip && payload.x != null && payload.y != null) { + var el = proxyRect; + el.position = [payload.x, payload.y]; + el.update(); + el.tooltip = payload.tooltip; + // Manually show tooltip while view is not using zrender elements. + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + target: el + }, dispatchAction); + } + else if (dataByCoordSys) { + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + position: payload.position, + event: {}, + dataByCoordSys: payload.dataByCoordSys, + tooltipOption: payload.tooltipOption + }, dispatchAction); + } + else if (payload.seriesIndex != null) { + + if (this._manuallyAxisShowTip(tooltipModel, ecModel, api, payload)) { + return; + } + + var pointInfo = findPointFromSeries(payload, ecModel); + var cx = pointInfo.point[0]; + var cy = pointInfo.point[1]; + if (cx != null && cy != null) { + this._tryShow({ + offsetX: cx, + offsetY: cy, + position: payload.position, + target: pointInfo.el, + event: {} + }, dispatchAction); + } + } + else if (payload.x != null && payload.y != null) { + // FIXME + // should wrap dispatchAction like `axisPointer/globalListener` ? + api.dispatchAction({ + type: 'updateAxisPointer', + x: payload.x, + y: payload.y + }); + + this._tryShow({ + offsetX: payload.x, + offsetY: payload.y, + position: payload.position, + target: api.getZr().findHover(payload.x, payload.y).target, + event: {} + }, dispatchAction); + } + }, + + manuallyHideTip: function (tooltipModel, ecModel, api, payload) { + var tooltipContent = this._tooltipContent; + + if (!this._alwaysShowContent && this._tooltipModel) { + tooltipContent.hideLater(this._tooltipModel.get('hideDelay')); + } + + this._lastX = this._lastY = null; + + if (payload.from !== this.uid) { + this._hide(makeDispatchAction$1(payload, api)); + } + }, + + // Be compatible with previous design, that is, when tooltip.type is 'axis' and + // dispatchAction 'showTip' with seriesIndex and dataIndex will trigger axis pointer + // and tooltip. + _manuallyAxisShowTip: function (tooltipModel, ecModel, api, payload) { + var seriesIndex = payload.seriesIndex; + var dataIndex = payload.dataIndex; + var coordSysAxesInfo = ecModel.getComponent('axisPointer').coordSysAxesInfo; + + if (seriesIndex == null || dataIndex == null || coordSysAxesInfo == null) { + return; + } + + var seriesModel = ecModel.getSeriesByIndex(seriesIndex); + if (!seriesModel) { + return; + } + + var data = seriesModel.getData(); + var tooltipModel = buildTooltipModel([ + data.getItemModel(dataIndex), + seriesModel, + (seriesModel.coordinateSystem || {}).model, + tooltipModel + ]); + + if (tooltipModel.get('trigger') !== 'axis') { + return; + } + + api.dispatchAction({ + type: 'updateAxisPointer', + seriesIndex: seriesIndex, + dataIndex: dataIndex, + position: payload.position + }); + + return true; + }, + + _tryShow: function (e, dispatchAction) { + var el = e.target; + var tooltipModel = this._tooltipModel; + + 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; + + var dataByCoordSys = e.dataByCoordSys; + if (dataByCoordSys && dataByCoordSys.length) { + this._showAxisTooltip(dataByCoordSys, e); + } + // Always show item tooltip if mouse is on the element with dataIndex + else if (el && el.dataIndex != null) { + this._lastDataByCoordSys = null; + this._showSeriesItemTooltip(e, el, dispatchAction); + } + // Tooltip provided directly. Like legend. + else if (el && el.tooltip) { + this._lastDataByCoordSys = null; + this._showComponentItemTooltip(e, el, dispatchAction); + } + else { + this._lastDataByCoordSys = null; + this._hide(dispatchAction); + } + }, + + _showOrMove: function (tooltipModel, cb) { + // showDelay is used in this case: tooltip.enterable is set + // as true. User intent to move mouse into tooltip and click + // something. `showDelay` makes it easyer to enter the content + // but tooltip do not move immediately. + var delay = tooltipModel.get('showDelay'); + cb = bind(cb, this); + clearTimeout(this._showTimout); + delay > 0 + ? (this._showTimout = setTimeout(cb, delay)) + : cb(); + }, + + _showAxisTooltip: function (dataByCoordSys, e) { + var ecModel = this._ecModel; + var globalTooltipModel = this._tooltipModel; + var point = [e.offsetX, e.offsetY]; + var singleDefaultHTML = []; + var singleParamsList = []; + var singleTooltipModel = buildTooltipModel([ + e.tooltipOption, + globalTooltipModel + ]); + + var renderMode = this._renderMode; + var newLine = this._newLine; + + var markers = {}; + + each$17(dataByCoordSys, function (itemCoordSys) { + // var coordParamList = []; + // var coordDefaultHTML = []; + // var coordTooltipModel = buildTooltipModel([ + // e.tooltipOption, + // itemCoordSys.tooltipOption, + // ecModel.getComponent(itemCoordSys.coordSysMainType, itemCoordSys.coordSysIndex), + // globalTooltipModel + // ]); + // var displayMode = coordTooltipModel.get('displayMode'); + // var paramsList = displayMode === 'single' ? singleParamsList : []; + + each$17(itemCoordSys.dataByAxis, function (item) { + var axisModel = ecModel.getComponent(item.axisDim + 'Axis', item.axisIndex); + var axisValue = item.value; + var seriesDefaultHTML = []; + + if (!axisModel || axisValue == null) { + return; + } + + var valueLabel = getValueLabel( + axisValue, axisModel.axis, ecModel, + item.seriesDataIndices, + item.valueLabelOpt + ); + + each$1(item.seriesDataIndices, function (idxItem) { + var series = ecModel.getSeriesByIndex(idxItem.seriesIndex); + var dataIndex = idxItem.dataIndexInside; + var dataParams = series && series.getDataParams(dataIndex); + dataParams.axisDim = item.axisDim; + dataParams.axisIndex = item.axisIndex; + dataParams.axisType = item.axisType; + dataParams.axisId = item.axisId; + dataParams.axisValue = getAxisRawValue(axisModel.axis, axisValue); + dataParams.axisValueLabel = valueLabel; + + if (dataParams) { + singleParamsList.push(dataParams); + var seriesTooltip = series.formatTooltip(dataIndex, true, null, renderMode); + + var html; + if (isObject$1(seriesTooltip)) { + html = seriesTooltip.html; + var newMarkers = seriesTooltip.markers; + merge(markers, newMarkers); + } + else { + html = seriesTooltip; + } + seriesDefaultHTML.push(html); + } + }); + + // 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 = valueLabel; + if (renderMode !== 'html') { + singleDefaultHTML.push(seriesDefaultHTML.join(newLine)); + } + else { + singleDefaultHTML.push( + (firstLine ? encodeHTML(firstLine) + newLine : '') + + seriesDefaultHTML.join(newLine) + ); + } + }); + }, this); + + // In most case, the second axis is shown upper than the first one. + singleDefaultHTML.reverse(); + singleDefaultHTML = singleDefaultHTML.join(this._newLine + this._newLine); + + var positionExpr = e.position; + this._showOrMove(singleTooltipModel, function () { + if (this._updateContentNotChangedOnAxis(dataByCoordSys)) { + this._updatePosition( + singleTooltipModel, + positionExpr, + point[0], point[1], + this._tooltipContent, + singleParamsList + ); + } + else { + this._showTooltipContent( + singleTooltipModel, singleDefaultHTML, singleParamsList, Math.random(), + point[0], point[1], positionExpr, undefined, markers + ); + } + }); + + // Do not trigger events here, because this branch only be entered + // from dispatchAction. + }, + + _showSeriesItemTooltip: function (e, el, dispatchAction) { + var ecModel = this._ecModel; + // 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 seriesIndex = el.seriesIndex; + var seriesModel = ecModel.getSeriesByIndex(seriesIndex); + + // For example, graph link. + var dataModel = el.dataModel || seriesModel; + var dataIndex = el.dataIndex; + var dataType = el.dataType; + var data = dataModel.getData(); + + var tooltipModel = buildTooltipModel([ + data.getItemModel(dataIndex), + dataModel, + seriesModel && (seriesModel.coordinateSystem || {}).model, + this._tooltipModel + ]); + + var tooltipTrigger = tooltipModel.get('trigger'); + if (tooltipTrigger != null && tooltipTrigger !== 'item') { + return; + } + + var params = dataModel.getDataParams(dataIndex, dataType); + var seriesTooltip = dataModel.formatTooltip(dataIndex, false, dataType, this._renderMode); + var defaultHtml; + var markers; + if (isObject$1(seriesTooltip)) { + defaultHtml = seriesTooltip.html; + markers = seriesTooltip.markers; + } + else { + defaultHtml = seriesTooltip; + markers = null; + } + + var asyncTicket = 'item_' + dataModel.name + '_' + dataIndex; + + this._showOrMove(tooltipModel, function () { + this._showTooltipContent( + tooltipModel, defaultHtml, params, asyncTicket, + e.offsetX, e.offsetY, e.position, e.target, markers + ); + }); + + // FIXME + // duplicated showtip if manuallyShowTip is called from dispatchAction. + dispatchAction({ + type: 'showTip', + dataIndexInside: dataIndex, + dataIndex: data.getRawIndex(dataIndex), + seriesIndex: seriesIndex, + from: this.uid + }); + }, + + _showComponentItemTooltip: function (e, el, dispatchAction) { + var tooltipOpt = el.tooltip; + if (typeof tooltipOpt === 'string') { + var content = tooltipOpt; + tooltipOpt = { + content: content, + // Fixed formatter + formatter: content + }; + } + var subTooltipModel = new Model(tooltipOpt, this._tooltipModel, this._ecModel); + var defaultHtml = subTooltipModel.get('content'); + var asyncTicket = Math.random(); + + // Do not check whether `trigger` is 'none' here, because `trigger` + // only works on cooridinate system. In fact, we have not found case + // that requires setting `trigger` nothing on component yet. + + this._showOrMove(subTooltipModel, function () { + this._showTooltipContent( + subTooltipModel, defaultHtml, subTooltipModel.get('formatterParams') || {}, + asyncTicket, e.offsetX, e.offsetY, e.position, el + ); + }); + + // If not dispatch showTip, tip may be hide triggered by axis. + dispatchAction({ + type: 'showTip', + from: this.uid + }); + }, + + _showTooltipContent: function ( + tooltipModel, defaultHtml, params, asyncTicket, x, y, positionExpr, el, markers + ) { + // Reset ticket + this._ticket = ''; + + if (!tooltipModel.get('showContent') || !tooltipModel.get('show')) { + return; + } + + var tooltipContent = this._tooltipContent; + + var formatter = tooltipModel.get('formatter'); + positionExpr = positionExpr || tooltipModel.get('position'); + var html = defaultHtml; + + if (formatter && typeof formatter === 'string') { + html = formatTpl(formatter, params, true); + } + else if (typeof formatter === 'function') { + var callback = bind$3(function (cbTicket, html) { + if (cbTicket === this._ticket) { + tooltipContent.setContent(html, markers, tooltipModel); + this._updatePosition( + tooltipModel, positionExpr, x, y, tooltipContent, params, el + ); + } + }, this); + this._ticket = asyncTicket; + html = formatter(params, asyncTicket, callback); + } + + tooltipContent.setContent(html, markers, tooltipModel); + tooltipContent.show(tooltipModel); + + this._updatePosition( + tooltipModel, positionExpr, x, y, tooltipContent, params, el + ); + }, + + /** + * @param {string|Function|Array.|Object} positionExpr + * @param {number} x Mouse x + * @param {number} y Mouse y + * @param {boolean} confine Whether confine tooltip content in view rect. + * @param {Object|} params + * @param {module:zrender/Element} el target element + * @param {module:echarts/ExtensionAPI} api + * @return {Array.} + */ + _updatePosition: function (tooltipModel, positionExpr, x, y, content, params, el) { + var viewWidth = this._api.getWidth(); + var viewHeight = this._api.getHeight(); + positionExpr = positionExpr || tooltipModel.get('position'); + + var contentSize = content.getSize(); + var align = tooltipModel.get('align'); + var vAlign = tooltipModel.get('verticalAlign'); + 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 position + positionExpr = positionExpr([x, y], params, content.el, rect, { + viewSize: [viewWidth, viewHeight], + contentSize: contentSize.slice() + }); + } + + if (isArray(positionExpr)) { + x = parsePercent$2(positionExpr[0], viewWidth); + y = parsePercent$2(positionExpr[1], viewHeight); + } + else if (isObject$1(positionExpr)) { + positionExpr.width = contentSize[0]; + positionExpr.height = contentSize[1]; + var layoutRect = getLayoutRect( + positionExpr, {width: viewWidth, height: viewHeight} + ); + x = layoutRect.x; + y = layoutRect.y; + align = null; + // When positionExpr is left/top/right/bottom, + // align and verticalAlign will not work. + vAlign = null; + } + // Specify tooltip position by string 'top' 'bottom' 'left' 'right' around graphic element + else if (typeof positionExpr === 'string' && el) { + var pos = calcTooltipPosition( + positionExpr, rect, contentSize + ); + x = pos[0]; + y = pos[1]; + } + else { + var pos = refixTooltipPosition( + x, y, content, viewWidth, viewHeight, align ? null : 20, vAlign ? null : 20 + ); + x = pos[0]; + y = pos[1]; + } + + align && (x -= isCenterAlign(align) ? contentSize[0] / 2 : align === 'right' ? contentSize[0] : 0); + vAlign && (y -= isCenterAlign(vAlign) ? contentSize[1] / 2 : vAlign === 'bottom' ? contentSize[1] : 0); + + if (tooltipModel.get('confine')) { + var pos = confineTooltipPosition( + x, y, content, viewWidth, viewHeight + ); + x = pos[0]; + y = pos[1]; + } + + content.moveTo(x, y); + }, + + // FIXME + // Should we remove this but leave this to user? + _updateContentNotChangedOnAxis: function (dataByCoordSys) { + var lastCoordSys = this._lastDataByCoordSys; + var contentNotChanged = !!lastCoordSys + && lastCoordSys.length === dataByCoordSys.length; + + contentNotChanged && each$17(lastCoordSys, function (lastItemCoordSys, indexCoordSys) { + var lastDataByAxis = lastItemCoordSys.dataByAxis || {}; + var thisItemCoordSys = dataByCoordSys[indexCoordSys] || {}; + var thisDataByAxis = thisItemCoordSys.dataByAxis || []; + contentNotChanged &= lastDataByAxis.length === thisDataByAxis.length; + + contentNotChanged && each$17(lastDataByAxis, function (lastItem, indexAxis) { + var thisItem = thisDataByAxis[indexAxis] || {}; + var lastIndices = lastItem.seriesDataIndices || []; + var newIndices = thisItem.seriesDataIndices || []; + + contentNotChanged &= + lastItem.value === thisItem.value + && lastItem.axisType === thisItem.axisType + && lastItem.axisId === thisItem.axisId + && lastIndices.length === newIndices.length; + + contentNotChanged && each$17(lastIndices, function (lastIdxItem, j) { + var newIdxItem = newIndices[j]; + contentNotChanged &= + lastIdxItem.seriesIndex === newIdxItem.seriesIndex + && lastIdxItem.dataIndex === newIdxItem.dataIndex; + }); + }); + }); + + this._lastDataByCoordSys = dataByCoordSys; + + return !!contentNotChanged; + }, + + _hide: function (dispatchAction) { + // Do not directly hideLater here, because this behavior may be prevented + // in dispatchAction when showTip is dispatched. + + // FIXME + // duplicated hideTip if manuallyHideTip is called from dispatchAction. + this._lastDataByCoordSys = null; + dispatchAction({ + type: 'hideTip', + from: this.uid + }); + }, + + dispose: function (ecModel, api) { + if (env$1.node || env$1.wxa) { + return; + } + this._tooltipContent.hide(); + unregister('itemTooltip', api); + } +}); + + +/** + * @param {Array.} modelCascade + * From top to bottom. (the last one should be globalTooltipModel); + */ +function buildTooltipModel(modelCascade) { + var resultModel = modelCascade.pop(); + while (modelCascade.length) { + var tooltipOpt = modelCascade.pop(); + if (tooltipOpt) { + if (Model.isInstance(tooltipOpt)) { + tooltipOpt = tooltipOpt.get('tooltip', true); + } + // In each data item tooltip can be simply write: + // { + // value: 10, + // tooltip: 'Something you need to know' + // } + if (typeof tooltipOpt === 'string') { + tooltipOpt = {formatter: tooltipOpt}; + } + resultModel = new Model(tooltipOpt, resultModel, resultModel.ecModel); + } + } + return resultModel; +} + +function makeDispatchAction$1(payload, api) { + return payload.dispatchAction || bind(api.dispatchAction, api); +} + +function refixTooltipPosition(x, y, content, viewWidth, viewHeight, gapH, gapV) { + var size = content.getOuterSize(); + var width = size.width; + var height = size.height; + + if (gapH != null) { + if (x + width + gapH > viewWidth) { + x -= width + gapH; + } + else { + x += gapH; + } + } + if (gapV != null) { + if (y + height + gapV > viewHeight) { + y -= height + gapV; + } + else { + y += gapV; + } + } + return [x, y]; +} + +function confineTooltipPosition(x, y, content, viewWidth, viewHeight) { + var size = content.getOuterSize(); + var width = size.width; + var height = size.height; + + x = Math.min(x + width, viewWidth) - width; + y = Math.min(y + height, viewHeight) - height; + x = Math.max(x, 0); + y = Math.max(y, 0); + + return [x, y]; +} + +function calcTooltipPosition(position, rect, contentSize) { + var domWidth = contentSize[0]; + var domHeight = contentSize[1]; + 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]; +} + +function isCenterAlign(align) { + return align === 'center' || align === 'middle'; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// FIXME Better way to pack data in graphic element + +/** + * @action + * @property {string} type + * @property {number} seriesIndex + * @property {number} dataIndex + * @property {number} [x] + * @property {number} [y] + */ +registerAction( + { + type: 'showTip', + event: 'showTip', + update: 'tooltip:manuallyShowTip' + }, + // noop + function () {} +); + +registerAction( + { + type: 'hideTip', + event: 'hideTip', + update: 'tooltip:manuallyHideTip' + }, + // noop + function () {} +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 getSeriesStackId$1(seriesModel) { + return seriesModel.get('stack') + || '__ec_stack_' + seriesModel.seriesIndex; +} + +function getAxisKey$1(axis) { + return axis.dim; +} + +/** + * @param {string} seriesType + * @param {module:echarts/model/Global} ecModel + * @param {module:echarts/ExtensionAPI} api + */ +function barLayoutPolar(seriesType, ecModel, api) { + + var width = api.getWidth(); + var height = api.getHeight(); + + var lastStackCoords = {}; + + var barWidthAndOffset = calRadialBar( + filter( + ecModel.getSeriesByType(seriesType), + function (seriesModel) { + return !ecModel.isSeriesFiltered(seriesModel) + && seriesModel.coordinateSystem + && seriesModel.coordinateSystem.type === 'polar'; + } + ) + ); + + ecModel.eachSeriesByType(seriesType, function (seriesModel) { + // Check series coordinate, do layout for polar only + if (seriesModel.coordinateSystem.type !== 'polar') { + return; + } + + var data = seriesModel.getData(); + var polar = seriesModel.coordinateSystem; + var baseAxis = polar.getBaseAxis(); + + var stackId = getSeriesStackId$1(seriesModel); + var columnLayoutInfo + = barWidthAndOffset[getAxisKey$1(baseAxis)][stackId]; + var columnOffset = columnLayoutInfo.offset; + var columnWidth = columnLayoutInfo.width; + var valueAxis = polar.getOtherAxis(baseAxis); + + var center = seriesModel.get('center') || ['50%', '50%']; + var cx = parsePercent$1(center[0], width); + var cy = parsePercent$1(center[1], height); + + var barMinHeight = seriesModel.get('barMinHeight') || 0; + var barMinAngle = seriesModel.get('barMinAngle') || 0; + + lastStackCoords[stackId] = lastStackCoords[stackId] || []; + + var valueDim = data.mapDimension(valueAxis.dim); + var baseDim = data.mapDimension(baseAxis.dim); + var stacked = isDimensionStacked(data, valueDim /*, baseDim*/); + + var valueAxisStart = valueAxis.getExtent()[0]; + + for (var idx = 0, len = data.count(); idx < len; idx++) { + var value = data.get(valueDim, idx); + var baseValue = data.get(baseDim, idx); + + if (isNaN(value)) { + continue; + } + + var sign = value >= 0 ? 'p' : 'n'; + var baseCoord = valueAxisStart; + + // Because of the barMinHeight, we can not use the value in + // stackResultDimension directly. + // Only ordinal axis can be stacked. + if (stacked) { + if (!lastStackCoords[stackId][baseValue]) { + lastStackCoords[stackId][baseValue] = { + p: valueAxisStart, // Positive stack + n: valueAxisStart // Negative stack + }; + } + // Should also consider #4243 + baseCoord = lastStackCoords[stackId][baseValue][sign]; + } + + var r0; + var r; + var startAngle; + var endAngle; + + // radial sector + if (valueAxis.dim === 'radius') { + var radiusSpan = valueAxis.dataToRadius(value) - valueAxisStart; + var angle = baseAxis.dataToAngle(baseValue); + + if (Math.abs(radiusSpan) < barMinHeight) { + radiusSpan = (radiusSpan < 0 ? -1 : 1) * barMinHeight; + } + + r0 = baseCoord; + r = baseCoord + radiusSpan; + startAngle = angle - columnOffset; + endAngle = startAngle - columnWidth; + + stacked && (lastStackCoords[stackId][baseValue][sign] = r); + } + // tangential sector + else { + // angleAxis must be clamped. + var angleSpan = valueAxis.dataToAngle(value, true) - valueAxisStart; + var radius = baseAxis.dataToRadius(baseValue); + + if (Math.abs(angleSpan) < barMinAngle) { + angleSpan = (angleSpan < 0 ? -1 : 1) * barMinAngle; + } + + r0 = radius + columnOffset; + r = r0 + columnWidth; + startAngle = baseCoord; + endAngle = baseCoord + angleSpan; + + // if the previous stack is at the end of the ring, + // add a round to differentiate it from origin + // var extent = angleAxis.getExtent(); + // var stackCoord = angle; + // if (stackCoord === extent[0] && value > 0) { + // stackCoord = extent[1]; + // } + // else if (stackCoord === extent[1] && value < 0) { + // stackCoord = extent[0]; + // } + stacked && (lastStackCoords[stackId][baseValue][sign] = endAngle); + } + + data.setItemLayout(idx, { + cx: cx, + cy: cy, + r0: r0, + r: r, + // Consider that positive angle is anti-clockwise, + // while positive radian of sector is clockwise + startAngle: -startAngle * Math.PI / 180, + endAngle: -endAngle * Math.PI / 180 + }); + + } + + }, this); + +} + +/** + * Calculate bar width and offset for radial bar charts + */ +function calRadialBar(barSeries, api) { + // Columns info on each category axis. Key is polar name + var columnsMap = {}; + + each$1(barSeries, function (seriesModel, idx) { + var data = seriesModel.getData(); + var polar = seriesModel.coordinateSystem; + + var baseAxis = polar.getBaseAxis(); + + var axisExtent = baseAxis.getExtent(); + var bandWidth = baseAxis.type === 'category' + ? baseAxis.getBandWidth() + : (Math.abs(axisExtent[1] - axisExtent[0]) / data.count()); + + var columnsOnAxis = columnsMap[getAxisKey$1(baseAxis)] || { + bandWidth: bandWidth, + remainedWidth: bandWidth, + autoWidthCount: 0, + categoryGap: '20%', + gap: '30%', + stacks: {} + }; + var stacks = columnsOnAxis.stacks; + columnsMap[getAxisKey$1(baseAxis)] = columnsOnAxis; + + var stackId = getSeriesStackId$1(seriesModel); + + if (!stacks[stackId]) { + columnsOnAxis.autoWidthCount++; + } + stacks[stackId] = stacks[stackId] || { + width: 0, + maxWidth: 0 + }; + + var barWidth = parsePercent$1( + seriesModel.get('barWidth'), + bandWidth + ); + var barMaxWidth = parsePercent$1( + seriesModel.get('barMaxWidth'), + bandWidth + ); + var barGap = seriesModel.get('barGap'); + var barCategoryGap = seriesModel.get('barCategoryGap'); + + 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 = {}; + + each$1(columnsMap, function (columnsOnAxis, coordSysName) { + + result[coordSysName] = {}; + + var stacks = columnsOnAxis.stacks; + var bandWidth = columnsOnAxis.bandWidth; + var categoryGap = parsePercent$1(columnsOnAxis.categoryGap, bandWidth); + var barGapPercent = parsePercent$1(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 + each$1(stacks, function (column, stack) { + var maxWidth = column.maxWidth; + if (maxWidth && maxWidth < autoWidth) { + maxWidth = Math.min(maxWidth, remainedWidth); + if (column.width) { + maxWidth = Math.min(maxWidth, column.width); + } + 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; + each$1(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; + each$1(stacks, function (column, stackId) { + result[coordSysName][stackId] = result[coordSysName][stackId] || { + offset: offset, + width: column.width + }; + + offset += column.width * (1 + barGapPercent); + }); + }); + + return result; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 RadiusAxis(scale, radiusExtent) { + + Axis.call(this, 'radius', scale, radiusExtent); + + /** + * Axis type + * - 'category' + * - 'value' + * - 'time' + * - 'log' + * @type {string} + */ + this.type = 'category'; +} + +RadiusAxis.prototype = { + + constructor: RadiusAxis, + + /** + * @override + */ + pointToData: function (point, clamp) { + return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; + }, + + dataToRadius: Axis.prototype.dataToCoord, + + radiusToData: Axis.prototype.coordToData +}; + +inherits(RadiusAxis, Axis); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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, + + /** + * @override + */ + pointToData: function (point, clamp) { + return this.polar.pointToData(point, clamp)[this.dim === 'radius' ? 0 : 1]; + }, + + dataToAngle: Axis.prototype.dataToCoord, + + angleToData: Axis.prototype.coordToData +}; + +inherits(AngleAxis, Axis); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @module echarts/coord/polar/Polar + */ + +/** + * @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(); + + this._radiusAxis.polar = this._angleAxis.polar = this; +}; + +Polar.prototype = { + + type: 'polar', + + axisPointerEnabled: true, + + constructor: Polar, + + /** + * @param {Array.} + * @readOnly + */ + dimensions: ['radius', 'angle'], + + /** + * @type {module:echarts/coord/PolarModel} + */ + model: null, + + /** + * If contain coord + * @param {Array.} 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.} data + * @return {boolean} + */ + containData: function (data) { + return this._radiusAxis.containData(data[0]) + && this._angleAxis.containData(data[1]); + }, + + /** + * @param {string} dim + * @return {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} + */ + getAxis: function (dim) { + return this['_' + dim + 'Axis']; + }, + + /** + * @return {Array.} + */ + getAxes: function () { + return [this._radiusAxis, this._angleAxis]; + }, + + /** + * 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(); + }, + + /** + * @param {string} [dim] 'radius' or 'angle' or 'auto' or null/undefined + * @return {Object} {baseAxes: [], otherAxes: []} + */ + getTooltipAxes: function (dim) { + var baseAxis = (dim != null && dim !== 'auto') + ? this.getAxis(dim) : this.getBaseAxis(); + return { + baseAxes: [baseAxis], + otherAxes: [this.getOtherAxis(baseAxis)] + }; + }, + + /** + * 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.} data + * @param {boolean} [clamp=false] + * @return {Array.} + */ + 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.} point + * @param {boolean} [clamp=false] + * @return {Array.} + */ + 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.} point + * @return {Array.} + */ + 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.} coord + * @return {Array.} + */ + 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]; + } + +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 PolarAxisModel = ComponentModel.extend({ + + type: 'polarAxis', + + /** + * @type {module:echarts/coord/polar/AngleAxis|module:echarts/coord/polar/RadiusAxis} + */ + axis: null, + + /** + * @override + */ + getCoordSysModel: function () { + return this.ecModel.queryComponents({ + mainType: 'polar', + index: this.option.polarIndex, + id: this.option.polarId + })[0]; + } + +}); + +merge(PolarAxisModel.prototype, axisModelCommonMixin); + +var polarAxisDefaultExtendedOption = { + angle: { + // polarIndex: 0, + // polarId: '', + + startAngle: 90, + + clockwise: true, + + splitNumber: 12, + + axisLabel: { + rotate: false + } + }, + radius: { + // polarIndex: 0, + // polarId: '', + + splitNumber: 5 + } +}; + +function getAxisType$3(axisDim, option) { + // Default axis with data is category axis + return option.type || (option.data ? 'category' : 'value'); +} + +axisModelCreator('angle', PolarAxisModel, getAxisType$3, polarAxisDefaultExtendedOption.angle); +axisModelCreator('radius', PolarAxisModel, getAxisType$3, polarAxisDefaultExtendedOption.radius); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +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 foundAxisModel; + var ecModel = this.ecModel; + + ecModel.eachComponent(axisType, function (axisModel) { + if (axisModel.getCoordSysModel() === this) { + foundAxisModel = axisModel; + } + }, this); + return foundAxisModel; + }, + + defaultOption: { + + zlevel: 0, + + z: 0, + + center: ['50%', '50%'], + + radius: '80%' + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// TODO Axis scale + +/** + * Resize method bound to the polar + * @param {module:echarts/coord/polar/PolarModel} polarModel + * @param {module:echarts/ExtensionAPI} api + */ +function resizePolar(polar, polarModel, api) { + var center = polarModel.get('center'); + var width = api.getWidth(); + var height = api.getHeight(); + + polar.cx = parsePercent$1(center[0], width); + polar.cy = parsePercent$1(center[1], height); + + var radiusAxis = polar.getRadiusAxis(); + var size = Math.min(width, height) / 2; + var radius = parsePercent$1(polarModel.get('radius'), size); + radiusAxis.inverse + ? radiusAxis.setExtent(radius, 0) + : radiusAxis.setExtent(0, radius); +} + +/** + * 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(); + each$1(data.mapDimension('radius', true), function (dim) { + radiusAxis.scale.unionExtentFromData( + data, getStackedDimension(data, dim) + ); + }); + each$1(data.mapDimension('angle', true), function (dim) { + angleAxis.scale.unionExtentFromData( + data, getStackedDimension(data, dim) + ); + }); + } + }); + + niceScaleExtent(angleAxis.scale, angleAxis.model); + niceScaleExtent(radiusAxis.scale, 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 = createScaleByModel(axisModel); + axis.onBand = axisModel.get('boundaryGap') && axis.type === 'category'; + axis.inverse = axisModel.get('inverse'); + + if (axisModel.mainType === 'angleAxis') { + axis.inverse ^= axisModel.get('clockwise'); + var startAngle = axisModel.get('startAngle'); + 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.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); + + resizePolar(polar, polarModel, api); + + polarList.push(polar); + + polarModel.coordinateSystem = polar; + polar.model = polarModel; + }); + // Inject coordinateSystem to series + ecModel.eachSeries(function (seriesModel) { + if (seriesModel.get('coordinateSystem') === 'polar') { + var polarModel = ecModel.queryComponents({ + mainType: 'polar', + index: seriesModel.get('polarIndex'), + id: seriesModel.get('polarId') + })[0]; + + if (__DEV__) { + if (!polarModel) { + throw new Error( + 'Polar "' + retrieve( + seriesModel.get('polarIndex'), + seriesModel.get('polarId'), + 0 + ) + '" not found' + ); + } + } + seriesModel.coordinateSystem = polarModel.coordinateSystem; + } + }); + + return polarList; + } +}; + +CoordinateSystemManager.register('polar', polarCreator); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 elementList$1 = ['axisLine', 'axisLabel', 'axisTick', 'splitLine', 'splitArea']; + +function getAxisLineShape(polar, rExtent, angle) { + rExtent[1] > rExtent[0] && (rExtent = rExtent.slice().reverse()); + var start = polar.coordToPoint([rExtent[0], angle]); + var end = polar.coordToPoint([rExtent[1], angle]); + + return { + x1: start[0], + y1: start[1], + x2: end[0], + y2: end[1] + }; +} + +function getRadiusIdx(polar) { + var radiusAxis = polar.getRadiusAxis(); + return radiusAxis.inverse ? 0 : 1; +} + +// Remove the last tick which will overlap the first tick +function fixAngleOverlap(list) { + var firstItem = list[0]; + var lastItem = list[list.length - 1]; + if (firstItem + && lastItem + && Math.abs(Math.abs(firstItem.coord - lastItem.coord) - 360) < 1e-4 + ) { + list.pop(); + } +} + +AxisView.extend({ + + type: 'angleAxis', + + axisPointerClass: 'PolarAxisPointer', + + render: function (angleAxisModel, ecModel) { + this.group.removeAll(); + if (!angleAxisModel.get('show')) { + return; + } + + var angleAxis = angleAxisModel.axis; + var polar = angleAxis.polar; + var radiusExtent = polar.getRadiusAxis().getExtent(); + + var ticksAngles = angleAxis.getTicksCoords(); + var labels = map(angleAxis.getViewLabels(), function (labelItem) { + var labelItem = clone(labelItem); + labelItem.coord = angleAxis.dataToCoord(labelItem.tickValue); + return labelItem; + }); + + fixAngleOverlap(labels); + fixAngleOverlap(ticksAngles); + + each$1(elementList$1, function (name) { + if (angleAxisModel.get(name +'.show') + && (!angleAxis.scale.isBlank() || name === 'axisLine') + ) { + this['_' + name](angleAxisModel, polar, ticksAngles, radiusExtent, labels); + } + }, this); + }, + + /** + * @private + */ + _axisLine: function (angleAxisModel, polar, ticksAngles, radiusExtent) { + var lineStyleModel = angleAxisModel.getModel('axisLine.lineStyle'); + + var circle = new Circle({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: radiusExtent[getRadiusIdx(polar)] + }, + 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 radius = radiusExtent[getRadiusIdx(polar)]; + + var lines = map(ticksAngles, function (tickAngleItem) { + return new Line({ + shape: getAxisLineShape(polar, [radius, radius + tickLen], tickAngleItem.coord) + }); + }); + this.group.add(mergePath( + lines, { + style: defaults( + tickModel.getModel('lineStyle').getLineStyle(), + { + stroke: angleAxisModel.get('axisLine.lineStyle.color') + } + ) + } + )); + }, + + /** + * @private + */ + _axisLabel: function (angleAxisModel, polar, ticksAngles, radiusExtent, labels) { + var rawCategoryData = angleAxisModel.getCategories(true); + + var commonLabelModel = angleAxisModel.getModel('axisLabel'); + + var labelMargin = commonLabelModel.get('margin'); + + // Use length of ticksAngles because it may remove the last tick to avoid overlapping + each$1(labels, function (labelItem, idx) { + var labelModel = commonLabelModel; + var tickValue = labelItem.tickValue; + + var r = radiusExtent[getRadiusIdx(polar)]; + var p = polar.coordToPoint([r + labelMargin, labelItem.coord]); + 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 labelTextVerticalAlign = Math.abs(p[1] - cy) / r < 0.3 + ? 'middle' : (p[1] > cy ? 'top' : 'bottom'); + + if (rawCategoryData && rawCategoryData[tickValue] && rawCategoryData[tickValue].textStyle) { + labelModel = new Model(rawCategoryData[tickValue].textStyle, commonLabelModel, commonLabelModel.ecModel); + } + + var textEl = new Text({silent: true}); + this.group.add(textEl); + setTextStyle(textEl.style, labelModel, { + x: p[0], + y: p[1], + textFill: labelModel.getTextColor() || angleAxisModel.get('axisLine.lineStyle.color'), + text: labelItem.formattedLabel, + textAlign: labelTextAlign, + textVerticalAlign: labelTextVerticalAlign + }); + }, this); + }, + + /** + * @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 Line({ + shape: getAxisLineShape(polar, radiusExtent, ticksAngles[i].coord) + })); + } + + // Simple optimization + // Batching the lines if color are the same + for (var i = 0; i < splitLines.length; i++) { + this.group.add(mergePath(splitLines[i], { + style: defaults({ + stroke: lineColors[i % lineColors.length] + }, lineStyleModel.getLineStyle()), + silent: true, + z: angleAxisModel.get('z') + })); + } + }, + + /** + * @private + */ + _splitArea: function (angleAxisModel, polar, ticksAngles, radiusExtent) { + if (!ticksAngles.length) { + return; + } + + 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].coord * 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 Sector({ + shape: { + cx: polar.cx, + cy: polar.cy, + r0: r0, + r: r1, + startAngle: prevAngle, + endAngle: -ticksAngles[i].coord * RADIAN, + clockwise: clockwise + }, + silent: true + })); + prevAngle = -ticksAngles[i].coord * RADIAN; + } + + // Simple optimization + // Batching the lines if color are the same + for (var i = 0; i < splitAreas.length; i++) { + this.group.add(mergePath(splitAreas[i], { + style: defaults({ + fill: areaColors[i % areaColors.length] + }, areaStyleModel.getAreaStyle()), + silent: true + })); + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 axisBuilderAttrs$3 = [ + 'axisLine', 'axisTickLabel', 'axisName' +]; +var selfBuilderAttrs$1 = [ + 'splitLine', 'splitArea' +]; + +AxisView.extend({ + + type: 'radiusAxis', + + axisPointerClass: 'PolarAxisPointer', + + render: function (radiusAxisModel, ecModel) { + this.group.removeAll(); + if (!radiusAxisModel.get('show')) { + return; + } + var radiusAxis = radiusAxisModel.axis; + var polar = radiusAxis.polar; + var angleAxis = polar.getAngleAxis(); + 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); + each$1(axisBuilderAttrs$3, axisBuilder.add, axisBuilder); + this.group.add(axisBuilder.getGroup()); + + each$1(selfBuilderAttrs$1, function (name) { + if (radiusAxisModel.get(name +'.show') && !radiusAxis.scale.isBlank()) { + 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 Circle({ + shape: { + cx: polar.cx, + cy: polar.cy, + r: ticksCoords[i].coord + }, + silent: true + })); + } + + // Simple optimization + // Batching the lines if color are the same + for (var i = 0; i < splitLines.length; i++) { + this.group.add(mergePath(splitLines[i], { + style: defaults({ + stroke: lineColors[i % lineColors.length], + fill: null + }, lineStyleModel.getLineStyle()), + silent: true + })); + } + }, + + /** + * @private + */ + _splitArea: function (radiusAxisModel, polar, axisAngle, radiusExtent, ticksCoords) { + if (!ticksCoords.length) { + return; + } + + 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].coord; + for (var i = 1; i < ticksCoords.length; i++) { + var colorIndex = (lineCount++) % areaColors.length; + splitAreas[colorIndex] = splitAreas[colorIndex] || []; + splitAreas[colorIndex].push(new Sector({ + shape: { + cx: polar.cx, + cy: polar.cy, + r0: prevRadius, + r: ticksCoords[i].coord, + startAngle: 0, + endAngle: Math.PI * 2 + }, + silent: true + })); + prevRadius = ticksCoords[i].coord; + } + + // Simple optimization + // Batching the lines if color are the same + for (var i = 0; i < splitAreas.length; i++) { + this.group.add(mergePath(splitAreas[i], { + style: 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, + labelRotate: radiusAxisModel.getModel('axisLabel').get('rotate'), + // Over splitLine and splitArea + z2: 1 + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 PolarAxisPointer = BaseAxisPointer.extend({ + + /** + * @override + */ + makeElOption: function (elOption, value, axisModel, axisPointerModel, api) { + var axis = axisModel.axis; + + if (axis.dim === 'angle') { + this.animationThreshold = Math.PI / 18; + } + + var polar = axis.polar; + var otherAxis = polar.getOtherAxis(axis); + var otherExtent = otherAxis.getExtent(); + + var coordValue; + coordValue = axis['dataTo' + capitalFirst(axis.dim)](value); + + var axisPointerType = axisPointerModel.get('type'); + if (axisPointerType && axisPointerType !== 'none') { + var elStyle = buildElStyle(axisPointerModel); + var pointerOption = pointerShapeBuilder$2[axisPointerType]( + axis, polar, coordValue, otherExtent, elStyle + ); + pointerOption.style = elStyle; + elOption.graphicKey = pointerOption.type; + elOption.pointer = pointerOption; + } + + var labelMargin = axisPointerModel.get('label.margin'); + var labelPos = getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin); + buildLabelElOption(elOption, axisModel, axisPointerModel, api, labelPos); + } + + // Do not support handle, utill any user requires it. + +}); + +function getLabelPosition(value, axisModel, axisPointerModel, polar, labelMargin) { + var axis = axisModel.axis; + var coord = axis.dataToCoord(value); + var axisAngle = polar.getAngleAxis().getExtent()[0]; + axisAngle = axisAngle / 180 * Math.PI; + var radiusExtent = polar.getRadiusAxis().getExtent(); + var position; + var align; + var verticalAlign; + + if (axis.dim === 'radius') { + var transform = create$1(); + rotate(transform, transform, axisAngle); + translate(transform, transform, [polar.cx, polar.cy]); + position = applyTransform$1([coord, -labelMargin], transform); + + var labelRotation = axisModel.getModel('axisLabel').get('rotate') || 0; + var labelLayout = AxisBuilder.innerTextLayout( + axisAngle, labelRotation * Math.PI / 180, -1 + ); + align = labelLayout.textAlign; + verticalAlign = labelLayout.textVerticalAlign; + } + else { // angle axis + var r = radiusExtent[1]; + position = polar.coordToPoint([r + labelMargin, coord]); + var cx = polar.cx; + var cy = polar.cy; + align = Math.abs(position[0] - cx) / r < 0.3 + ? 'center' : (position[0] > cx ? 'left' : 'right'); + verticalAlign = Math.abs(position[1] - cy) / r < 0.3 + ? 'middle' : (position[1] > cy ? 'top' : 'bottom'); + } + + return { + position: position, + align: align, + verticalAlign: verticalAlign + }; +} + + +var pointerShapeBuilder$2 = { + + line: function (axis, polar, coordValue, otherExtent, elStyle) { + return axis.dim === 'angle' + ? { + type: 'Line', + shape: makeLineShape( + polar.coordToPoint([otherExtent[0], coordValue]), + polar.coordToPoint([otherExtent[1], coordValue]) + ) + } + : { + type: 'Circle', + shape: { + cx: polar.cx, + cy: polar.cy, + r: coordValue + } + }; + }, + + shadow: function (axis, polar, coordValue, otherExtent, elStyle) { + var bandWidth = Math.max(1, axis.getBandWidth()); + var radian = Math.PI / 180; + + return axis.dim === 'angle' + ? { + type: 'Sector', + shape: makeSectorShape( + polar.cx, polar.cy, + otherExtent[0], otherExtent[1], + // In ECharts y is negative if angle is positive + (-coordValue - bandWidth / 2) * radian, + (-coordValue + bandWidth / 2) * radian + ) + } + : { + type: 'Sector', + shape: makeSectorShape( + polar.cx, polar.cy, + coordValue - bandWidth / 2, + coordValue + bandWidth / 2, + 0, Math.PI * 2 + ) + }; + } +}; + +AxisView.registerAxisPointerClass('PolarAxisPointer', PolarAxisPointer); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// For reducing size of echarts.min, barLayoutPolar is required by polar. +registerLayout(curry(barLayoutPolar, 'bar')); + +// Polar view +extendComponentView({ + type: 'polar' +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 GeoModel = ComponentModel.extend({ + + type: 'geo', + + /** + * @type {module:echarts/coord/geo/Geo} + */ + coordinateSystem: null, + + layoutMode: 'box', + + init: function (option) { + ComponentModel.prototype.init.apply(this, arguments); + + // Default label emphasis `show` + defaultEmphasis(option, 'label', ['show']); + }, + + optionUpdated: function () { + var option = this.option; + var self = this; + + option.regions = geoCreator.getFilledRegions(option.regions, option.map, option.nameMap); + + this._optionModelMap = reduce(option.regions || [], function (optionModelMap, regionOpt) { + if (regionOpt.name) { + optionModelMap.set(regionOpt.name, new Model(regionOpt, self)); + } + return optionModelMap; + }, createHashMap()); + + this.updateSelectedMap(option.regions); + }, + + defaultOption: { + + zlevel: 0, + + z: 0, + + show: true, + + left: 'center', + + top: 'center', + + + // width:, + // height:, + // right + // bottom + + // Aspect is width / height. Inited to be geoJson bbox aspect + // This parameter is used for scale this aspect + // If svg used, aspectScale is 1 by default. + // aspectScale: 0.75, + aspectScale: null, + + ///// Layout with center and size + // If you wan't to put map in a fixed size box with right aspect ratio + // This two properties may more conveninet + // layoutCenter: [50%, 50%] + // layoutSize: 100 + + silent: false, + + // Map type + map: '', + + // Define left-top, right-bottom coords to control view + // For example, [ [180, 90], [-180, -90] ] + boundingCoords: null, + + // Default on center of map + center: null, + + zoom: 1, + + scaleLimit: null, + + // selectedMode: false + + label: { + show: false, + color: '#000' + }, + + itemStyle: { + // color: 各异, + borderWidth: 0.5, + borderColor: '#444', + color: '#eee' + }, + + emphasis: { + label: { + show: true, + color: 'rgb(100,0,0)' + }, + itemStyle: { + color: 'rgba(255,215,0,0.8)' + } + }, + + regions: [] + }, + + /** + * Get model of region + * @param {string} name + * @return {module:echarts/model/Model} + */ + getRegionModel: function (name) { + return this._optionModelMap.get(name) || new Model(null, this, this.ecModel); + }, + + /** + * Format label + * @param {string} name Region name + * @param {string} [status='normal'] 'normal' or 'emphasis' + * @return {string} + */ + getFormattedLabel: function (name, status) { + var regionModel = this.getRegionModel(name); + var formatter = regionModel.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}', name != null ? name : ''); + } + }, + + setZoom: function (zoom) { + this.option.zoom = zoom; + }, + + setCenter: function (center) { + this.option.center = center; + } +}); + +mixin(GeoModel, selectableMixin); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +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, payload) { + // Not render if it is an toggleSelect action from self + if (payload && payload.type === 'geoToggleSelect' + && payload.from === this.uid + ) { + return; + } + + var mapDraw = this._mapDraw; + if (geoModel.get('show')) { + mapDraw.draw(geoModel, ecModel, api, this, payload); + } + else { + this._mapDraw.group.removeAll(); + } + + this.group.silent = geoModel.get('silent'); + }, + + dispose: function () { + this._mapDraw && this._mapDraw.remove(); + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 makeAction(method, actionInfo) { + actionInfo.update = 'updateView'; + registerAction(actionInfo, function (payload, ecModel) { + var selected = {}; + + ecModel.eachComponent( + { mainType: 'geo', query: payload}, + function (geoModel) { + geoModel[method](payload.name); + var geo = geoModel.coordinateSystem; + each$1(geo.regions, function (region) { + selected[region.name] = geoModel.isSelected(region.name) || false; + }); + } + ); + + return { + selected: selected, + name: payload.name + }; + }); +} + +makeAction('toggleSelected', { + type: 'geoToggleSelect', + event: 'geoselectchanged' +}); +makeAction('select', { + type: 'geoSelect', + event: 'geoselected' +}); +makeAction('unSelect', { + type: 'geoUnSelect', + event: 'geounselected' +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 DEFAULT_TOOLBOX_BTNS = ['rect', 'polygon', 'keep', 'clear']; + +var preprocessor$1 = function (option, isNew) { + var brushComponents = option && option.brush; + if (!isArray(brushComponents)) { + brushComponents = brushComponents ? [brushComponents] : []; + } + + if (!brushComponents.length) { + return; + } + + var brushComponentSpecifiedBtns = []; + + each$1(brushComponents, function (brushOpt) { + var tbs = brushOpt.hasOwnProperty('toolbox') + ? brushOpt.toolbox : []; + + if (tbs instanceof Array) { + brushComponentSpecifiedBtns = brushComponentSpecifiedBtns.concat(tbs); + } + }); + + var toolbox = option && option.toolbox; + + if (isArray(toolbox)) { + toolbox = toolbox[0]; + } + if (!toolbox) { + toolbox = {feature: {}}; + option.toolbox = [toolbox]; + } + + var toolboxFeature = (toolbox.feature || (toolbox.feature = {})); + var toolboxBrush = toolboxFeature.brush || (toolboxFeature.brush = {}); + var brushTypes = toolboxBrush.type || (toolboxBrush.type = []); + + brushTypes.push.apply(brushTypes, brushComponentSpecifiedBtns); + + removeDuplicate(brushTypes); + + if (isNew && !brushTypes.length) { + brushTypes.push.apply(brushTypes, DEFAULT_TOOLBOX_BTNS); + } +}; + +function removeDuplicate(arr) { + var map$$1 = {}; + each$1(arr, function (val) { + map$$1[val] = 1; + }); + arr.length = 0; + each$1(map$$1, function (flag, val) { + arr.push(val); + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Visual solution, for consistent option specification. + */ + +var each$19 = each$1; + +function hasKeys(obj) { + if (obj) { + for (var name in obj){ + if (obj.hasOwnProperty(name)) { + return true; + } + } + } +} + +/** + * @param {Object} option + * @param {Array.} stateList + * @param {Function} [supplementVisualOption] + * @return {Object} visualMappings > + */ +function createVisualMappings(option, stateList, supplementVisualOption) { + var visualMappings = {}; + + each$19(stateList, function (state) { + var mappings = visualMappings[state] = createMappings(); + + each$19(option[state], function (visualData, visualType) { + if (!VisualMapping.isValidType(visualType)) { + return; + } + var mappingOption = { + type: visualType, + visual: visualData + }; + supplementVisualOption && supplementVisualOption(mappingOption, state); + mappings[visualType] = new VisualMapping(mappingOption); + + // Prepare a alpha for opacity, for some case that opacity + // is not supported, such as rendering using gradient color. + if (visualType === 'opacity') { + mappingOption = clone(mappingOption); + mappingOption.type = 'colorAlpha'; + mappings.__hidden.__alphaForOpacity = new VisualMapping(mappingOption); + } + }); + }); + + return visualMappings; + + function createMappings() { + var Creater = function () {}; + // Make sure hidden fields will not be visited by + // object iteration (with hasOwnProperty checking). + Creater.prototype.__hidden = Creater.prototype; + var obj = new Creater(); + return obj; + } +} + +/** + * @param {Object} thisOption + * @param {Object} newOption + * @param {Array.} keys + */ +function replaceVisualOption(thisOption, newOption, keys) { + // Visual attributes merge is not supported, otherwise it + // brings overcomplicated merge logic. See #2853. So if + // newOption has anyone of these keys, all of these keys + // will be reset. Otherwise, all keys remain. + var has; + each$1(keys, function (key) { + if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { + has = true; + } + }); + has && each$1(keys, function (key) { + if (newOption.hasOwnProperty(key) && hasKeys(newOption[key])) { + thisOption[key] = clone(newOption[key]); + } + else { + delete thisOption[key]; + } + }); +} + +/** + * @param {Array.} stateList + * @param {Object} visualMappings > + * @param {module:echarts/data/List} list + * @param {Function} getValueState param: valueOrIndex, return: state. + * @param {object} [scope] Scope for getValueState + * @param {string} [dimension] Concrete dimension, if used. + */ +// ???! handle brush? +function applyVisual(stateList, visualMappings, data, getValueState, scope, dimension) { + var visualTypesMap = {}; + each$1(stateList, function (state) { + var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); + visualTypesMap[state] = visualTypes; + }); + + var dataIndex; + + function getVisual(key) { + return data.getItemVisual(dataIndex, key); + } + + function setVisual(key, value) { + data.setItemVisual(dataIndex, key, value); + } + + if (dimension == null) { + data.each(eachItem); + } + else { + data.each([dimension], eachItem); + } + + function eachItem(valueOrIndex, index) { + dataIndex = dimension == null ? valueOrIndex : index; + + var rawDataItem = data.getRawDataItem(dataIndex); + // Consider performance + if (rawDataItem && rawDataItem.visualMap === false) { + return; + } + + var valueState = getValueState.call(scope, valueOrIndex); + 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( + valueOrIndex, getVisual, setVisual + ); + } + } +} + +/** + * @param {module:echarts/data/List} data + * @param {Array.} stateList + * @param {Object} visualMappings > + * @param {Function} getValueState param: valueOrIndex, return: state. + * @param {number} [dim] dimension or dimension index. + */ +function incrementalApplyVisual(stateList, visualMappings, getValueState, dim) { + var visualTypesMap = {}; + each$1(stateList, function (state) { + var visualTypes = VisualMapping.prepareVisualTypes(visualMappings[state]); + visualTypesMap[state] = visualTypes; + }); + + function progress(params, data) { + if (dim != null) { + dim = data.getDimension(dim); + } + + function getVisual(key) { + return data.getItemVisual(dataIndex, key); + } + + function setVisual(key, value) { + data.setItemVisual(dataIndex, key, value); + } + + var dataIndex; + while ((dataIndex = params.next()) != null) { + var rawDataItem = data.getRawDataItem(dataIndex); + + // Consider performance + if (rawDataItem && rawDataItem.visualMap === false) { + return; + } + + var value = dim != null + ? data.get(dim, dataIndex, true) + : dataIndex; + + var valueState = 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); + } + } + } + + return {progress: progress}; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Key of the first level is brushType: `line`, `rect`, `polygon`. +// Key of the second level is chart element type: `point`, `rect`. +// See moudule:echarts/component/helper/BrushController +// function param: +// {Object} itemLayout fetch from data.getItemLayout(dataIndex) +// {Object} selectors {point: selector, rect: selector, ...} +// {Object} area {range: [[], [], ..], boudingRect} +// function return: +// {boolean} Whether in the given brush. +var selector = { + lineX: getLineSelectors(0), + lineY: getLineSelectors(1), + rect: { + point: function (itemLayout, selectors, area) { + return itemLayout && area.boundingRect.contain(itemLayout[0], itemLayout[1]); + }, + rect: function (itemLayout, selectors, area) { + return itemLayout && area.boundingRect.intersect(itemLayout); + } + }, + polygon: { + point: function (itemLayout, selectors, area) { + return itemLayout + && area.boundingRect.contain(itemLayout[0], itemLayout[1]) + && contain$1(area.range, itemLayout[0], itemLayout[1]); + }, + rect: function (itemLayout, selectors, area) { + var points = area.range; + + if (!itemLayout || points.length <= 1) { + return false; + } + + var x = itemLayout.x; + var y = itemLayout.y; + var width = itemLayout.width; + var height = itemLayout.height; + var p = points[0]; + + if (contain$1(points, x, y) + || contain$1(points, x + width, y) + || contain$1(points, x, y + height) + || contain$1(points, x + width, y + height) + || BoundingRect.create(itemLayout).contain(p[0], p[1]) + || lineIntersectPolygon(x, y, x + width, y, points) + || lineIntersectPolygon(x, y, x, y + height, points) + || lineIntersectPolygon(x + width, y, x + width, y + height, points) + || lineIntersectPolygon(x, y + height, x + width, y + height, points) + ) { + return true; + } + } + } +}; + +function getLineSelectors(xyIndex) { + var xy = ['x', 'y']; + var wh = ['width', 'height']; + + return { + point: function (itemLayout, selectors, area) { + if (itemLayout) { + var range = area.range; + var p = itemLayout[xyIndex]; + return inLineRange(p, range); + } + }, + rect: function (itemLayout, selectors, area) { + if (itemLayout) { + var range = area.range; + var layoutRange = [ + itemLayout[xy[xyIndex]], + itemLayout[xy[xyIndex]] + itemLayout[wh[xyIndex]] + ]; + layoutRange[1] < layoutRange[0] && layoutRange.reverse(); + return inLineRange(layoutRange[0], range) + || inLineRange(layoutRange[1], range) + || inLineRange(range[0], layoutRange) + || inLineRange(range[1], layoutRange); + } + } + }; +} + +function inLineRange(p, range) { + return range[0] <= p && p <= range[1]; +} + +function lineIntersectPolygon(lx, ly, l2x, l2y, points) { + for (var i = 0, p2 = points[points.length - 1]; i < points.length; i++) { + var p = points[i]; + if (lineIntersect(lx, ly, l2x, l2y, p[0], p[1], p2[0], p2[1])) { + return true; + } + p2 = p; + } +} + +// Code from with some fix. +// See +function lineIntersect(a1x, a1y, a2x, a2y, b1x, b1y, b2x, b2y) { + var delta = determinant(a2x - a1x, b1x - b2x, a2y - a1y, b1y - b2y); + if (nearZero(delta)) { // parallel + return false; + } + var namenda = determinant(b1x - a1x, b1x - b2x, b1y - a1y, b1y - b2y) / delta; + if (namenda < 0 || namenda > 1) { + return false; + } + var miu = determinant(a2x - a1x, b1x - a1x, a2y - a1y, b1y - a1y) / delta; + if (miu < 0 || miu > 1) { + return false; + } + return true; +} + +function nearZero(val) { + return val <= (1e-6) && val >= -(1e-6); +} + +function determinant(v1, v2, v3, v4) { + return v1 * v4 - v2 * v3; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$20 = each$1; +var indexOf$1 = indexOf; +var curry$5 = curry; + +var COORD_CONVERTS = ['dataToPoint', 'pointToData']; + +// FIXME +// how to genarialize to more coordinate systems. +var INCLUDE_FINDER_MAIN_TYPES = [ + 'grid', 'xAxis', 'yAxis', 'geo', 'graph', + 'polar', 'radiusAxis', 'angleAxis', 'bmap' +]; + +/** + * [option in constructor]: + * { + * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder. + * } + * + * + * [targetInfo]: + * + * There can be multiple axes in a single targetInfo. Consider the case + * of `grid` component, a targetInfo represents a grid which contains one or more + * cartesian and one or more axes. And consider the case of parallel system, + * which has multiple axes in a coordinate system. + * Can be { + * panelId: ..., + * coordSys: , + * coordSyses: all cartesians. + * gridModel: + * xAxes: correspond to coordSyses on index + * yAxes: correspond to coordSyses on index + * } + * or { + * panelId: ..., + * coordSys: + * coordSyses: [] + * geoModel: + * } + * + * + * [panelOpt]: + * + * Make from targetInfo. Input to BrushController. + * { + * panelId: ..., + * rect: ... + * } + * + * + * [area]: + * + * Generated by BrushController or user input. + * { + * panelId: Used to locate coordInfo directly. If user inpput, no panelId. + * brushType: determine how to convert to/from coord('rect' or 'polygon' or 'lineX/Y'). + * Index/Id/Name of geo, xAxis, yAxis, grid: See util/model#parseFinder. + * range: pixel range. + * coordRange: representitive coord range (the first one of coordRanges). + * coordRanges: coord ranges, used in multiple cartesian in one grid. + * } + */ + +/** + * @param {Object} option contains Index/Id/Name of xAxis/yAxis/geo/grid + * Each can be {number|Array.}. like: {xAxisIndex: [3, 4]} + * @param {module:echarts/model/Global} ecModel + * @param {Object} [opt] + * @param {Array.} [opt.include] include coordinate system types. + */ +function BrushTargetManager(option, ecModel, opt) { + /** + * @private + * @type {Array.} + */ + var targetInfoList = this._targetInfoList = []; + var info = {}; + var foundCpts = parseFinder$1(ecModel, option); + + each$20(targetInfoBuilders, function (builder, type) { + if (!opt || !opt.include || indexOf$1(opt.include, type) >= 0) { + builder(foundCpts, targetInfoList, info); + } + }); +} + +var proto$2 = BrushTargetManager.prototype; + +proto$2.setOutputRanges = function (areas, ecModel) { + this.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { + (area.coordRanges || (area.coordRanges = [])).push(coordRange); + // area.coordRange is the first of area.coordRanges + if (!area.coordRange) { + area.coordRange = coordRange; + // In 'category' axis, coord to pixel is not reversible, so we can not + // rebuild range by coordRange accrately, which may bring trouble when + // brushing only one item. So we use __rangeOffset to rebuilding range + // by coordRange. And this it only used in brush component so it is no + // need to be adapted to coordRanges. + var result = coordConvert[area.brushType](0, coordSys, coordRange); + area.__rangeOffset = { + offset: diffProcessor[area.brushType](result.values, area.range, [1, 1]), + xyMinMax: result.xyMinMax + }; + } + }); +}; + +proto$2.matchOutputRanges = function (areas, ecModel, cb) { + each$20(areas, function (area) { + var targetInfo = this.findTargetInfo(area, ecModel); + + if (targetInfo && targetInfo !== true) { + each$1( + targetInfo.coordSyses, + function (coordSys) { + var result = coordConvert[area.brushType](1, coordSys, area.range); + cb(area, result.values, coordSys, ecModel); + } + ); + } + }, this); +}; + +proto$2.setInputRanges = function (areas, ecModel) { + each$20(areas, function (area) { + var targetInfo = this.findTargetInfo(area, ecModel); + + if (__DEV__) { + assert$1( + !targetInfo || targetInfo === true || area.coordRange, + 'coordRange must be specified when coord index specified.' + ); + assert$1( + !targetInfo || targetInfo !== true || area.range, + 'range must be specified in global brush.' + ); + } + + area.range = area.range || []; + + // convert coordRange to global range and set panelId. + if (targetInfo && targetInfo !== true) { + area.panelId = targetInfo.panelId; + // (1) area.range shoule always be calculate from coordRange but does + // not keep its original value, for the sake of the dataZoom scenario, + // where area.coordRange remains unchanged but area.range may be changed. + // (2) Only support converting one coordRange to pixel range in brush + // component. So do not consider `coordRanges`. + // (3) About __rangeOffset, see comment above. + var result = coordConvert[area.brushType](0, targetInfo.coordSys, area.coordRange); + var rangeOffset = area.__rangeOffset; + area.range = rangeOffset + ? diffProcessor[area.brushType]( + result.values, + rangeOffset.offset, + getScales(result.xyMinMax, rangeOffset.xyMinMax) + ) + : result.values; + } + }, this); +}; + +proto$2.makePanelOpts = function (api, getDefaultBrushType) { + return map(this._targetInfoList, function (targetInfo) { + var rect = targetInfo.getPanelRect(); + return { + panelId: targetInfo.panelId, + defaultBrushType: getDefaultBrushType && getDefaultBrushType(targetInfo), + clipPath: makeRectPanelClipPath(rect), + isTargetByCursor: makeRectIsTargetByCursor( + rect, api, targetInfo.coordSysModel + ), + getLinearBrushOtherExtent: makeLinearBrushOtherExtent(rect) + }; + }); +}; + +proto$2.controlSeries = function (area, seriesModel, ecModel) { + // Check whether area is bound in coord, and series do not belong to that coord. + // If do not do this check, some brush (like lineX) will controll all axes. + var targetInfo = this.findTargetInfo(area, ecModel); + return targetInfo === true || ( + targetInfo && indexOf$1(targetInfo.coordSyses, seriesModel.coordinateSystem) >= 0 + ); +}; + +/** + * If return Object, a coord found. + * If reutrn true, global found. + * Otherwise nothing found. + * + * @param {Object} area + * @param {Array} targetInfoList + * @return {Object|boolean} + */ +proto$2.findTargetInfo = function (area, ecModel) { + var targetInfoList = this._targetInfoList; + var foundCpts = parseFinder$1(ecModel, area); + + for (var i = 0; i < targetInfoList.length; i++) { + var targetInfo = targetInfoList[i]; + var areaPanelId = area.panelId; + if (areaPanelId) { + if (targetInfo.panelId === areaPanelId) { + return targetInfo; + } + } + else { + for (var i = 0; i < targetInfoMatchers.length; i++) { + if (targetInfoMatchers[i](foundCpts, targetInfo)) { + return targetInfo; + } + } + } + } + + return true; +}; + +function formatMinMax(minMax) { + minMax[0] > minMax[1] && minMax.reverse(); + return minMax; +} + +function parseFinder$1(ecModel, option) { + return parseFinder( + ecModel, option, {includeMainTypes: INCLUDE_FINDER_MAIN_TYPES} + ); +} + +var targetInfoBuilders = { + + grid: function (foundCpts, targetInfoList) { + var xAxisModels = foundCpts.xAxisModels; + var yAxisModels = foundCpts.yAxisModels; + var gridModels = foundCpts.gridModels; + // Remove duplicated. + var gridModelMap = createHashMap(); + var xAxesHas = {}; + var yAxesHas = {}; + + if (!xAxisModels && !yAxisModels && !gridModels) { + return; + } + + each$20(xAxisModels, function (axisModel) { + var gridModel = axisModel.axis.grid.model; + gridModelMap.set(gridModel.id, gridModel); + xAxesHas[gridModel.id] = true; + }); + each$20(yAxisModels, function (axisModel) { + var gridModel = axisModel.axis.grid.model; + gridModelMap.set(gridModel.id, gridModel); + yAxesHas[gridModel.id] = true; + }); + each$20(gridModels, function (gridModel) { + gridModelMap.set(gridModel.id, gridModel); + xAxesHas[gridModel.id] = true; + yAxesHas[gridModel.id] = true; + }); + + gridModelMap.each(function (gridModel) { + var grid = gridModel.coordinateSystem; + var cartesians = []; + + each$20(grid.getCartesians(), function (cartesian, index) { + if (indexOf$1(xAxisModels, cartesian.getAxis('x').model) >= 0 + || indexOf$1(yAxisModels, cartesian.getAxis('y').model) >= 0 + ) { + cartesians.push(cartesian); + } + }); + targetInfoList.push({ + panelId: 'grid--' + gridModel.id, + gridModel: gridModel, + coordSysModel: gridModel, + // Use the first one as the representitive coordSys. + coordSys: cartesians[0], + coordSyses: cartesians, + getPanelRect: panelRectBuilder.grid, + xAxisDeclared: xAxesHas[gridModel.id], + yAxisDeclared: yAxesHas[gridModel.id] + }); + }); + }, + + geo: function (foundCpts, targetInfoList) { + each$20(foundCpts.geoModels, function (geoModel) { + var coordSys = geoModel.coordinateSystem; + targetInfoList.push({ + panelId: 'geo--' + geoModel.id, + geoModel: geoModel, + coordSysModel: geoModel, + coordSys: coordSys, + coordSyses: [coordSys], + getPanelRect: panelRectBuilder.geo + }); + }); + } +}; + +var targetInfoMatchers = [ + + // grid + function (foundCpts, targetInfo) { + var xAxisModel = foundCpts.xAxisModel; + var yAxisModel = foundCpts.yAxisModel; + var gridModel = foundCpts.gridModel; + + !gridModel && xAxisModel && (gridModel = xAxisModel.axis.grid.model); + !gridModel && yAxisModel && (gridModel = yAxisModel.axis.grid.model); + + return gridModel && gridModel === targetInfo.gridModel; + }, + + // geo + function (foundCpts, targetInfo) { + var geoModel = foundCpts.geoModel; + return geoModel && geoModel === targetInfo.geoModel; + } +]; + +var panelRectBuilder = { + + grid: function () { + // grid is not Transformable. + return this.coordSys.grid.getRect().clone(); + }, + + geo: function () { + var coordSys = this.coordSys; + var rect = coordSys.getBoundingRect().clone(); + // geo roam and zoom transform + rect.applyTransform(getTransform(coordSys)); + return rect; + } +}; + +var coordConvert = { + + lineX: curry$5(axisConvert, 0), + + lineY: curry$5(axisConvert, 1), + + rect: function (to, coordSys, rangeOrCoordRange) { + var xminymin = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][0], rangeOrCoordRange[1][0]]); + var xmaxymax = coordSys[COORD_CONVERTS[to]]([rangeOrCoordRange[0][1], rangeOrCoordRange[1][1]]); + var values = [ + formatMinMax([xminymin[0], xmaxymax[0]]), + formatMinMax([xminymin[1], xmaxymax[1]]) + ]; + return {values: values, xyMinMax: values}; + }, + + polygon: function (to, coordSys, rangeOrCoordRange) { + var xyMinMax = [[Infinity, -Infinity], [Infinity, -Infinity]]; + var values = map(rangeOrCoordRange, function (item) { + var p = coordSys[COORD_CONVERTS[to]](item); + xyMinMax[0][0] = Math.min(xyMinMax[0][0], p[0]); + xyMinMax[1][0] = Math.min(xyMinMax[1][0], p[1]); + xyMinMax[0][1] = Math.max(xyMinMax[0][1], p[0]); + xyMinMax[1][1] = Math.max(xyMinMax[1][1], p[1]); + return p; + }); + return {values: values, xyMinMax: xyMinMax}; + } +}; + +function axisConvert(axisNameIndex, to, coordSys, rangeOrCoordRange) { + if (__DEV__) { + assert$1( + coordSys.type === 'cartesian2d', + 'lineX/lineY brush is available only in cartesian2d.' + ); + } + + var axis = coordSys.getAxis(['x', 'y'][axisNameIndex]); + var values = formatMinMax(map([0, 1], function (i) { + return to + ? axis.coordToData(axis.toLocalCoord(rangeOrCoordRange[i])) + : axis.toGlobalCoord(axis.dataToCoord(rangeOrCoordRange[i])); + })); + var xyMinMax = []; + xyMinMax[axisNameIndex] = values; + xyMinMax[1 - axisNameIndex] = [NaN, NaN]; + + return {values: values, xyMinMax: xyMinMax}; +} + +var diffProcessor = { + lineX: curry$5(axisDiffProcessor, 0), + + lineY: curry$5(axisDiffProcessor, 1), + + rect: function (values, refer, scales) { + return [ + [values[0][0] - scales[0] * refer[0][0], values[0][1] - scales[0] * refer[0][1]], + [values[1][0] - scales[1] * refer[1][0], values[1][1] - scales[1] * refer[1][1]] + ]; + }, + + polygon: function (values, refer, scales) { + return map(values, function (item, idx) { + return [item[0] - scales[0] * refer[idx][0], item[1] - scales[1] * refer[idx][1]]; + }); + } +}; + +function axisDiffProcessor(axisNameIndex, values, refer, scales) { + return [ + values[0] - scales[axisNameIndex] * refer[0], + values[1] - scales[axisNameIndex] * refer[1] + ]; +} + +// We have to process scale caused by dataZoom manually, +// although it might be not accurate. +function getScales(xyMinMaxCurr, xyMinMaxOrigin) { + var sizeCurr = getSize(xyMinMaxCurr); + var sizeOrigin = getSize(xyMinMaxOrigin); + var scales = [sizeCurr[0] / sizeOrigin[0], sizeCurr[1] / sizeOrigin[1]]; + isNaN(scales[0]) && (scales[0] = 1); + isNaN(scales[1]) && (scales[1] = 1); + return scales; +} + +function getSize(xyMinMax) { + return xyMinMax + ? [xyMinMax[0][1] - xyMinMax[0][0], xyMinMax[1][1] - xyMinMax[1][0]] + : [NaN, NaN]; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 STATE_LIST = ['inBrush', 'outOfBrush']; +var DISPATCH_METHOD = '__ecBrushSelect'; +var DISPATCH_FLAG = '__ecInBrushSelectEvent'; +var PRIORITY_BRUSH = PRIORITY.VISUAL.BRUSH; + +/** + * Layout for visual, the priority higher than other layout, and before brush visual. + */ +registerLayout(PRIORITY_BRUSH, function (ecModel, api, payload) { + ecModel.eachComponent({mainType: 'brush'}, function (brushModel) { + + payload && payload.type === 'takeGlobalCursor' && brushModel.setBrushOption( + payload.key === 'brush' ? payload.brushOption : {brushType: false} + ); + + var brushTargetManager = brushModel.brushTargetManager = new BrushTargetManager(brushModel.option, ecModel); + + brushTargetManager.setInputRanges(brushModel.areas, ecModel); + }); +}); + +/** + * Register the visual encoding if this modules required. + */ +registerVisual(PRIORITY_BRUSH, function (ecModel, api, payload) { + + var brushSelected = []; + var throttleType; + var throttleDelay; + + ecModel.eachComponent({mainType: 'brush'}, function (brushModel, brushIndex) { + + var thisBrushSelected = { + brushId: brushModel.id, + brushIndex: brushIndex, + brushName: brushModel.name, + areas: clone(brushModel.areas), + selected: [] + }; + // Every brush component exists in event params, convenient + // for user to find by index. + brushSelected.push(thisBrushSelected); + + var brushOption = brushModel.option; + var brushLink = brushOption.brushLink; + var linkedSeriesMap = []; + var selectedDataIndexForLink = []; + var rangeInfoBySeries = []; + var hasBrushExists = 0; + + if (!brushIndex) { // Only the first throttle setting works. + throttleType = brushOption.throttleType; + throttleDelay = brushOption.throttleDelay; + } + + // Add boundingRect and selectors to range. + var areas = map(brushModel.areas, function (area) { + return bindSelector( + defaults( + {boundingRect: boundingRectBuilders[area.brushType](area)}, + area + ) + ); + }); + + var visualMappings = createVisualMappings( + brushModel.option, STATE_LIST, function (mappingOption) { + mappingOption.mappingMethod = 'fixed'; + } + ); + + isArray(brushLink) && each$1(brushLink, function (seriesIndex) { + linkedSeriesMap[seriesIndex] = 1; + }); + + function linkOthers(seriesIndex) { + return brushLink === 'all' || linkedSeriesMap[seriesIndex]; + } + + // If no supported brush or no brush on the series, + // all visuals should be in original state. + function brushed(rangeInfoList) { + return !!rangeInfoList.length; + } + + /** + * Logic for each series: (If the logic has to be modified one day, do it carefully!) + * + * ( brushed ┬ && ┬hasBrushExist ┬ && linkOthers ) => StepA: ┬record, ┬ StepB: ┬visualByRecord. + * !brushed┘ ├hasBrushExist ┤ └nothing,┘ ├visualByRecord. + * └!hasBrushExist┘ └nothing. + * ( !brushed && ┬hasBrushExist ┬ && linkOthers ) => StepA: nothing, StepB: ┬visualByRecord. + * └!hasBrushExist┘ └nothing. + * ( brushed ┬ && !linkOthers ) => StepA: nothing, StepB: ┬visualByCheck. + * !brushed┘ └nothing. + * ( !brushed && !linkOthers ) => StepA: nothing, StepB: nothing. + */ + + // Step A + ecModel.eachSeries(function (seriesModel, seriesIndex) { + var rangeInfoList = rangeInfoBySeries[seriesIndex] = []; + + seriesModel.subType === 'parallel' + ? stepAParallel(seriesModel, seriesIndex, rangeInfoList) + : stepAOthers(seriesModel, seriesIndex, rangeInfoList); + }); + + function stepAParallel(seriesModel, seriesIndex) { + var coordSys = seriesModel.coordinateSystem; + hasBrushExists |= coordSys.hasAxisBrushed(); + + linkOthers(seriesIndex) && coordSys.eachActiveState( + seriesModel.getData(), + function (activeState, dataIndex) { + activeState === 'active' && (selectedDataIndexForLink[dataIndex] = 1); + } + ); + } + + function stepAOthers(seriesModel, seriesIndex, rangeInfoList) { + var selectorsByBrushType = getSelectorsByBrushType(seriesModel); + if (!selectorsByBrushType || brushModelNotControll(brushModel, seriesIndex)) { + return; + } + + each$1(areas, function (area) { + selectorsByBrushType[area.brushType] + && brushModel.brushTargetManager.controlSeries(area, seriesModel, ecModel) + && rangeInfoList.push(area); + hasBrushExists |= brushed(rangeInfoList); + }); + + if (linkOthers(seriesIndex) && brushed(rangeInfoList)) { + var data = seriesModel.getData(); + data.each(function (dataIndex) { + if (checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex)) { + selectedDataIndexForLink[dataIndex] = 1; + } + }); + } + } + + // Step B + ecModel.eachSeries(function (seriesModel, seriesIndex) { + var seriesBrushSelected = { + seriesId: seriesModel.id, + seriesIndex: seriesIndex, + seriesName: seriesModel.name, + dataIndex: [] + }; + // Every series exists in event params, convenient + // for user to find series by seriesIndex. + thisBrushSelected.selected.push(seriesBrushSelected); + + var selectorsByBrushType = getSelectorsByBrushType(seriesModel); + var rangeInfoList = rangeInfoBySeries[seriesIndex]; + + var data = seriesModel.getData(); + var getValueState = linkOthers(seriesIndex) + ? function (dataIndex) { + return selectedDataIndexForLink[dataIndex] + ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') + : 'outOfBrush'; + } + : function (dataIndex) { + return checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex) + ? (seriesBrushSelected.dataIndex.push(data.getRawIndex(dataIndex)), 'inBrush') + : 'outOfBrush'; + }; + + // If no supported brush or no brush, all visuals are in original state. + (linkOthers(seriesIndex) ? hasBrushExists : brushed(rangeInfoList)) + && applyVisual( + STATE_LIST, visualMappings, data, getValueState + ); + }); + + }); + + dispatchAction(api, throttleType, throttleDelay, brushSelected, payload); +}); + +function dispatchAction(api, throttleType, throttleDelay, brushSelected, payload) { + // This event will not be triggered when `setOpion`, otherwise dead lock may + // triggered when do `setOption` in event listener, which we do not find + // satisfactory way to solve yet. Some considered resolutions: + // (a) Diff with prevoius selected data ant only trigger event when changed. + // But store previous data and diff precisely (i.e., not only by dataIndex, but + // also detect value changes in selected data) might bring complexity or fragility. + // (b) Use spectial param like `silent` to suppress event triggering. + // But such kind of volatile param may be weird in `setOption`. + if (!payload) { + return; + } + + var zr = api.getZr(); + if (zr[DISPATCH_FLAG]) { + return; + } + + if (!zr[DISPATCH_METHOD]) { + zr[DISPATCH_METHOD] = doDispatch; + } + + var fn = createOrUpdate(zr, DISPATCH_METHOD, throttleDelay, throttleType); + + fn(api, brushSelected); +} + +function doDispatch(api, brushSelected) { + if (!api.isDisposed()) { + var zr = api.getZr(); + zr[DISPATCH_FLAG] = true; + api.dispatchAction({ + type: 'brushSelect', + batch: brushSelected + }); + zr[DISPATCH_FLAG] = false; + } +} + +function checkInRange(selectorsByBrushType, rangeInfoList, data, dataIndex) { + for (var i = 0, len = rangeInfoList.length; i < len; i++) { + var area = rangeInfoList[i]; + if (selectorsByBrushType[area.brushType]( + dataIndex, data, area.selectors, area + )) { + return true; + } + } +} + +function getSelectorsByBrushType(seriesModel) { + var brushSelector = seriesModel.brushSelector; + if (isString(brushSelector)) { + var sels = []; + each$1(selector, function (selectorsByElementType, brushType) { + sels[brushType] = function (dataIndex, data, selectors, area) { + var itemLayout = data.getItemLayout(dataIndex); + return selectorsByElementType[brushSelector](itemLayout, selectors, area); + }; + }); + return sels; + } + else if (isFunction$1(brushSelector)) { + var bSelector = {}; + each$1(selector, function (sel, brushType) { + bSelector[brushType] = brushSelector; + }); + return bSelector; + } + return brushSelector; +} + +function brushModelNotControll(brushModel, seriesIndex) { + var seriesIndices = brushModel.option.seriesIndex; + return seriesIndices != null + && seriesIndices !== 'all' + && ( + isArray(seriesIndices) + ? indexOf(seriesIndices, seriesIndex) < 0 + : seriesIndex !== seriesIndices + ); +} + +function bindSelector(area) { + var selectors = area.selectors = {}; + each$1(selector[area.brushType], function (selFn, elType) { + // Do not use function binding or curry for performance. + selectors[elType] = function (itemLayout) { + return selFn(itemLayout, selectors, area); + }; + }); + return area; +} + +var boundingRectBuilders = { + + lineX: noop, + + lineY: noop, + + rect: function (area) { + return getBoundingRectFromMinMax(area.range); + }, + + polygon: function (area) { + var minMax; + var range = area.range; + + for (var i = 0, len = range.length; i < len; i++) { + minMax = minMax || [[Infinity, -Infinity], [Infinity, -Infinity]]; + var rg = range[i]; + rg[0] < minMax[0][0] && (minMax[0][0] = rg[0]); + rg[0] > minMax[0][1] && (minMax[0][1] = rg[0]); + rg[1] < minMax[1][0] && (minMax[1][0] = rg[1]); + rg[1] > minMax[1][1] && (minMax[1][1] = rg[1]); + } + + return minMax && getBoundingRectFromMinMax(minMax); + } +}; + +function getBoundingRectFromMinMax(minMax) { + return new BoundingRect( + minMax[0][0], + minMax[1][0], + minMax[0][1] - minMax[0][0], + minMax[1][1] - minMax[1][0] + ); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 DEFAULT_OUT_OF_BRUSH_COLOR = ['#ddd']; + +var BrushModel = extendComponentModel({ + + type: 'brush', + + dependencies: ['geo', 'grid', 'xAxis', 'yAxis', 'parallel', 'series'], + + /** + * @protected + */ + defaultOption: { + // inBrush: null, + // outOfBrush: null, + toolbox: null, // Default value see preprocessor. + brushLink: null, // Series indices array, broadcast using dataIndex. + // or 'all', which means all series. 'none' or null means no series. + seriesIndex: 'all', // seriesIndex array, specify series controlled by this brush component. + geoIndex: null, // + xAxisIndex: null, + yAxisIndex: null, + + brushType: 'rect', // Default brushType, see BrushController. + brushMode: 'single', // Default brushMode, 'single' or 'multiple' + transformable: true, // Default transformable. + brushStyle: { // Default brushStyle + borderWidth: 1, + color: 'rgba(120,140,180,0.3)', + borderColor: 'rgba(120,140,180,0.8)' + }, + + throttleType: 'fixRate',// Throttle in brushSelected event. 'fixRate' or 'debounce'. + // If null, no throttle. Valid only in the first brush component + throttleDelay: 0, // Unit: ms, 0 means every event will be triggered. + + // FIXME + // 试验效果 + removeOnClick: true, + + z: 10000 + }, + + /** + * @readOnly + * @type {Array.} + */ + areas: [], + + /** + * Current activated brush type. + * If null, brush is inactived. + * see module:echarts/component/helper/BrushController + * @readOnly + * @type {string} + */ + brushType: null, + + /** + * Current brush opt. + * see module:echarts/component/helper/BrushController + * @readOnly + * @type {Object} + */ + brushOption: {}, + + /** + * @readOnly + * @type {Array.} + */ + coordInfoList: [], + + optionUpdated: function (newOption, isInit) { + var thisOption = this.option; + + !isInit && replaceVisualOption( + thisOption, newOption, ['inBrush', 'outOfBrush'] + ); + + var inBrush = thisOption.inBrush = thisOption.inBrush || {}; + // Always give default visual, consider setOption at the second time. + thisOption.outOfBrush = thisOption.outOfBrush || {color: DEFAULT_OUT_OF_BRUSH_COLOR}; + + if (!inBrush.hasOwnProperty('liftZ')) { + // Bigger than the highlight z lift, otherwise it will + // be effected by the highlight z when brush. + inBrush.liftZ = 5; + } + }, + + /** + * If ranges is null/undefined, range state remain. + * + * @param {Array.} [ranges] + */ + setAreas: function (areas) { + if (__DEV__) { + assert$1(isArray(areas)); + each$1(areas, function (area) { + assert$1(area.brushType, 'Illegal areas'); + }); + } + + // If ranges is null/undefined, range state remain. + // This helps user to dispatchAction({type: 'brush'}) with no areas + // set but just want to get the current brush select info from a `brush` event. + if (!areas) { + return; + } + + this.areas = map(areas, function (area) { + return generateBrushOption(this.option, area); + }, this); + }, + + /** + * see module:echarts/component/helper/BrushController + * @param {Object} brushOption + */ + setBrushOption: function (brushOption) { + this.brushOption = generateBrushOption(this.option, brushOption); + this.brushType = this.brushOption.brushType; + } + +}); + +function generateBrushOption(option, brushOption) { + return merge( + { + brushType: option.brushType, + brushMode: option.brushMode, + transformable: option.transformable, + brushStyle: new Model(option.brushStyle).getItemStyle(), + removeOnClick: option.removeOnClick, + z: option.z + }, + brushOption, + true + ); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +extendComponentView({ + + type: 'brush', + + 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/brush/BrushModel} + */ + this.model; + + /** + * @private + * @type {module:echarts/component/helper/BrushController} + */ + (this._brushController = new BrushController(api.getZr())) + .on('brush', bind(this._onBrush, this)) + .mount(); + }, + + /** + * @override + */ + render: function (brushModel) { + this.model = brushModel; + return updateController.apply(this, arguments); + }, + + /** + * @override + */ + updateTransform: updateController, + + /** + * @override + */ + updateView: updateController, + + // /** + // * @override + // */ + // updateLayout: updateController, + + // /** + // * @override + // */ + // updateVisual: updateController, + + /** + * @override + */ + dispose: function () { + this._brushController.dispose(); + }, + + /** + * @private + */ + _onBrush: function (areas, opt) { + var modelId = this.model.id; + + this.model.brushTargetManager.setOutputRanges(areas, this.ecModel); + + // Action is not dispatched on drag end, because the drag end + // emits the same params with the last drag move event, and + // may have some delay when using touch pad, which makes + // animation not smooth (when using debounce). + (!opt.isEnd || opt.removeOnClick) && this.api.dispatchAction({ + type: 'brush', + brushId: modelId, + areas: clone(areas), + $from: modelId + }); + } + +}); + +function updateController(brushModel, ecModel, api, payload) { + // Do not update controller when drawing. + (!payload || payload.$from !== brushModel.id) && this._brushController + .setPanels(brushModel.brushTargetManager.makePanelOpts(api)) + .enableBrush(brushModel.brushOption) + .updateCovers(brushModel.areas.slice()); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * payload: { + * brushIndex: number, or, + * brushId: string, or, + * brushName: string, + * globalRanges: Array + * } + */ +registerAction( + {type: 'brush', event: 'brush' /*, update: 'updateView' */}, + function (payload, ecModel) { + ecModel.eachComponent({mainType: 'brush', query: payload}, function (brushModel) { + brushModel.setAreas(payload.areas); + }); + } +); + +/** + * payload: { + * brushComponents: [ + * { + * brushId, + * brushIndex, + * brushName, + * series: [ + * { + * seriesId, + * seriesIndex, + * seriesName, + * rawIndices: [21, 34, ...] + * }, + * ... + * ] + * }, + * ... + * ] + * } + */ +registerAction( + {type: 'brushSelect', event: 'brushSelected', update: 'none'}, + function () {} +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 features = {}; + +function register$1(name, ctor) { + features[name] = ctor; +} + +function get$1(name) { + return features[name]; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 brushLang = lang.toolbox.brush; + +function Brush(model, ecModel, api) { + this.model = model; + this.ecModel = ecModel; + this.api = api; + + /** + * @private + * @type {string} + */ + this._brushType; + + /** + * @private + * @type {string} + */ + this._brushMode; +} + +Brush.defaultOption = { + show: true, + type: ['rect', 'polygon', 'lineX', 'lineY', 'keep', 'clear'], + icon: { + rect: 'M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13', // jshint ignore:line + polygon: 'M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2', // jshint ignore:line + lineX: 'M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4', // jshint ignore:line + lineY: 'M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4', // jshint ignore:line + keep: 'M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z', // jshint ignore:line + clear: 'M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2' // jshint ignore:line + }, + // `rect`, `polygon`, `lineX`, `lineY`, `keep`, `clear` + title: clone(brushLang.title) +}; + +var proto$3 = Brush.prototype; + +// proto.updateLayout = function (featureModel, ecModel, api) { +proto$3.render = +proto$3.updateView = function (featureModel, ecModel, api) { + var brushType; + var brushMode; + var isBrushed; + + ecModel.eachComponent({mainType: 'brush'}, function (brushModel) { + brushType = brushModel.brushType; + brushMode = brushModel.brushOption.brushMode || 'single'; + isBrushed |= brushModel.areas.length; + }); + this._brushType = brushType; + this._brushMode = brushMode; + + each$1(featureModel.get('type', true), function (type) { + featureModel.setIconStatus( + type, + ( + type === 'keep' + ? brushMode === 'multiple' + : type === 'clear' + ? isBrushed + : type === brushType + ) ? 'emphasis' : 'normal' + ); + }); +}; + +proto$3.getIcons = function () { + var model = this.model; + var availableIcons = model.get('icon', true); + var icons = {}; + each$1(model.get('type', true), function (type) { + if (availableIcons[type]) { + icons[type] = availableIcons[type]; + } + }); + return icons; +}; + +proto$3.onclick = function (ecModel, api, type) { + var brushType = this._brushType; + var brushMode = this._brushMode; + + if (type === 'clear') { + // Trigger parallel action firstly + api.dispatchAction({ + type: 'axisAreaSelect', + intervals: [] + }); + + api.dispatchAction({ + type: 'brush', + command: 'clear', + // Clear all areas of all brush components. + areas: [] + }); + } + else { + api.dispatchAction({ + type: 'takeGlobalCursor', + key: 'brush', + brushOption: { + brushType: type === 'keep' + ? brushType + : (brushType === type ? false : type), + brushMode: type === 'keep' + ? (brushMode === 'multiple' ? 'single' : 'multiple') + : brushMode + } + }); + } +}; + +register$1('brush', Brush); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Brush component entry + */ + +registerPreprocessor(preprocessor$1); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// (24*60*60*1000) +var PROXIMATE_ONE_DAY = 86400000; + +/** + * Calendar + * + * @constructor + * + * @param {Object} calendarModel calendarModel + * @param {Object} ecModel ecModel + * @param {Object} api api + */ +function Calendar(calendarModel, ecModel, api) { + this._model = calendarModel; +} + +Calendar.prototype = { + + constructor: Calendar, + + type: 'calendar', + + dimensions: ['time', 'value'], + + // Required in createListFromData + getDimensionsInfo: function () { + return [{name: 'time', type: 'time'}, 'value']; + }, + + getRangeInfo: function () { + return this._rangeInfo; + }, + + getModel: function () { + return this._model; + }, + + getRect: function () { + return this._rect; + }, + + getCellWidth: function () { + return this._sw; + }, + + getCellHeight: function () { + return this._sh; + }, + + getOrient: function () { + return this._orient; + }, + + /** + * getFirstDayOfWeek + * + * @example + * 0 : start at Sunday + * 1 : start at Monday + * + * @return {number} + */ + getFirstDayOfWeek: function () { + return this._firstDayOfWeek; + }, + + /** + * get date info + * + * @param {string|number} date date + * @return {Object} + * { + * y: string, local full year, eg., '1940', + * m: string, local month, from '01' ot '12', + * d: string, local date, from '01' to '31' (if exists), + * day: It is not date.getDay(). It is the location of the cell in a week, from 0 to 6, + * time: timestamp, + * formatedDate: string, yyyy-MM-dd, + * date: original date object. + * } + */ + getDateInfo: function (date) { + + date = parseDate(date); + + var y = date.getFullYear(); + + var m = date.getMonth() + 1; + m = m < 10 ? '0' + m : m; + + var d = date.getDate(); + d = d < 10 ? '0' + d : d; + + var day = date.getDay(); + + day = Math.abs((day + 7 - this.getFirstDayOfWeek()) % 7); + + return { + y: y, + m: m, + d: d, + day: day, + time: date.getTime(), + formatedDate: y + '-' + m + '-' + d, + date: date + }; + }, + + getNextNDay: function (date, n) { + n = n || 0; + if (n === 0) { + return this.getDateInfo(date); + } + + date = new Date(this.getDateInfo(date).time); + date.setDate(date.getDate() + n); + + return this.getDateInfo(date); + }, + + update: function (ecModel, api) { + + this._firstDayOfWeek = +this._model.getModel('dayLabel').get('firstDay'); + this._orient = this._model.get('orient'); + this._lineWidth = this._model.getModel('itemStyle').getItemStyle().lineWidth || 0; + + + this._rangeInfo = this._getRangeInfo(this._initRangeOption()); + var weeks = this._rangeInfo.weeks || 1; + var whNames = ['width', 'height']; + var cellSize = this._model.get('cellSize').slice(); + var layoutParams = this._model.getBoxLayoutParams(); + var cellNumbers = this._orient === 'horizontal' ? [weeks, 7] : [7, weeks]; + + each$1([0, 1], function (idx) { + if (cellSizeSpecified(cellSize, idx)) { + layoutParams[whNames[idx]] = cellSize[idx] * cellNumbers[idx]; + } + }); + + var whGlobal = { + width: api.getWidth(), + height: api.getHeight() + }; + var calendarRect = this._rect = getLayoutRect(layoutParams, whGlobal); + + each$1([0, 1], function (idx) { + if (!cellSizeSpecified(cellSize, idx)) { + cellSize[idx] = calendarRect[whNames[idx]] / cellNumbers[idx]; + } + }); + + function cellSizeSpecified(cellSize, idx) { + return cellSize[idx] != null && cellSize[idx] !== 'auto'; + } + + this._sw = cellSize[0]; + this._sh = cellSize[1]; + }, + + + /** + * Convert a time data(time, value) item to (x, y) point. + * + * @override + * @param {Array|number} data data + * @param {boolean} [clamp=true] out of range + * @return {Array} point + */ + dataToPoint: function (data, clamp) { + isArray(data) && (data = data[0]); + clamp == null && (clamp = true); + + var dayInfo = this.getDateInfo(data); + var range = this._rangeInfo; + var date = dayInfo.formatedDate; + + // if not in range return [NaN, NaN] + if (clamp && !( + dayInfo.time >= range.start.time + && dayInfo.time < range.end.time + PROXIMATE_ONE_DAY + )) { + return [NaN, NaN]; + } + + var week = dayInfo.day; + var nthWeek = this._getRangeInfo([range.start.time, date]).nthWeek; + + if (this._orient === 'vertical') { + return [ + this._rect.x + week * this._sw + this._sw / 2, + this._rect.y + nthWeek * this._sh + this._sh / 2 + ]; + + } + + return [ + this._rect.x + nthWeek * this._sw + this._sw / 2, + this._rect.y + week * this._sh + this._sh / 2 + ]; + + }, + + /** + * Convert a (x, y) point to time data + * + * @override + * @param {string} point point + * @return {string} data + */ + pointToData: function (point) { + + var date = this.pointToDate(point); + + return date && date.time; + }, + + /** + * Convert a time date item to (x, y) four point. + * + * @param {Array} data date[0] is date + * @param {boolean} [clamp=true] out of range + * @return {Object} point + */ + dataToRect: function (data, clamp) { + var point = this.dataToPoint(data, clamp); + + return { + contentShape: { + x: point[0] - (this._sw - this._lineWidth) / 2, + y: point[1] - (this._sh - this._lineWidth) / 2, + width: this._sw - this._lineWidth, + height: this._sh - this._lineWidth + }, + + center: point, + + tl: [ + point[0] - this._sw / 2, + point[1] - this._sh / 2 + ], + + tr: [ + point[0] + this._sw / 2, + point[1] - this._sh / 2 + ], + + br: [ + point[0] + this._sw / 2, + point[1] + this._sh / 2 + ], + + bl: [ + point[0] - this._sw / 2, + point[1] + this._sh / 2 + ] + + }; + }, + + /** + * Convert a (x, y) point to time date + * + * @param {Array} point point + * @return {Object} date + */ + pointToDate: function (point) { + var nthX = Math.floor((point[0] - this._rect.x) / this._sw) + 1; + var nthY = Math.floor((point[1] - this._rect.y) / this._sh) + 1; + var range = this._rangeInfo.range; + + if (this._orient === 'vertical') { + return this._getDateByWeeksAndDay(nthY, nthX - 1, range); + } + + return this._getDateByWeeksAndDay(nthX, nthY - 1, range); + }, + + /** + * @inheritDoc + */ + convertToPixel: curry(doConvert$2, 'dataToPoint'), + + /** + * @inheritDoc + */ + convertFromPixel: curry(doConvert$2, 'pointToData'), + + /** + * initRange + * + * @private + * @return {Array} [start, end] + */ + _initRangeOption: function () { + var range = this._model.get('range'); + + var rg = range; + + if (isArray(rg) && rg.length === 1) { + rg = rg[0]; + } + + if (/^\d{4}$/.test(rg)) { + range = [rg + '-01-01', rg + '-12-31']; + } + + if (/^\d{4}[\/|-]\d{1,2}$/.test(rg)) { + + var start = this.getDateInfo(rg); + var firstDay = start.date; + firstDay.setMonth(firstDay.getMonth() + 1); + + var end = this.getNextNDay(firstDay, -1); + range = [start.formatedDate, end.formatedDate]; + } + + if (/^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(rg)) { + range = [rg, rg]; + } + + var tmp = this._getRangeInfo(range); + + if (tmp.start.time > tmp.end.time) { + range.reverse(); + } + + return range; + }, + + /** + * range info + * + * @private + * @param {Array} range range ['2017-01-01', '2017-07-08'] + * If range[0] > range[1], they will not be reversed. + * @return {Object} obj + */ + _getRangeInfo: function (range) { + range = [ + this.getDateInfo(range[0]), + this.getDateInfo(range[1]) + ]; + + var reversed; + if (range[0].time > range[1].time) { + reversed = true; + range.reverse(); + } + + var allDay = Math.floor(range[1].time / PROXIMATE_ONE_DAY) + - Math.floor(range[0].time / PROXIMATE_ONE_DAY) + 1; + + // Consider case: + // Firstly set system timezone as "Time Zone: America/Toronto", + // ``` + // var first = new Date(1478412000000 - 3600 * 1000 * 2.5); + // var second = new Date(1478412000000); + // var allDays = Math.floor(second / ONE_DAY) - Math.floor(first / ONE_DAY) + 1; + // ``` + // will get wrong result because of DST. So we should fix it. + var date = new Date(range[0].time); + var startDateNum = date.getDate(); + var endDateNum = range[1].date.getDate(); + date.setDate(startDateNum + allDay - 1); + // The bias can not over a month, so just compare date. + if (date.getDate() !== endDateNum) { + var sign = date.getTime() - range[1].time > 0 ? 1 : -1; + while (date.getDate() !== endDateNum && (date.getTime() - range[1].time) * sign > 0) { + allDay -= sign; + date.setDate(startDateNum + allDay - 1); + } + } + + var weeks = Math.floor((allDay + range[0].day + 6) / 7); + var nthWeek = reversed ? -weeks + 1: weeks - 1; + + reversed && range.reverse(); + + return { + range: [range[0].formatedDate, range[1].formatedDate], + start: range[0], + end: range[1], + allDay: allDay, + weeks: weeks, + // From 0. + nthWeek: nthWeek, + fweek: range[0].day, + lweek: range[1].day + }; + }, + + /** + * get date by nthWeeks and week day in range + * + * @private + * @param {number} nthWeek the week + * @param {number} day the week day + * @param {Array} range [d1, d2] + * @return {Object} + */ + _getDateByWeeksAndDay: function (nthWeek, day, range) { + var rangeInfo = this._getRangeInfo(range); + + if (nthWeek > rangeInfo.weeks + || (nthWeek === 0 && day < rangeInfo.fweek) + || (nthWeek === rangeInfo.weeks && day > rangeInfo.lweek) + ) { + return false; + } + + var nthDay = (nthWeek - 1) * 7 - rangeInfo.fweek + day; + var date = new Date(rangeInfo.start.time); + date.setDate(rangeInfo.start.d + nthDay); + + return this.getDateInfo(date); + } +}; + +Calendar.dimensions = Calendar.prototype.dimensions; + +Calendar.getDimensionsInfo = Calendar.prototype.getDimensionsInfo; + +Calendar.create = function (ecModel, api) { + var calendarList = []; + + ecModel.eachComponent('calendar', function (calendarModel) { + var calendar = new Calendar(calendarModel, ecModel, api); + calendarList.push(calendar); + calendarModel.coordinateSystem = calendar; + }); + + ecModel.eachSeries(function (calendarSeries) { + if (calendarSeries.get('coordinateSystem') === 'calendar') { + // Inject coordinate system + calendarSeries.coordinateSystem = calendarList[calendarSeries.get('calendarIndex') || 0]; + } + }); + return calendarList; +}; + +function doConvert$2(methodName, ecModel, finder, value) { + var calendarModel = finder.calendarModel; + var seriesModel = finder.seriesModel; + + var coordSys = calendarModel + ? calendarModel.coordinateSystem + : seriesModel + ? seriesModel.coordinateSystem + : null; + + return coordSys === this ? coordSys[methodName](value) : null; +} + +CoordinateSystemManager.register('calendar', Calendar); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 CalendarModel = ComponentModel.extend({ + + type: 'calendar', + + /** + * @type {module:echarts/coord/calendar/Calendar} + */ + coordinateSystem: null, + + defaultOption: { + zlevel: 0, + z: 2, + left: 80, + top: 60, + + cellSize: 20, + + // horizontal vertical + orient: 'horizontal', + + // month separate line style + splitLine: { + show: true, + lineStyle: { + color: '#000', + width: 1, + type: 'solid' + } + }, + + // rect style temporarily unused emphasis + itemStyle: { + color: '#fff', + borderWidth: 1, + borderColor: '#ccc' + }, + + // week text style + dayLabel: { + show: true, + + // a week first day + firstDay: 0, + + // start end + position: 'start', + margin: '50%', // 50% of cellSize + nameMap: 'en', + color: '#000' + }, + + // month text style + monthLabel: { + show: true, + + // start end + position: 'start', + margin: 5, + + // center or left + align: 'center', + + // cn en [] + nameMap: 'en', + formatter: null, + color: '#000' + }, + + // year text style + yearLabel: { + show: true, + + // top bottom left right + position: null, + margin: 30, + formatter: null, + color: '#ccc', + fontFamily: 'sans-serif', + fontWeight: 'bolder', + fontSize: 20 + } + }, + + /** + * @override + */ + init: function (option, parentModel, ecModel, extraOpt) { + var inputPositionParams = getLayoutParams(option); + + CalendarModel.superApply(this, 'init', arguments); + + mergeAndNormalizeLayoutParams$1(option, inputPositionParams); + }, + + /** + * @override + */ + mergeOption: function (option, extraOpt) { + CalendarModel.superApply(this, 'mergeOption', arguments); + + mergeAndNormalizeLayoutParams$1(this.option, option); + } +}); + +function mergeAndNormalizeLayoutParams$1(target, raw) { + // Normalize cellSize + var cellSize = target.cellSize; + + if (!isArray(cellSize)) { + cellSize = target.cellSize = [cellSize, cellSize]; + } + else if (cellSize.length === 1) { + cellSize[1] = cellSize[0]; + } + + var ignoreSize = map([0, 1], function (hvIdx) { + // If user have set `width` or both `left` and `right`, cellSize + // will be automatically set to 'auto', otherwise the default + // setting of cellSize will make `width` setting not work. + if (sizeCalculable(raw, hvIdx)) { + cellSize[hvIdx] = 'auto'; + } + return cellSize[hvIdx] != null && cellSize[hvIdx] !== 'auto'; + }); + + mergeLayoutParam(target, raw, { + type: 'box', ignoreSize: ignoreSize + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 MONTH_TEXT = { + EN: [ + 'Jan', 'Feb', 'Mar', + 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec' + ], + CN: [ + '一月', '二月', '三月', + '四月', '五月', '六月', + '七月', '八月', '九月', + '十月', '十一月', '十二月' + ] +}; + +var WEEK_TEXT = { + EN: ['S', 'M', 'T', 'W', 'T', 'F', 'S'], + CN: ['日', '一', '二', '三', '四', '五', '六'] +}; + +extendComponentView({ + + type: 'calendar', + + /** + * top/left line points + * @private + */ + _tlpoints: null, + + /** + * bottom/right line points + * @private + */ + _blpoints: null, + + /** + * first day of month + * @private + */ + _firstDayOfMonth: null, + + /** + * first day point of month + * @private + */ + _firstDayPoints: null, + + render: function (calendarModel, ecModel, api) { + + var group = this.group; + + group.removeAll(); + + var coordSys = calendarModel.coordinateSystem; + + // range info + var rangeData = coordSys.getRangeInfo(); + var orient = coordSys.getOrient(); + + this._renderDayRect(calendarModel, rangeData, group); + + // _renderLines must be called prior to following function + this._renderLines(calendarModel, rangeData, orient, group); + + this._renderYearText(calendarModel, rangeData, orient, group); + + this._renderMonthText(calendarModel, orient, group); + + this._renderWeekText(calendarModel, rangeData, orient, group); + }, + + // render day rect + _renderDayRect: function (calendarModel, rangeData, group) { + var coordSys = calendarModel.coordinateSystem; + var itemRectStyleModel = calendarModel.getModel('itemStyle').getItemStyle(); + var sw = coordSys.getCellWidth(); + var sh = coordSys.getCellHeight(); + + for (var i = rangeData.start.time; + i <= rangeData.end.time; + i = coordSys.getNextNDay(i, 1).time + ) { + + var point = coordSys.dataToRect([i], false).tl; + + // every rect + var rect = new Rect({ + shape: { + x: point[0], + y: point[1], + width: sw, + height: sh + }, + cursor: 'default', + style: itemRectStyleModel + }); + + group.add(rect); + } + + }, + + // render separate line + _renderLines: function (calendarModel, rangeData, orient, group) { + + var self = this; + + var coordSys = calendarModel.coordinateSystem; + + var lineStyleModel = calendarModel.getModel('splitLine.lineStyle').getLineStyle(); + var show = calendarModel.get('splitLine.show'); + + var lineWidth = lineStyleModel.lineWidth; + + this._tlpoints = []; + this._blpoints = []; + this._firstDayOfMonth = []; + this._firstDayPoints = []; + + + var firstDay = rangeData.start; + + for (var i = 0; firstDay.time <= rangeData.end.time; i++) { + addPoints(firstDay.formatedDate); + + if (i === 0) { + firstDay = coordSys.getDateInfo(rangeData.start.y + '-' + rangeData.start.m); + } + + var date = firstDay.date; + date.setMonth(date.getMonth() + 1); + firstDay = coordSys.getDateInfo(date); + } + + addPoints(coordSys.getNextNDay(rangeData.end.time, 1).formatedDate); + + function addPoints(date) { + + self._firstDayOfMonth.push(coordSys.getDateInfo(date)); + self._firstDayPoints.push(coordSys.dataToRect([date], false).tl); + + var points = self._getLinePointsOfOneWeek(calendarModel, date, orient); + + self._tlpoints.push(points[0]); + self._blpoints.push(points[points.length - 1]); + + show && self._drawSplitline(points, lineStyleModel, group); + } + + + // render top/left line + show && this._drawSplitline(self._getEdgesPoints(self._tlpoints, lineWidth, orient), lineStyleModel, group); + + // render bottom/right line + show && this._drawSplitline(self._getEdgesPoints(self._blpoints, lineWidth, orient), lineStyleModel, group); + + }, + + // get points at both ends + _getEdgesPoints: function (points, lineWidth, orient) { + var rs = [points[0].slice(), points[points.length - 1].slice()]; + var idx = orient === 'horizontal' ? 0 : 1; + + // both ends of the line are extend half lineWidth + rs[0][idx] = rs[0][idx] - lineWidth / 2; + rs[1][idx] = rs[1][idx] + lineWidth / 2; + + return rs; + }, + + // render split line + _drawSplitline: function (points, lineStyleModel, group) { + + var poyline = new Polyline({ + z2: 20, + shape: { + points: points + }, + style: lineStyleModel + }); + + group.add(poyline); + }, + + // render month line of one week points + _getLinePointsOfOneWeek: function (calendarModel, date, orient) { + + var coordSys = calendarModel.coordinateSystem; + date = coordSys.getDateInfo(date); + + var points = []; + + for (var i = 0; i < 7; i++) { + + var tmpD = coordSys.getNextNDay(date.time, i); + var point = coordSys.dataToRect([tmpD.time], false); + + points[2 * tmpD.day] = point.tl; + points[2 * tmpD.day + 1] = point[orient === 'horizontal' ? 'bl' : 'tr']; + } + + return points; + + }, + + _formatterLabel: function (formatter, params) { + + if (typeof formatter === 'string' && formatter) { + return formatTplSimple(formatter, params); + } + + if (typeof formatter === 'function') { + return formatter(params); + } + + return params.nameMap; + + }, + + _yearTextPositionControl: function (textEl, point, orient, position, margin) { + + point = point.slice(); + var aligns = ['center', 'bottom']; + + if (position === 'bottom') { + point[1] += margin; + aligns = ['center', 'top']; + } + else if (position === 'left') { + point[0] -= margin; + } + else if (position === 'right') { + point[0] += margin; + aligns = ['center', 'top']; + } + else { // top + point[1] -= margin; + } + + var rotate = 0; + if (position === 'left' || position === 'right') { + rotate = Math.PI / 2; + } + + return { + rotation: rotate, + position: point, + style: { + textAlign: aligns[0], + textVerticalAlign: aligns[1] + } + }; + }, + + // render year + _renderYearText: function (calendarModel, rangeData, orient, group) { + var yearLabel = calendarModel.getModel('yearLabel'); + + if (!yearLabel.get('show')) { + return; + } + + var margin = yearLabel.get('margin'); + var pos = yearLabel.get('position'); + + if (!pos) { + pos = orient !== 'horizontal' ? 'top' : 'left'; + } + + var points = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]]; + var xc = (points[0][0] + points[1][0]) / 2; + var yc = (points[0][1] + points[1][1]) / 2; + + var idx = orient === 'horizontal' ? 0 : 1; + + var posPoints = { + top: [xc, points[idx][1]], + bottom: [xc, points[1 - idx][1]], + left: [points[1 - idx][0], yc], + right: [points[idx][0], yc] + }; + + var name = rangeData.start.y; + + if (+rangeData.end.y > +rangeData.start.y) { + name = name + '-' + rangeData.end.y; + } + + var formatter = yearLabel.get('formatter'); + + var params = { + start: rangeData.start.y, + end: rangeData.end.y, + nameMap: name + }; + + var content = this._formatterLabel(formatter, params); + + var yearText = new Text({z2: 30}); + setTextStyle(yearText.style, yearLabel, {text: content}), + yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin)); + + group.add(yearText); + }, + + _monthTextPositionControl: function (point, isCenter, orient, position, margin) { + var align = 'left'; + var vAlign = 'top'; + var x = point[0]; + var y = point[1]; + + if (orient === 'horizontal') { + y = y + margin; + + if (isCenter) { + align = 'center'; + } + + if (position === 'start') { + vAlign = 'bottom'; + } + } + else { + x = x + margin; + + if (isCenter) { + vAlign = 'middle'; + } + + if (position === 'start') { + align = 'right'; + } + } + + return { + x: x, + y: y, + textAlign: align, + textVerticalAlign: vAlign + }; + }, + + // render month and year text + _renderMonthText: function (calendarModel, orient, group) { + var monthLabel = calendarModel.getModel('monthLabel'); + + if (!monthLabel.get('show')) { + return; + } + + var nameMap = monthLabel.get('nameMap'); + var margin = monthLabel.get('margin'); + var pos = monthLabel.get('position'); + var align = monthLabel.get('align'); + + var termPoints = [this._tlpoints, this._blpoints]; + + if (isString(nameMap)) { + nameMap = MONTH_TEXT[nameMap.toUpperCase()] || []; + } + + var idx = pos === 'start' ? 0 : 1; + var axis = orient === 'horizontal' ? 0 : 1; + margin = pos === 'start' ? -margin : margin; + var isCenter = (align === 'center'); + + for (var i = 0; i < termPoints[idx].length - 1; i++) { + + var tmp = termPoints[idx][i].slice(); + var firstDay = this._firstDayOfMonth[i]; + + if (isCenter) { + var firstDayPoints = this._firstDayPoints[i]; + tmp[axis] = (firstDayPoints[axis] + termPoints[0][i + 1][axis]) / 2; + } + + var formatter = monthLabel.get('formatter'); + var name = nameMap[+firstDay.m - 1]; + var params = { + yyyy: firstDay.y, + yy: (firstDay.y + '').slice(2), + MM: firstDay.m, + M: +firstDay.m, + nameMap: name + }; + + var content = this._formatterLabel(formatter, params); + + var monthText = new Text({z2: 30}); + extend( + setTextStyle(monthText.style, monthLabel, {text: content}), + this._monthTextPositionControl(tmp, isCenter, orient, pos, margin) + ); + + group.add(monthText); + } + }, + + _weekTextPositionControl: function (point, orient, position, margin, cellSize) { + var align = 'center'; + var vAlign = 'middle'; + var x = point[0]; + var y = point[1]; + var isStart = position === 'start'; + + if (orient === 'horizontal') { + x = x + margin + (isStart ? 1 : -1) * cellSize[0] / 2; + align = isStart ? 'right' : 'left'; + } + else { + y = y + margin + (isStart ? 1 : -1) * cellSize[1] / 2; + vAlign = isStart ? 'bottom' : 'top'; + } + + return { + x: x, + y: y, + textAlign: align, + textVerticalAlign: vAlign + }; + }, + + // render weeks + _renderWeekText: function (calendarModel, rangeData, orient, group) { + var dayLabel = calendarModel.getModel('dayLabel'); + + if (!dayLabel.get('show')) { + return; + } + + var coordSys = calendarModel.coordinateSystem; + var pos = dayLabel.get('position'); + var nameMap = dayLabel.get('nameMap'); + var margin = dayLabel.get('margin'); + var firstDayOfWeek = coordSys.getFirstDayOfWeek(); + + if (isString(nameMap)) { + nameMap = WEEK_TEXT[nameMap.toUpperCase()] || []; + } + + var start = coordSys.getNextNDay( + rangeData.end.time, (7 - rangeData.lweek) + ).time; + + var cellSize = [coordSys.getCellWidth(), coordSys.getCellHeight()]; + margin = parsePercent$1(margin, cellSize[orient === 'horizontal' ? 0 : 1]); + + if (pos === 'start') { + start = coordSys.getNextNDay( + rangeData.start.time, -(7 + rangeData.fweek) + ).time; + margin = -margin; + } + + for (var i = 0; i < 7; i++) { + + var tmpD = coordSys.getNextNDay(start, i); + var point = coordSys.dataToRect([tmpD.time], false).center; + var day = i; + day = Math.abs((i + firstDayOfWeek) % 7); + var weekText = new Text({z2: 30}); + + extend( + setTextStyle(weekText.style, dayLabel, {text: nameMap[day]}), + this._weekTextPositionControl(point, orient, pos, margin, cellSize) + ); + group.add(weekText); + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file calendar.js + * @author dxh + */ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Model +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' | 'center' + // 默认根据 left 的位置判断是左对齐还是右对齐 + // textAlign: null + // + // 垂直对齐 + // 'auto' | 'top' | 'bottom' | 'middle' + // 默认根据 top 位置判断是上对齐还是下对齐 + // textBaseline: 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 +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 textBaseline = titleModel.get('textBaseline'); + + var textEl = new Text({ + style: setTextStyle({}, textStyleModel, { + text: titleModel.get('text'), + textFill: textStyleModel.getTextColor() + }, {disableBox: true}), + z2: 10 + }); + + var textRect = textEl.getBoundingRect(); + + var subText = titleModel.get('subtext'); + var subTextEl = new Text({ + style: setTextStyle({}, subtextStyleModel, { + text: subText, + textFill: subtextStyleModel.getTextColor(), + y: textRect.height + titleModel.get('itemGap'), + textVerticalAlign: 'top' + }, {disableBox: true}), + 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 = 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; + } + } + if (!textBaseline) { + textBaseline = titleModel.get('top') || titleModel.get('bottom'); + if (textBaseline === 'center') { + textBaseline = 'middle'; + } + if (textBaseline === 'bottom') { + layoutRect.y += layoutRect.height; + } + else if (textBaseline === 'middle') { + layoutRect.y += layoutRect.height / 2; + } + + textBaseline = textBaseline || 'top'; + } + + group.attr('position', [layoutRect.x, layoutRect.y]); + var alignStyle = { + textAlign: textAlign, + textVerticalAlign: textBaseline + }; + textEl.setStyle(alignStyle); + subTextEl.setStyle(alignStyle); + + // 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 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], + r: titleModel.get('borderRadius') + }, + style: style, + silent: true + }); + subPixelOptimizeRect(rect); + + group.add(rect); + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +ComponentModel.registerSubTypeDefaulter('dataZoom', function () { + // Default 'slider' when no type specified. + return 'slider'; +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 AXIS_DIMS = ['x', 'y', 'z', 'radius', 'angle', 'single']; +// Supported coords. +var COORDS = ['cartesian2d', 'polar', 'singleAxis']; + +/** + * @param {string} coordType + * @return {boolean} + */ +function isCoordSupported(coordType) { + return indexOf(COORDS, coordType) >= 0; +} + +/** + * Create "each" method to iterate names. + * + * @pubilc + * @param {Array.} names + * @param {Array.=} attrs + * @return {Function} + */ +function createNameEach(names, attrs) { + names = names.slice(); + var capitalNames = map(names, capitalFirst); + attrs = (attrs || []).slice(); + var capitalAttrs = map(attrs, capitalFirst); + + return function (callback, context) { + each$1(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); + }); + }; +} + +/** + * 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 + */ +var eachAxisDim$1 = createNameEach(AXIS_DIMS, ['axisIndex', 'axis', 'index', 'id']); + +/** + * 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: {}} + */ +function createLinkedNodesFinder(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 indexOf(result.nodes, node) >= 0; + } + + function isLinked(node, result) { + var hasLink = false; + forEachEdgeType(function (edgeType) { + each$1(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) { + each$1(edgeIdGetter(node, edgeType) || [], function (edgeId) { + result.records[edgeType.name][edgeId] = true; + }); + }); + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$22 = each$1; +var asc$1 = 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.} + */ + this._valueWindow; + + /** + * @private + * @type {Array.} + */ + this._percentWindow; + + /** + * @private + * @type {Array.} + */ + this._dataExtent; + + /** + * {minSpan, maxSpan, minValueSpan, maxValueSpan} + * @private + * @type {Object} + */ + this._minMaxSpan; + + /** + * @readOnly + * @type {module: echarts/model/Global} + */ + this.ecModel = ecModel; + + /** + * @private + * @type {module: echarts/component/dataZoom/DataZoomModel} + */ + this._dataZoomModel = dataZoomModel; + + // /** + // * @readOnly + // * @private + // */ + // this.hasSeriesStacked; +}; + +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.} Value can only be NaN or finite value. + */ + getDataValueWindow: function () { + return this._valueWindow.slice(); + }, + + /** + * @return {Array.} + */ + getDataPercentWindow: function () { + return this._percentWindow.slice(); + }, + + /** + * @public + * @param {number} axisIndex + * @return {Array} seriesModels + */ + getTargetSeriesModels: function () { + var seriesModels = []; + var ecModel = this.ecModel; + + ecModel.eachSeries(function (seriesModel) { + if (isCoordSupported(seriesModel.get('coordinateSystem'))) { + var dimName = this._dimName; + var axisModel = ecModel.queryComponents({ + mainType: dimName + 'Axis', + index: seriesModel.get(dimName + 'AxisIndex'), + id: seriesModel.get(dimName + 'AxisId') + })[0]; + if (this._axisIndex === (axisModel && axisModel.componentIndex)) { + 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; + }, + + getMinMaxSpan: function () { + return clone(this._minMaxSpan); + }, + + /** + * Only calculate by given range and this._dataExtent, do not change anything. + * + * @param {Object} opt + * @param {number} [opt.start] + * @param {number} [opt.end] + * @param {number} [opt.startValue] + * @param {number} [opt.endValue] + */ + calculateDataWindow: function (opt) { + var dataExtent = this._dataExtent; + var axisModel = this.getAxisModel(); + var scale = axisModel.axis.scale; + var rangePropMode = this._dataZoomModel.getRangePropMode(); + var percentExtent = [0, 100]; + var percentWindow = [ + opt.start, + opt.end + ]; + var valueWindow = []; + + each$22(['startValue', 'endValue'], function (prop) { + valueWindow.push(opt[prop] != null ? scale.parse(opt[prop]) : null); + }); + + // Normalize bound. + each$22([0, 1], function (idx) { + var boundValue = valueWindow[idx]; + var boundPercent = percentWindow[idx]; + + // Notice: dataZoom is based either on `percentProp` ('start', 'end') or + // on `valueProp` ('startValue', 'endValue'). The former one is suitable + // for cases that a dataZoom component controls multiple axes with different + // unit or extent, and the latter one is suitable for accurate zoom by pixel + // (e.g., in dataZoomSelect). `valueProp` can be calculated from `percentProp`, + // but it is awkward that `percentProp` can not be obtained from `valueProp` + // accurately (because all of values that are overflow the `dataExtent` will + // be calculated to percent '100%'). So we have to use + // `dataZoom.getRangePropMode()` to mark which prop is used. + // `rangePropMode` is updated only when setOption or dispatchAction, otherwise + // it remains its original value. + + if (rangePropMode[idx] === 'percent') { + if (boundPercent == null) { + boundPercent = percentExtent[idx]; + } + // Use scale.parse to math round for category or time axis. + boundValue = scale.parse(linearMap( + boundPercent, percentExtent, dataExtent, true + )); + } + else { + // Calculating `percent` from `value` may be not accurate, because + // This calculation can not be inversed, because all of values that + // are overflow the `dataExtent` will be calculated to percent '100%' + boundPercent = linearMap( + boundValue, dataExtent, percentExtent, true + ); + } + + // valueWindow[idx] = round(boundValue); + // percentWindow[idx] = round(boundPercent); + valueWindow[idx] = boundValue; + percentWindow[idx] = boundPercent; + }); + + return { + valueWindow: asc$1(valueWindow), + percentWindow: asc$1(percentWindow) + }; + }, + + /** + * 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; + } + + var targetSeries = this.getTargetSeriesModels(); + // Culculate data window and data extent, and record them. + this._dataExtent = calculateDataExtent(this, this._dimName, targetSeries); + + // this.hasSeriesStacked = false; + // each(targetSeries, function (series) { + // var data = series.getData(); + // var dataDim = data.mapDimension(this._dimName); + // var stackedDimension = data.getCalculationInfo('stackedDimension'); + // if (stackedDimension && stackedDimension === dataDim) { + // this.hasSeriesStacked = true; + // } + // }, this); + + var dataWindow = this.calculateDataWindow(dataZoomModel.option); + + this._valueWindow = dataWindow.valueWindow; + this._percentWindow = dataWindow.percentWindow; + + setMinMaxSpan(this); + + // 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, api) { + if (dataZoomModel !== this._dataZoomModel) { + return; + } + + var axisDim = this._dimName; + var seriesModels = this.getTargetSeriesModels(); + var filterMode = dataZoomModel.get('filterMode'); + var valueWindow = this._valueWindow; + + if (filterMode === 'none') { + return; + } + + // 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. + // In fect, it is not a big deal that do not support filterMode-'filter' + // when using toolbox#dataZoom, utill tooltip#dataZoom support "single axis + // selection" some day, which might need "adapt to data extent on the + // otherAxis", which is disabled by filterMode-'empty'. + // But currently, stack has been fixed to based on value but not index, + // so this is not an issue any more. + // var otherAxisModel = this.getOtherAxisModel(); + // if (dataZoomModel.get('$fromToolbox') + // && otherAxisModel + // && otherAxisModel.hasSeriesStacked + // ) { + // filterMode = 'empty'; + // } + + // TODO + // filterMode 'weakFilter' and 'empty' is not optimized for huge data yet. + + // Process series data + each$22(seriesModels, function (seriesModel) { + var seriesData = seriesModel.getData(); + var dataDims = seriesData.mapDimension(axisDim, true); + + if (filterMode === 'weakFilter') { + seriesData.filterSelf(function (dataIndex) { + var leftOut; + var rightOut; + var hasValue; + for (var i = 0; i < dataDims.length; i++) { + var value = seriesData.get(dataDims[i], dataIndex); + var thisHasValue = !isNaN(value); + var thisLeftOut = value < valueWindow[0]; + var thisRightOut = value > valueWindow[1]; + if (thisHasValue && !thisLeftOut && !thisRightOut) { + return true; + } + thisHasValue && (hasValue = true); + thisLeftOut && (leftOut = true); + thisRightOut && (rightOut = true); + } + // If both left out and right out, do not filter. + return hasValue && leftOut && rightOut; + }); + } + else { + each$22(dataDims, function (dim) { + if (filterMode === 'empty') { + seriesModel.setData( + seriesData.map(dim, function (value) { + return !isInWindow(value) ? NaN : value; + }) + ); + } + else { + var range = {}; + range[dim] = valueWindow; + + // console.time('select'); + seriesData.selectRange(range); + // console.timeEnd('select'); + } + }); + } + + each$22(dataDims, function (dim) { + seriesData.setApproximateExtent(valueWindow, dim); + }); + }); + + function isInWindow(value) { + return value >= valueWindow[0] && value <= valueWindow[1]; + } + } +}; + +function calculateDataExtent(axisProxy, axisDim, seriesModels) { + var dataExtent = [Infinity, -Infinity]; + + each$22(seriesModels, function (seriesModel) { + var seriesData = seriesModel.getData(); + if (seriesData) { + each$22(seriesData.mapDimension(axisDim, true), function (dim) { + var seriesExtent = seriesData.getApproximateExtent(dim); + seriesExtent[0] < dataExtent[0] && (dataExtent[0] = seriesExtent[0]); + seriesExtent[1] > dataExtent[1] && (dataExtent[1] = seriesExtent[1]); + }); + } + }); + + if (dataExtent[1] < dataExtent[0]) { + dataExtent = [NaN, NaN]; + } + + // It is important to get "consistent" extent when more then one axes is + // controlled by a `dataZoom`, otherwise those axes will not be synchronized + // when zooming. But it is difficult to know what is "consistent", considering + // axes have different type or even different meanings (For example, two + // time axes are used to compare data of the same date in different years). + // So basically dataZoom just obtains extent by series.data (in category axis + // extent can be obtained from axis.data). + // Nevertheless, user can set min/max/scale on axes to make extent of axes + // consistent. + fixExtentByAxis(axisProxy, dataExtent); + + return dataExtent; +} + +function fixExtentByAxis(axisProxy, dataExtent) { + var axisModel = axisProxy.getAxisModel(); + var min = axisModel.getMin(true); + + // For category axis, if min/max/scale are not set, extent is determined + // by axis.data by default. + var isCategoryAxis = axisModel.get('type') === 'category'; + var axisDataLen = isCategoryAxis && axisModel.getCategories().length; + + if (min != null && min !== 'dataMin' && typeof min !== 'function') { + dataExtent[0] = min; + } + else if (isCategoryAxis) { + dataExtent[0] = axisDataLen > 0 ? 0 : NaN; + } + + var max = axisModel.getMax(true); + if (max != null && max !== 'dataMax' && typeof max !== 'function') { + dataExtent[1] = max; + } + else if (isCategoryAxis) { + dataExtent[1] = axisDataLen > 0 ? axisDataLen - 1 : NaN; + } + + if (!axisModel.get('scale', true)) { + dataExtent[0] > 0 && (dataExtent[0] = 0); + dataExtent[1] < 0 && (dataExtent[1] = 0); + } + + // For value axis, if min/max/scale are not set, we just use the extent obtained + // by series data, which may be a little different from the extent calculated by + // `axisHelper.getScaleExtent`. But the different just affects the experience a + // little when zooming. So it will not be fixed until some users require it strongly. + + return dataExtent; +} + +function setAxisModel(axisProxy, isRestore) { + var axisModel = axisProxy.getAxisModel(); + + var percentWindow = axisProxy._percentWindow; + var valueWindow = axisProxy._valueWindow; + + if (!percentWindow) { + return; + } + + // [0, 500]: arbitrary value, guess axis extent. + var precision = getPixelPrecision(valueWindow, [0, 500]); + precision = Math.min(precision, 20); + // isRestore or isFull + var useOrigin = isRestore || (percentWindow[0] === 0 && percentWindow[1] === 100); + + axisModel.setRange( + useOrigin ? null : +valueWindow[0].toFixed(precision), + useOrigin ? null : +valueWindow[1].toFixed(precision) + ); +} + +function setMinMaxSpan(axisProxy) { + var minMaxSpan = axisProxy._minMaxSpan = {}; + var dataZoomModel = axisProxy._dataZoomModel; + + each$22(['min', 'max'], function (minMax) { + minMaxSpan[minMax + 'Span'] = dataZoomModel.get(minMax + 'Span'); + + // minValueSpan and maxValueSpan has higher priority than minSpan and maxSpan + var valueSpan = dataZoomModel.get(minMax + 'ValueSpan'); + + if (valueSpan != null) { + minMaxSpan[minMax + 'ValueSpan'] = valueSpan; + valueSpan = axisProxy.getAxisModel().axis.scale.parse(valueSpan); + + if (valueSpan != null) { + var dataExtent = axisProxy._dataExtent; + minMaxSpan[minMax + 'Span'] = linearMap( + dataExtent[0] + valueSpan, dataExtent, [0, 100], true + ); + } + } + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$21 = each$1; +var eachAxisDim = eachAxisDim$1; + +var DataZoomModel = extendComponentModel({ + + type: 'dataZoom', + + dependencies: [ + 'xAxis', 'yAxis', 'zAxis', 'radiusAxis', 'angleAxis', 'singleAxis', '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 the first horizontal category axis. + yAxisIndex: null, // Default the first vertical category axis. + + filterMode: 'filter', // Possible values: 'filter' or 'empty' or 'weakFilter'. + // 'filter': data items which are out of window will be removed. This option is + // applicable when filtering outliers. For each data item, it will be + // filtered if one of the relevant dimensions is out of the window. + // 'weakFilter': data items which are out of window will be removed. This option + // is applicable when filtering outliers. For each data item, it will be + // filtered only if all of the relevant dimensions are out of the same + // side of the window. + // '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. + // 'none': Do not filter. + // 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: null, // Dispatch action by the fixed rate, avoid frequency. + // default 100. Do not throttle when use null/undefined. + // If animation === true and animationDurationUpdate > 0, + // default value is 100, otherwise 20. + 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. + minSpan: null, // 0 ~ 100 + maxSpan: null, // 0 ~ 100 + minValueSpan: null, // The range of dataZoom can not be smaller than that. + maxValueSpan: null, // The range of dataZoom can not be larger than that. + rangeMode: null // Array, can be 'value' or 'percent'. + }, + + /** + * @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; + + /** + * @private + */ + this._autoThrottle = true; + + /** + * 'percent' or 'value' + * @private + */ + this._rangePropMode = ['percent', 'percent']; + + var rawOption = retrieveRaw(option); + + this.mergeDefaultAndTheme(option, ecModel); + + this.doInit(rawOption); + }, + + /** + * @override + */ + mergeOption: function (newOption) { + var rawOption = retrieveRaw(newOption); + + //FIX #2591 + 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$1.canvasSupported) { + thisOption.realtime = false; + } + + this._setDefaultThrottle(rawOption); + + updateRangeUse(this, rawOption); + + each$21([['start', 'startValue'], ['end', 'endValue']], function (names, index) { + // start/end has higher priority over startValue/endValue if they + // both set, but we should make chart.setOption({endValue: 1000}) + // effective, rather than chart.setOption({endValue: 1000, end: null}). + if (this._rangePropMode[index] === 'value') { + thisOption[names[0]] = null; + } + // Otherwise do nothing and use the merge result. + }, this); + + 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] = 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; + var dependentModels = this.dependentModels; + + if (autoAxisIndex) { + // Find axis that parallel to dataZoom as default. + var dimName = orient === 'vertical' ? 'y' : 'x'; + + if (dependentModels[dimName + 'Axis'].length) { + thisOption[dimName + 'AxisIndex'] = [0]; + autoAxisIndex = false; + } + else { + each$21(dependentModels.singleAxis, function (singleAxisModel) { + if (autoAxisIndex && singleAxisModel.get('orient', true) === orient) { + thisOption.singleAxisIndex = [singleAxisModel.componentIndex]; + 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); + var axisId = seriesModel.get(dimNames.axisId); + + var axisModel = seriesModel.ecModel.queryComponents({ + mainType: dimNames.axis, + index: axisIndex, + id: axisId + })[0]; + + if (__DEV__) { + if (!axisModel) { + throw new Error( + dimNames.axis + ' "' + retrieve( + axisIndex, + axisId, + 0 + ) + '" not found' + ); + } + } + axisIndex = axisModel.componentIndex; + + if (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; + }, + + /** + * @private + */ + _setDefaultThrottle: function (rawOption) { + // When first time user set throttle, auto throttle ends. + if (rawOption.hasOwnProperty('throttle')) { + this._autoThrottle = false; + } + if (this._autoThrottle) { + var globalOption = this.ecModel.option; + this.option.throttle = + (globalOption.animation && globalOption.animationDurationUpdate > 0) + ? 100 : 20; + } + }, + + /** + * @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$21( + this.get(dimNames.axisIndex), + function (axisIndex) { + callback.call(context, dimNames, axisIndex, this, ecModel); + }, + this + ); + }, this); + }, + + /** + * @param {string} dimName + * @param {number} axisIndex + * @return {module:echarts/component/dataZoom/AxisProxy} If not found, return null/undefined. + */ + getAxisProxy: function (dimName, axisIndex) { + return this._axisProxies[dimName + '_' + axisIndex]; + }, + + /** + * @param {string} dimName + * @param {number} axisIndex + * @return {module:echarts/model/Model} If not found, return null/undefined. + */ + getAxisModel: function (dimName, axisIndex) { + var axisProxy = this.getAxisProxy(dimName, axisIndex); + return axisProxy && axisProxy.getAxisModel(); + }, + + /** + * 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] + * @param {boolean} [ignoreUpdateRangeUsg=false] + */ + setRawRange: function (opt, ignoreUpdateRangeUsg) { + var option = this.option; + each$21([['start', 'startValue'], ['end', 'endValue']], function (names) { + // If only one of 'start' and 'startValue' is not null/undefined, the other + // should be cleared, which enable clear the option. + // If both of them are not set, keep option with the original value, which + // enable use only set start but not set end when calling `dispatchAction`. + // The same as 'end' and 'endValue'. + if (opt[names[0]] != null || opt[names[1]] != null) { + option[names[0]] = opt[names[0]]; + option[names[1]] = opt[names[1]]; + } + }, this); + + !ignoreUpdateRangeUsg && updateRangeUse(this, opt); + }, + + /** + * @public + * @return {Array.} [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.} [startValue, endValue] value can only be '-' or finite number. + */ + 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 + * @param {module:echarts/model/Model} [axisModel] If axisModel given, find axisProxy + * corresponding to the axisModel + * @return {module:echarts/component/dataZoom/AxisProxy} + */ + findRepresentativeAxisProxy: function (axisModel) { + if (axisModel) { + return axisModel.__dzAxisProxy; + } + + // 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]; + } + } + }, + + /** + * @return {Array.} + */ + getRangePropMode: function () { + return this._rangePropMode.slice(); + } + +}); + +function retrieveRaw(option) { + var ret = {}; + each$21( + ['start', 'end', 'startValue', 'endValue', 'throttle'], + function (name) { + option.hasOwnProperty(name) && (ret[name] = option[name]); + } + ); + return ret; +} + +function updateRangeUse(dataZoomModel, rawOption) { + var rangePropMode = dataZoomModel._rangePropMode; + var rangeModeInOption = dataZoomModel.get('rangeMode'); + + each$21([['start', 'startValue'], ['end', 'endValue']], function (names, index) { + var percentSpecified = rawOption[names[0]] != null; + var valueSpecified = rawOption[names[1]] != null; + if (percentSpecified && !valueSpecified) { + rangePropMode[index] = 'percent'; + } + else if (!percentSpecified && valueSpecified) { + rangePropMode[index] = 'value'; + } + else if (rangeModeInOption) { + rangePropMode[index] = rangeModeInOption[index]; + } + else if (percentSpecified) { // percentSpecified && valueSpecified + rangePropMode[index] = 'percent'; + } + // else remain its original setting. + }); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 DataZoomView = Component.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} { + * grid: [ + * {model: coord0, axisModels: [axis1, axis3], coordIndex: 1}, + * {model: coord1, axisModels: [axis0, axis2], coordIndex: 0}, + * ... + * ], // cartesians must not be null/undefined. + * polar: [ + * {model: coord0, axisModels: [axis4], coordIndex: 0}, + * ... + * ], // polars must not be null/undefined. + * singleAxis: [ + * {model: coord0, axisModels: [], coordIndex: 0} + * ] + */ + getTargetCoordInfo: function () { + var dataZoomModel = this.dataZoomModel; + var ecModel = this.ecModel; + var coordSysLists = {}; + + dataZoomModel.eachTargetAxis(function (dimNames, axisIndex) { + var axisModel = ecModel.getComponent(dimNames.axis, axisIndex); + if (axisModel) { + var coordModel = axisModel.getCoordSysModel(); + coordModel && save( + coordModel, + axisModel, + coordSysLists[coordModel.mainType] || (coordSysLists[coordModel.mainType] = []), + coordModel.componentIndex + ); + } + }, 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 coordSysLists; + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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 coor of data shadow and border of box, + // highest priority, remain for compatibility of + // previous version, but not recommended any more. + dataBackground: { + lineStyle: { + color: '#2f4554', + width: 0.5, + opacity: 0.3 + }, + areaStyle: { + color: 'rgba(47,69,84,0.3)', + opacity: 0.3 + } + }, + borderColor: '#ddd', // border color of the box. For compatibility, + // if dataBackgroundColor is set, borderColor + // is ignored. + + fillerColor: 'rgba(167,183,204,0.4)', // Color of selected area. + // handleColor: 'rgba(89,170,216,0.95)', // Color of handle. + // handleIcon: 'path://M4.9,17.8c0-1.4,4.5-10.5,5.5-12.4c0-0.1,0.6-1.1,0.9-1.1c0.4,0,0.9,1,0.9,1.1c1.1,2.2,5.4,11,5.4,12.4v17.8c0,1.5-0.6,2.1-1.3,2.1H6.1c-0.7,0-1.3-0.6-1.3-2.1V17.8z', + handleIcon: 'M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z', + // Percent of the slider height + handleSize: '100%', + + handleStyle: { + color: '#a7b7cc' + }, + + labelPrecision: null, + labelFormatter: null, + showDetail: true, + showDataShadow: 'auto', // Default auto decision. + realtime: true, + zoomLock: false, // Whether disable zoom. + textStyle: { + color: '#333' + } + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 Rect$2 = Rect; +var linearMap$1 = linearMap; +var asc$2 = asc; +var bind$4 = bind; +var each$23 = each$1; + +// 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.} + */ + this._size; + + /** + * @private + * @type {number} + */ + this._handleWidth; + + /** + * @private + * @type {number} + */ + this._handleHeight; + + /** + * @private + */ + this._location; + + /** + * @private + */ + this._dragging; + + /** + * @private + */ + this._dataShadowInfo; + + this.api = api; + }, + + /** + * @override + */ + render: function (dataZoomModel, ecModel, api, payload) { + SliderZoomView.superApply(this, 'render', arguments); + + createOrUpdate( + this, + '_dispatchZoomAction', + this.dataZoomModel.get('throttle'), + 'fixRate' + ); + + this._orient = dataZoomModel.get('orient'); + + 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); + clear(this, '_dispatchZoomAction'); + }, + + /** + * @override + */ + dispose: function () { + SliderZoomView.superApply(this, 'dispose', arguments); + clear(this, '_dispatchZoomAction'); + }, + + _buildView: function () { + var thisGroup = this.group; + + thisGroup.removeAll(); + + this._resetLocation(); + this._resetInterval(); + + var barGroup = this._displayables.barGroup = new Group(); + + this._renderBackground(); + + this._renderHandle(); + + this._renderDataShadow(); + + 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 = getLayoutParams(dataZoomModel.option); + + // Replace the placeholder value. + each$1(['right', 'top', 'width', 'height'], function (name) { + if (layoutParams[name] === 'ph') { + layoutParams[name] = positionInfo[name]; + } + }); + + var layoutRect = 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.attr('position', [location.x - rect.x, location.y - rect.y]); + }, + + /** + * @private + */ + _getViewExtent: function () { + return [0, this._size[0]]; + }, + + _renderBackground: function () { + var dataZoomModel = this.dataZoomModel; + var size = this._size; + var barGroup = this._displayables.barGroup; + + barGroup.add(new Rect$2({ + silent: true, + shape: { + x: 0, y: 0, width: size[0], height: size[1] + }, + style: { + fill: dataZoomModel.get('backgroundColor') + }, + z2: -40 + })); + + // Click panel, over shadow, below handles. + barGroup.add(new Rect$2({ + shape: { + x: 0, y: 0, width: size[0], height: size[1] + }, + style: { + fill: 'transparent' + }, + z2: 0, + onclick: bind(this._onClickPanelClick, this) + })); + }, + + _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; + + if (otherDim == null) { + return; + } + + 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 areaPoints = [[size[0], 0], [0, 0]]; + var linePoints = []; + var step = thisShadowExtent[1] / (data.count() - 1); + var thisCoord = 0; + + // Optimize for large data shadow + var stride = Math.round(data.count() / size[0]); + var lastIsEmpty; + data.each([otherDim], function (value, index) { + if (stride > 0 && (index % stride)) { + thisCoord += step; + return; + } + + // FIXME + // Should consider axis.min/axis.max when drawing dataShadow. + + // FIXME + // 应该使用统一的空判断?还是在list里进行空判断? + var isEmpty = value == null || isNaN(value) || value === ''; + // See #4235. + var otherCoord = isEmpty + ? 0 : linearMap$1(value, otherDataExtent, otherShadowExtent, true); + + // Attempt to draw data shadow precisely when there are empty value. + if (isEmpty && !lastIsEmpty && index) { + areaPoints.push([areaPoints[areaPoints.length - 1][0], 0]); + linePoints.push([linePoints[linePoints.length - 1][0], 0]); + } + else if (!isEmpty && lastIsEmpty) { + areaPoints.push([thisCoord, 0]); + linePoints.push([thisCoord, 0]); + } + + areaPoints.push([thisCoord, otherCoord]); + linePoints.push([thisCoord, otherCoord]); + + thisCoord += step; + lastIsEmpty = isEmpty; + }); + + var dataZoomModel = this.dataZoomModel; + // var dataBackgroundModel = dataZoomModel.getModel('dataBackground'); + this._displayables.barGroup.add(new Polygon({ + shape: {points: areaPoints}, + style: defaults( + {fill: dataZoomModel.get('dataBackgroundColor')}, + dataZoomModel.getModel('dataBackground.areaStyle').getAreaStyle() + ), + silent: true, + z2: -20 + })); + this._displayables.barGroup.add(new Polyline({ + shape: {points: linePoints}, + style: dataZoomModel.getModel('dataBackground.lineStyle').getLineStyle(), + silent: true, + z2: -19 + })); + }, + + _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(); + + each$1(seriesModels, function (seriesModel) { + if (result) { + return; + } + + if (showDataShadow !== true && indexOf( + SHOW_DATA_SHADOW_SERIES_TYPE, seriesModel.get('type') + ) < 0 + ) { + return; + } + + var thisAxis = ecModel.getComponent(dimNames.axis, axisIndex).axis; + var otherDim = getOtherDim(dimNames.name); + var otherAxisInverse; + var coordSys = seriesModel.coordinateSystem; + + if (otherDim != null && coordSys.getOtherAxis) { + otherAxisInverse = coordSys.getOtherAxis(thisAxis).inverse; + } + + otherDim = seriesModel.getData().mapDimension(otherDim); + + result = { + thisAxis: thisAxis, + series: seriesModel, + thisDim: dimNames.name, + otherDim: otherDim, + otherAxisInverse: otherAxisInverse + }; + + }, 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; + var dataZoomModel = this.dataZoomModel; + + barGroup.add(displaybles.filler = new Rect$2({ + draggable: true, + cursor: getCursor(this._orient), + drift: bind$4(this._onDragMove, this, 'all'), + onmousemove: function (e) { + // Fot mobile devicem, prevent screen slider on the button. + stop(e.event); + }, + ondragstart: bind$4(this._showDataInfo, this, true), + ondragend: bind$4(this._onDragEnd, this), + onmouseover: bind$4(this._showDataInfo, this, true), + onmouseout: bind$4(this._showDataInfo, this, false), + style: { + fill: dataZoomModel.get('fillerColor'), + textPosition : 'inside' + } + })); + + // Frame border. + barGroup.add(new Rect$2(subPixelOptimizeRect({ + silent: true, + shape: { + x: 0, + y: 0, + width: size[0], + height: size[1] + }, + style: { + stroke: dataZoomModel.get('dataBackgroundColor') + || dataZoomModel.get('borderColor'), + lineWidth: DEFAULT_FRAME_BORDER_WIDTH, + fill: 'rgba(0,0,0,0)' + } + }))); + + each$23([0, 1], function (handleIndex) { + var path = createIcon( + dataZoomModel.get('handleIcon'), + { + cursor: getCursor(this._orient), + draggable: true, + drift: bind$4(this._onDragMove, this, handleIndex), + onmousemove: function (e) { + // Fot mobile devicem, prevent screen slider on the button. + stop(e.event); + }, + ondragend: bind$4(this._onDragEnd, this), + onmouseover: bind$4(this._showDataInfo, this, true), + onmouseout: bind$4(this._showDataInfo, this, false) + }, + {x: -1, y: 0, width: 2, height: 2} + ); + + var bRect = path.getBoundingRect(); + this._handleHeight = parsePercent$1(dataZoomModel.get('handleSize'), this._size[1]); + this._handleWidth = bRect.width / bRect.height * this._handleHeight; + + path.setStyle(dataZoomModel.getModel('handleStyle').getItemStyle()); + var handleColor = dataZoomModel.get('handleColor'); + // Compatitable with previous version + if (handleColor != null) { + path.style.fill = handleColor; + } + + barGroup.add(handles[handleIndex] = path); + + var textStyleModel = dataZoomModel.textStyleModel; + + this.group.add( + handleLabels[handleIndex] = new Text({ + silent: true, + invisible: true, + style: { + x: 0, y: 0, text: '', + textVerticalAlign: 'middle', + textAlign: 'center', + textFill: textStyleModel.getTextColor(), + textFont: textStyleModel.getFont() + }, + z2: 10 + })); + + }, this); + }, + + /** + * @private + */ + _resetInterval: function () { + var range = this._range = this.dataZoomModel.getPercentRange(); + var viewExtent = this._getViewExtent(); + + this._handleEnds = [ + linearMap$1(range[0], [0, 100], viewExtent, true), + linearMap$1(range[1], [0, 100], viewExtent, true) + ]; + }, + + /** + * @private + * @param {(number|string)} handleIndex 0 or 1 or 'all' + * @param {number} delta + * @return {boolean} changed + */ + _updateInterval: function (handleIndex, delta) { + var dataZoomModel = this.dataZoomModel; + var handleEnds = this._handleEnds; + var viewExtend = this._getViewExtent(); + var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); + var percentExtent = [0, 100]; + + sliderMove( + delta, + handleEnds, + viewExtend, + dataZoomModel.get('zoomLock') ? 'all' : handleIndex, + minMaxSpan.minSpan != null + ? linearMap$1(minMaxSpan.minSpan, percentExtent, viewExtend, true) : null, + minMaxSpan.maxSpan != null + ? linearMap$1(minMaxSpan.maxSpan, percentExtent, viewExtend, true) : null + ); + + var lastRange = this._range; + var range = this._range = asc$2([ + linearMap$1(handleEnds[0], viewExtend, percentExtent, true), + linearMap$1(handleEnds[1], viewExtend, percentExtent, true) + ]); + + return !lastRange || lastRange[0] !== range[0] || lastRange[1] !== range[1]; + }, + + /** + * @private + */ + _updateView: function (nonRealtime) { + var displaybles = this._displayables; + var handleEnds = this._handleEnds; + var handleInterval = asc$2(handleEnds.slice()); + var size = this._size; + + each$23([0, 1], function (handleIndex) { + // Handles + var handle = displaybles.handles[handleIndex]; + var handleHeight = this._handleHeight; + handle.attr({ + scale: [handleHeight / 2, handleHeight / 2], + position: [handleEnds[handleIndex], size[1] / 2 - handleHeight / 2] + }); + }, this); + + // Filler + displaybles.filler.setShape({ + x: handleInterval[0], + y: 0, + width: handleInterval[1] - handleInterval[0], + height: size[1] + }); + + this._updateDataInfo(nonRealtime); + }, + + /** + * @private + */ + _updateDataInfo: function (nonRealtime) { + 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 axisProxy = dataZoomModel.findRepresentativeAxisProxy(); + + if (axisProxy) { + var axis = axisProxy.getAxisModel().axis; + var range = this._range; + + var dataInterval = nonRealtime + // See #4434, data and axis are not processed and reset yet in non-realtime mode. + ? axisProxy.calculateDataWindow({ + start: range[0], end: range[1] + }).valueWindow + : axisProxy.getDataValueWindow(); + + labelTexts = [ + this._formatLabel(dataInterval[0], axis), + this._formatLabel(dataInterval[1], axis) + ]; + } + } + + var orderedHandleEnds = asc$2(this._handleEnds.slice()); + + setLabel.call(this, 0); + setLabel.call(this, 1); + + function setLabel(handleIndex) { + // Label + // Text should not transform by barGroup. + // Ignore handlers transform + var barTransform = getTransform( + displaybles.handles[handleIndex].parent, this.group + ); + var direction = transformDirection( + handleIndex === 0 ? 'right' : 'left', barTransform + ); + var offset = this._handleWidth / 2 + LABEL_GAP; + var textPoint = applyTransform$1( + [ + 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'); + + var labelPrecision = dataZoomModel.get('labelPrecision'); + if (labelPrecision == null || labelPrecision === 'auto') { + labelPrecision = axis.getPixelPrecision(); + } + + var valueStr = (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)); + + return isFunction$1(labelFormatter) + ? labelFormatter(value, valueStr) + : isString(labelFormatter) + ? labelFormatter.replace('{value}', valueStr) + : valueStr; + }, + + /** + * @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 barTransform = this._displayables.barGroup.getLocalTransform(); + var vertex = applyTransform$1([dx, dy], barTransform, true); + + var changed = this._updateInterval(handleIndex, vertex[0]); + + var realtime = this.dataZoomModel.get('realtime'); + + this._updateView(!realtime); + + // Avoid dispatch dataZoom repeatly but range not changed, + // which cause bad visual effect when progressive enabled. + changed && realtime && this._dispatchZoomAction(); + }, + + _onDragEnd: function () { + this._dragging = false; + this._showDataInfo(false); + + // While in realtime mode and stream mode, dispatch action when + // drag end will cause the whole view rerender, which is unnecessary. + var realtime = this.dataZoomModel.get('realtime'); + !realtime && this._dispatchZoomAction(); + }, + + _onClickPanelClick: function (e) { + var size = this._size; + var localPoint = this._displayables.barGroup.transformCoordToLocal(e.offsetX, e.offsetY); + + if (localPoint[0] < 0 || localPoint[0] > size[0] + || localPoint[1] < 0 || localPoint[1] > size[1] + ) { + return; + } + + var handleEnds = this._handleEnds; + var center = (handleEnds[0] + handleEnds[1]) / 2; + + var changed = this._updateInterval('all', localPoint[0] - center); + this._updateView(); + changed && 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 + */ + _findCoordRect: function () { + // Find the grid coresponding to the first axis referred by dataZoom. + var rect; + each$23(this.getTargetCoordInfo(), function (coordInfoList) { + if (!rect && coordInfoList.length) { + var coordSys = coordInfoList[0].model.coordinateSystem; + rect = coordSys.getRect && coordSys.getRect(); + } + }); + if (!rect) { + 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里一致,但是写在这里是否不好 + var map$$1 = {x: 'y', y: 'x', radius: 'angle', angle: 'radius'}; + return map$$1[thisDim]; +} + +function getCursor(orient) { + return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +DataZoomModel.extend({ + + type: 'dataZoom.inside', + + /** + * @protected + */ + defaultOption: { + disabled: false, // Whether disable this inside zoom. + zoomLock: false, // Whether disable zoom but only pan. + zoomOnMouseWheel: true, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. + moveOnMouseMove: true, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. + moveOnMouseWheel: false, // Can be: true / false / 'shift' / 'ctrl' / 'alt'. + preventDefaultMouseMove: true + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// 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 ATTR$1 = '\0_ec_dataZoom_roams'; + + +/** + * @public + * @param {module:echarts/ExtensionAPI} api + * @param {Object} dataZoomInfo + * @param {string} dataZoomInfo.coordId + * @param {Function} dataZoomInfo.containsPoint + * @param {Array.} dataZoomInfo.allCoordIds + * @param {string} dataZoomInfo.dataZoomId + * @param {Object} dataZoomInfo.getRange + * @param {Function} dataZoomInfo.getRange.pan + * @param {Function} dataZoomInfo.getRange.zoom + * @param {Function} dataZoomInfo.getRange.scrollMove + * @param {boolean} dataZoomInfo.dataZoomModel + */ +function register$2(api, dataZoomInfo) { + var store = giveStore(api); + var theDataZoomId = dataZoomInfo.dataZoomId; + var theCoordId = dataZoomInfo.coordId; + + // Do clean when a dataZoom changes its target coordnate system. + // Avoid memory leak, dispose all not-used-registered. + each$1(store, function (record, coordId) { + var dataZoomInfos = record.dataZoomInfos; + if (dataZoomInfos[theDataZoomId] + && 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, record); + record.dispatchAction = curry(dispatchAction$1, api); + } + + // Update reference of dataZoom. + !(record.dataZoomInfos[theDataZoomId]) && record.count++; + record.dataZoomInfos[theDataZoomId] = dataZoomInfo; + + var controllerParams = mergeControllerParams(record.dataZoomInfos); + record.controller.enable(controllerParams.controlType, controllerParams.opt); + + // Consider resize, area should be always updated. + record.controller.setPointerChecker(dataZoomInfo.containsPoint); + + // Update throttle. + createOrUpdate( + record, + 'dispatchAction', + dataZoomInfo.dataZoomModel.get('throttle', true), + 'fixRate' + ); +} + +/** + * @public + * @param {module:echarts/ExtensionAPI} api + * @param {string} dataZoomId + */ +function unregister$1(api, dataZoomId) { + var store = giveStore(api); + + each$1(store, function (record) { + record.controller.dispose(); + var dataZoomInfos = record.dataZoomInfos; + if (dataZoomInfos[dataZoomId]) { + delete dataZoomInfos[dataZoomId]; + record.count--; + } + }); + + cleanStore(store); +} + +/** + * @public + */ +function generateCoordId(coordModel) { + return coordModel.type + '\0_' + coordModel.id; +} + +/** + * Key: coordId, value: {dataZoomInfos: [], count, controller} + * @type {Array.} + */ +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$1] || (zr[ATTR$1] = {}); +} + +function createController(api, newRecord) { + var controller = new RoamController(api.getZr()); + + each$1(['pan', 'zoom', 'scrollMove'], function (eventName) { + controller.on(eventName, function (event) { + var batch = []; + + each$1(newRecord.dataZoomInfos, function (info) { + if (!event.isAvailableBehavior(info.dataZoomModel.option)) { + return; + } + + var method = (info.getRange || {})[eventName]; + var range = method && method(newRecord.controller, event); + + !info.dataZoomModel.get('disabled', true) && range && batch.push({ + dataZoomId: info.dataZoomId, + start: range[0], + end: range[1] + }); + }); + + batch.length && newRecord.dispatchAction(batch); + }); + }); + + return controller; +} + +function cleanStore(store) { + each$1(store, function (record, coordId) { + if (!record.count) { + record.controller.dispose(); + delete store[coordId]; + } + }); +} + +/** + * This action will be throttled. + */ +function dispatchAction$1(api, batch) { + api.dispatchAction({ + type: 'dataZoom', + batch: batch + }); +} + +/** + * Merge roamController settings when multiple dataZooms share one roamController. + */ +function mergeControllerParams(dataZoomInfos) { + var controlType; + // DO NOT use reserved word (true, false, undefined) as key literally. Even if encapsulated + // as string, it is probably revert to reserved word by compress tool. See #7411. + var prefix = 'type_'; + var typePriority = { + 'type_true': 2, + 'type_move': 1, + 'type_false': 0, + 'type_undefined': -1 + }; + var preventDefaultMouseMove = true; + + each$1(dataZoomInfos, function (dataZoomInfo) { + var dataZoomModel = dataZoomInfo.dataZoomModel; + var oneType = dataZoomModel.get('disabled', true) + ? false + : dataZoomModel.get('zoomLock', true) + ? 'move' + : true; + if (typePriority[prefix + oneType] > typePriority[prefix + controlType]) { + controlType = oneType; + } + // Prevent default move event by default. If one false, do not prevent. Otherwise + // users may be confused why it does not work when multiple insideZooms exist. + preventDefaultMouseMove &= dataZoomModel.get('preventDefaultMouseMove', true); + }); + + return { + controlType: controlType, + opt: { + zoomOnMouseWheel: true, + moveOnMouseMove: true, + moveOnMouseWheel: true, + preventDefaultMouseMove: !!preventDefaultMouseMove + } + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 bind$5 = 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.} + */ + this._range; + }, + + /** + * @override + */ + render: function (dataZoomModel, ecModel, api, payload) { + InsideZoomView.superApply(this, 'render', arguments); + + // Hance the `throttle` util ensures to preserve command order, + // here simply updating range all the time will not cause missing + // any of the the roam change. + this._range = dataZoomModel.getPercentRange(); + + // Reset controllers. + each$1(this.getTargetCoordInfo(), function (coordInfoList, coordSysName) { + + var allCoordIds = map(coordInfoList, function (coordInfo) { + return generateCoordId(coordInfo.model); + }); + + each$1(coordInfoList, function (coordInfo) { + var coordModel = coordInfo.model; + + var getRange = {}; + each$1(['pan', 'zoom', 'scrollMove'], function (eventName) { + getRange[eventName] = bind$5(roamHandlers[eventName], this, coordInfo, coordSysName); + }, this); + + register$2( + api, + { + coordId: generateCoordId(coordModel), + allCoordIds: allCoordIds, + containsPoint: function (e, x, y) { + return coordModel.coordinateSystem.containPoint([x, y]); + }, + dataZoomId: dataZoomModel.id, + dataZoomModel: dataZoomModel, + getRange: getRange + } + ); + }, this); + + }, this); + }, + + /** + * @override + */ + dispose: function () { + unregister$1(this.api, this.dataZoomModel.id); + InsideZoomView.superApply(this, 'dispose', arguments); + this._range = null; + } + +}); + +var roamHandlers = { + + /** + * @this {module:echarts/component/dataZoom/InsideZoomView} + */ + zoom: function (coordInfo, coordSysName, controller, e) { + var lastRange = this._range; + var range = lastRange.slice(); + + // Calculate transform by the first axis. + var axisModel = coordInfo.axisModels[0]; + if (!axisModel) { + return; + } + + var directionInfo = getDirectionInfo[coordSysName]( + null, [e.originX, e.originY], axisModel, controller, coordInfo + ); + var percentPoint = ( + directionInfo.signal > 0 + ? (directionInfo.pixelStart + directionInfo.pixelLength - directionInfo.pixel) + : (directionInfo.pixel - directionInfo.pixelStart) + ) / directionInfo.pixelLength * (range[1] - range[0]) + range[0]; + + var scale = Math.max(1 / e.scale, 0); + range[0] = (range[0] - percentPoint) * scale + percentPoint; + range[1] = (range[1] - percentPoint) * scale + percentPoint; + + // Restrict range. + var minMaxSpan = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan(); + + sliderMove(0, range, [0, 100], 0, minMaxSpan.minSpan, minMaxSpan.maxSpan); + + this._range = range; + + if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { + return range; + } + }, + + /** + * @this {module:echarts/component/dataZoom/InsideZoomView} + */ + pan: makeMover(function (range, axisModel, coordInfo, coordSysName, controller, e) { + var directionInfo = getDirectionInfo[coordSysName]( + [e.oldX, e.oldY], [e.newX, e.newY], axisModel, controller, coordInfo + ); + + return directionInfo.signal + * (range[1] - range[0]) + * directionInfo.pixel / directionInfo.pixelLength; + }), + + /** + * @this {module:echarts/component/dataZoom/InsideZoomView} + */ + scrollMove: makeMover(function (range, axisModel, coordInfo, coordSysName, controller, e) { + return (range[1] - range[0]) * e.scrollDelta; + }) +}; + +function makeMover(getPercentDelta) { + return function (coordInfo, coordSysName, controller, e) { + var lastRange = this._range; + var range = lastRange.slice(); + + // Calculate transform by the first axis. + var axisModel = coordInfo.axisModels[0]; + if (!axisModel) { + return; + } + + var percentDelta = getPercentDelta( + range, axisModel, coordInfo, coordSysName, controller, e + ); + + sliderMove(percentDelta, range, [0, 100], 'all'); + + this._range = range; + + if (lastRange[0] !== range[0] || lastRange[1] !== range[1]) { + return range; + } + }; +} + +var getDirectionInfo = { + + grid: function (oldPoint, newPoint, axisModel, controller, coordInfo) { + var axis = axisModel.axis; + var ret = {}; + var rect = coordInfo.model.coordinateSystem.getRect(); + oldPoint = oldPoint || [0, 0]; + + if (axis.dim === 'x') { + ret.pixel = newPoint[0] - oldPoint[0]; + ret.pixelLength = rect.width; + ret.pixelStart = rect.x; + ret.signal = axis.inverse ? 1 : -1; + } + else { // axis.dim === 'y' + ret.pixel = newPoint[1] - oldPoint[1]; + ret.pixelLength = rect.height; + ret.pixelStart = rect.y; + ret.signal = axis.inverse ? -1 : 1; + } + + return ret; + }, + + polar: function (oldPoint, newPoint, axisModel, controller, coordInfo) { + var axis = axisModel.axis; + var ret = {}; + var polar = coordInfo.model.coordinateSystem; + var radiusExtent = polar.getRadiusAxis().getExtent(); + var angleExtent = polar.getAngleAxis().getExtent(); + + oldPoint = oldPoint ? polar.pointToCoord(oldPoint) : [0, 0]; + newPoint = polar.pointToCoord(newPoint); + + if (axisModel.mainType === 'radiusAxis') { + ret.pixel = newPoint[0] - oldPoint[0]; + // ret.pixelLength = Math.abs(radiusExtent[1] - radiusExtent[0]); + // ret.pixelStart = Math.min(radiusExtent[0], radiusExtent[1]); + ret.pixelLength = radiusExtent[1] - radiusExtent[0]; + ret.pixelStart = radiusExtent[0]; + ret.signal = axis.inverse ? 1 : -1; + } + else { // 'angleAxis' + ret.pixel = newPoint[1] - oldPoint[1]; + // ret.pixelLength = Math.abs(angleExtent[1] - angleExtent[0]); + // ret.pixelStart = Math.min(angleExtent[0], angleExtent[1]); + ret.pixelLength = angleExtent[1] - angleExtent[0]; + ret.pixelStart = angleExtent[0]; + ret.signal = axis.inverse ? -1 : 1; + } + + return ret; + }, + + singleAxis: function (oldPoint, newPoint, axisModel, controller, coordInfo) { + var axis = axisModel.axis; + var rect = coordInfo.model.coordinateSystem.getRect(); + var ret = {}; + + oldPoint = oldPoint || [0, 0]; + + if (axis.orient === 'horizontal') { + ret.pixel = newPoint[0] - oldPoint[0]; + ret.pixelLength = rect.width; + ret.pixelStart = rect.x; + ret.signal = axis.inverse ? 1 : -1; + } + else { // 'vertical' + ret.pixel = newPoint[1] - oldPoint[1]; + ret.pixelLength = rect.height; + ret.pixelStart = rect.y; + ret.signal = axis.inverse ? -1 : 1; + } + + return ret; + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerProcessor({ + + // `dataZoomProcessor` will only be performed in needed series. Consider if + // there is a line series and a pie series, it is better not to update the + // line series if only pie series is needed to be updated. + getTargetSeries: function (ecModel) { + var seriesModelMap = createHashMap(); + + ecModel.eachComponent('dataZoom', function (dataZoomModel) { + dataZoomModel.eachTargetAxis(function (dimNames, axisIndex, dataZoomModel) { + var axisProxy = dataZoomModel.getAxisProxy(dimNames.name, axisIndex); + each$1(axisProxy.getTargetSeriesModels(), function (seriesModel) { + seriesModelMap.set(seriesModel.uid, seriesModel); + }); + }); + }); + + return seriesModelMap; + }, + + modifyOutputEnd: true, + + // Consider appendData, where filter should be performed. Because data process is + // in block mode currently, it is not need to worry about that the overallProgress + // execute every frame. + overallReset: 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(function (dimNames, axisIndex, dataZoomModel) { + dataZoomModel.getAxisProxy(dimNames.name, axisIndex).reset(dataZoomModel, api); + }); + + // 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(function (dimNames, axisIndex, dataZoomModel) { + dataZoomModel.getAxisProxy(dimNames.name, axisIndex).filterData(dataZoomModel, api); + }); + }); + + 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] + }, true); + }); + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerAction('dataZoom', function (payload, ecModel) { + + var linkedNodesFinder = createLinkedNodesFinder( + bind(ecModel.eachComponent, ecModel, 'dataZoom'), + eachAxisDim$1, + 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 + ); + } + ); + + each$1(effectedModels, function (dataZoomModel, index) { + dataZoomModel.setRawRange({ + start: payload.start, + end: payload.end, + startValue: payload.startValue, + endValue: payload.endValue + }); + }); + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * DataZoom component entry + */ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$24 = each$1; + +var preprocessor$2 = function (option) { + var visualMap = option && option.visualMap; + + if (!isArray(visualMap)) { + visualMap = visualMap ? [visualMap] : []; + } + + each$24(visualMap, function (opt) { + if (!opt) { + return; + } + + // rename splitList to pieces + if (has$1(opt, 'splitList') && !has$1(opt, 'pieces')) { + opt.pieces = opt.splitList; + delete opt.splitList; + } + + var pieces = opt.pieces; + if (pieces && isArray(pieces)) { + each$24(pieces, function (piece) { + if (isObject$1(piece)) { + if (has$1(piece, 'start') && !has$1(piece, 'min')) { + piece.min = piece.start; + } + if (has$1(piece, 'end') && !has$1(piece, 'max')) { + piece.max = piece.end; + } + } + }); + } + }); +}; + +function has$1(obj, name) { + return obj && obj.hasOwnProperty && obj.hasOwnProperty(name); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +ComponentModel.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'; +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 VISUAL_PRIORITY = PRIORITY.VISUAL.COMPONENT; + +registerVisual(VISUAL_PRIORITY, { + createOnAllSeries: true, + reset: function (seriesModel, ecModel) { + var resetDefines = []; + ecModel.eachComponent('visualMap', function (visualMapModel) { + var pipelineContext = seriesModel.pipelineContext; + if (!visualMapModel.isTargetSeries(seriesModel) + || (pipelineContext && pipelineContext.large) + ) { + return; + } + + resetDefines.push(incrementalApplyVisual( + visualMapModel.stateList, + visualMapModel.targetVisuals, + bind(visualMapModel.getValueState, visualMapModel), + visualMapModel.getDataDimension(seriesModel.getData()) + )); + }); + + return resetDefines; + } +}); + +// Only support color. +registerVisual(VISUAL_PRIORITY, { + createOnAllSeries: true, + reset: function (seriesModel, ecModel) { + var data = seriesModel.getData(); + var visualMetaList = []; + + ecModel.eachComponent('visualMap', function (visualMapModel) { + if (visualMapModel.isTargetSeries(seriesModel)) { + var visualMeta = visualMapModel.getVisualMeta( + bind(getColorVisual, null, seriesModel, visualMapModel) + ) || {stops: [], outerColors: []}; + + var concreteDim = visualMapModel.getDataDimension(data); + var dimInfo = data.getDimensionInfo(concreteDim); + if (dimInfo != null) { + // visualMeta.dimension should be dimension index, but not concrete dimension. + visualMeta.dimension = dimInfo.index; + visualMetaList.push(visualMeta); + } + } + }); + + // console.log(JSON.stringify(visualMetaList.map(a => a.stops))); + seriesModel.getData().setVisual('visualMeta', visualMetaList); + } +}); + +// FIXME +// performance and export for heatmap? +// value can be Infinity or -Infinity +function getColorVisual(seriesModel, visualMapModel, value, valueState) { + var mappings = visualMapModel.targetVisuals[valueState]; + var visualTypes = VisualMapping.prepareVisualTypes(mappings); + var resultVisual = { + color: seriesModel.getData().getVisual('color') // default color. + }; + + for (var i = 0, len = visualTypes.length; i < len; i++) { + var type = visualTypes[i]; + var mapping = mappings[ + type === 'opacity' ? '__alphaForOpacity' : type + ]; + mapping && mapping.applyVisual(value, getVisual, setVisual); + } + + return resultVisual.color; + + function getVisual(key) { + return resultVisual[key]; + } + + function setVisual(key, value) { + resultVisual[key] = value; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @file Visual mapping. + */ + +var visualDefault = { + + /** + * @public + */ + get: function (visualType, key, isCategory) { + var value = clone( + (defaultOption$3[visualType] || {})[key] + ); + + return isCategory + ? (isArray(value) ? value[value.length - 1] : value) + : value; + } + +}; + +var defaultOption$3 = { + + 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] + }, + + opacity: { + active: [0.3, 1], + inactive: [0, 0] + }, + + symbol: { + active: ['circle', 'roundRect', 'diamond'], + inactive: ['none'] + }, + + symbolSize: { + active: [10, 50], + inactive: [0, 0] + } +}; + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 mapVisual$2 = VisualMapping.mapVisual; +var eachVisual = VisualMapping.eachVisual; +var isArray$3 = isArray; +var each$25 = each$1; +var asc$3 = asc; +var linearMap$2 = linearMap; +var noop$2 = noop; + +var VisualMapModel = extendComponentModel({ + + type: 'visualMap', + + dependencies: ['series'], + + /** + * @readOnly + * @type {Array.} + */ + stateList: ['inRange', 'outOfRange'], + + /** + * @readOnly + * @type {Array.} + */ + replacableOptionKeys: [ + 'inRange', 'outOfRange', 'target', 'controller', 'color' + ], + + /** + * [lowerBound, upperBound] + * + * @readOnly + * @type {Array.} + */ + dataBound: [-Infinity, Infinity], + + /** + * @readOnly + * @type {string|Object} + */ + layoutMode: {type: 'box', ignoreSize: true}, + + /** + * @protected + */ + defaultOption: { + show: true, + + zlevel: 0, + z: 4, + + seriesIndex: 'all', // 'all' or null/undefined: all series. + // A number or an array of number: the specified series. + + // 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' + + 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: null, //颜色(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 {Array.} + */ + this._dataExtent; + + /** + * @readOnly + */ + this.targetVisuals = {}; + + /** + * @readOnly + */ + this.controllerVisuals = {}; + + /** + * @readOnly + */ + this.textStyleModel; + + /** + * [width, height] + * @readOnly + * @type {Array.} + */ + this.itemSize; + + this.mergeDefaultAndTheme(option, ecModel); + }, + + /** + * @protected + */ + optionUpdated: function (newOption, isInit) { + var thisOption = this.option; + + // FIXME + // necessary? + // Disable realtime view update if canvas is not supported. + if (!env$1.canvasSupported) { + thisOption.realtime = false; + } + + !isInit && replaceVisualOption( + thisOption, newOption, this.replacableOptionKeys + ); + + this.textStyleModel = this.getModel('textStyle'); + + this.resetItemSize(); + + this.completeVisualOption(); + }, + + /** + * @protected + */ + resetVisual: function (supplementVisualOption) { + var stateList = this.stateList; + supplementVisualOption = bind(supplementVisualOption, this); + + this.controllerVisuals = createVisualMappings( + this.option.controller, stateList, supplementVisualOption + ); + this.targetVisuals = createVisualMappings( + this.option.target, stateList, supplementVisualOption + ); + }, + + /** + * @protected + * @return {Array.} An array of series indices. + */ + getTargetSeriesIndices: function () { + var optionSeriesIndex = this.option.seriesIndex; + var seriesIndices = []; + + if (optionSeriesIndex == null || optionSeriesIndex === 'all') { + this.ecModel.eachSeries(function (seriesModel, index) { + seriesIndices.push(index); + }); + } + else { + seriesIndices = normalizeToArray(optionSeriesIndex); + } + + return seriesIndices; + }, + + /** + * @public + */ + eachTargetSeries: function (callback, context) { + each$1(this.getTargetSeriesIndices(), function (seriesIndex) { + callback.call(context, this.ecModel.getSeriesByIndex(seriesIndex)); + }, this); + }, + + /** + * @pubilc + */ + isTargetSeries: function (seriesModel) { + var is = false; + this.eachTargetSeries(function (model) { + model === seriesModel && (is = true); + }); + return is; + }, + + /** + * @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.} value Real value, or this.dataBound[0 or 1]. + * @param {boolean} [isCategory=false] Only available when value is number. + * @param {Array.} edgeSymbols Open-close symbol when value is interval. + * @return {string} + * @protected + */ + formatValueText: function(value, isCategory, edgeSymbols) { + var option = this.option; + var precision = option.precision; + var dataBound = this.dataBound; + var formatter = option.formatter; + var isMinMax; + var textValue; + edgeSymbols = edgeSymbols || ['<', '>']; + + if (isArray(value)) { + value = value.slice(); + isMinMax = true; + } + + textValue = isCategory + ? value + : (isMinMax + ? [toFixed(value[0]), toFixed(value[1])] + : toFixed(value) + ); + + if (isString(formatter)) { + return formatter + .replace('{value}', isMinMax ? textValue[0] : textValue) + .replace('{value2}', isMinMax ? textValue[1] : textValue); + } + else if (isFunction$1(formatter)) { + return isMinMax + ? formatter(value[0], value[1]) + : formatter(value); + } + + if (isMinMax) { + if (value[0] === dataBound[0]) { + return edgeSymbols[0] + ' ' + textValue[1]; + } + else if (value[1] === dataBound[1]) { + return edgeSymbols[1] + ' ' + 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(Math.min(precision, 20)); + } + }, + + /** + * @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$3([thisOption.min, thisOption.max]); + + this._dataExtent = extent; + }, + + /** + * @public + * @param {module:echarts/data/List} list + * @return {string} Concrete dimention. If return null/undefined, + * no dimension used. + */ + getDataDimension: function (list) { + var optDim = this.option.dimension; + var listDimensions = list.dimensions; + if (optDim == null && !listDimensions.length) { + return; + } + + if (optDim != null) { + return list.getDimension(optDim); + } + + var dimNames = list.dimensions; + for (var i = dimNames.length - 1; i >= 0; i--) { + var dimName = dimNames[i]; + var dimInfo = list.getDimensionInfo(dimName); + if (!dimInfo.isCalculationCoord) { + return dimName; + } + } + }, + + /** + * @public + * @override + */ + getExtent: function () { + return this._dataExtent.slice(); + }, + + /** + * @protected + */ + completeVisualOption: function () { + var ecModel = this.ecModel; + var thisOption = this.option; + var base = {inRange: thisOption.inRange, outOfRange: thisOption.outOfRange}; + + var target = thisOption.target || (thisOption.target = {}); + var controller = thisOption.controller || (thisOption.controller = {}); + + merge(target, base); // Do not override + 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$3(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()}; + } + + // Compatible with previous logic, always give a defautl color, otherwise + // simple config with no inRange and outOfRange will not work. + // Originally we use visualMap.color as the default color, but setOption at + // the second time the default color will be erased. So we change to use + // constant DEFAULT_COLOR. + // If user do not want the defualt color, set inRange: {color: null}. + base.inRange = base.inRange || {color: ecModel.get('gradientColor')}; + + // If using shortcut like: {inRange: 'symbol'}, complete default value. + each$25(this.stateList, function (state) { + var visualType = base[state]; + + if (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$25(optExist, function (visualData, visualType) { + if (!VisualMapping.isValidType(visualType)) { + return; + } + + var defa = visualDefault.get(visualType, 'inactive', isCategory); + + if (defa != null) { + optAbsent[visualType] = defa; + + // Compatibable with ec2: + // Only inactive color to rgba(0,0,0,0) can not + // make label transparent, so use opacity also. + if (visualType === 'color' + && !optAbsent.hasOwnProperty('opacity') + && !optAbsent.hasOwnProperty('colorAlpha') + ) { + optAbsent.opacity = [0, 0]; + } + } + }); + } + } + + 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$25(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 == null) { + visuals.symbol = symbolExists + && clone(symbolExists) + || (isCategory ? 'roundRect' : ['roundRect']); + } + if (visuals.symbolSize == null) { + visuals.symbolSize = symbolSizeExists + && clone(symbolSizeExists) + || (isCategory ? itemSize[0] : [itemSize[0], itemSize[0]]); + } + + // Filter square and none. + visuals.symbol = mapVisual$2(visuals.symbol, function (symbol) { + return (symbol === 'none' || symbol === 'square') ? 'roundRect' : symbol; + }); + + // Normalize symbolSize + var symbolSize = visuals.symbolSize; + + if (symbolSize != null) { + var max = -Infinity; + // symbolSize can be object when categories defined. + eachVisual(symbolSize, function (value) { + value > max && (max = value); + }); + visuals.symbolSize = mapVisual$2(symbolSize, function (value) { + return linearMap$2(value, [0, max], [0, itemSize[0]], true); + }); + } + + }, this); + } + }, + + /** + * @protected + */ + resetItemSize: function () { + this.itemSize = [ + parseFloat(this.get('itemWidth')), + parseFloat(this.get('itemHeight')) + ]; + }, + + /** + * @public + */ + isCategory: function () { + return !!this.option.categories; + }, + + /** + * @public + * @abstract + */ + setSelected: noop$2, + + /** + * @public + * @abstract + * @param {*|module:echarts/data/List} valueOrData + * @param {number} dataIndex + * @return {string} state See this.stateList + */ + getValueState: noop$2, + + /** + * FIXME + * Do not publish to thirt-part-dev temporarily + * util the interface is stable. (Should it return + * a function but not visual meta?) + * + * @pubilc + * @abstract + * @param {Function} getColorVisual + * params: value, valueState + * return: color + * @return {Object} visualMeta + * should includes {stops, outerColors} + * outerColor means [colorBeyondMinValue, colorBeyondMaxValue] + */ + getVisualMeta: noop$2 + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Constant +var DEFAULT_BAR_BOUND = [20, 140]; + +var ContinuousModel = VisualMapModel.extend({ + + type: 'visualMap.continuous', + + /** + * @protected + */ + defaultOption: { + align: 'auto', // 'auto', 'left', 'right', 'top', 'bottom' + calculable: false, // This prop effect default component type determine, + // See echarts/component/visualMap/typeDefaulter. + range: null, // selected range. In default case `range` is [min, max] + // and can auto change along with modification of min max, + // util use specifid a range. + realtime: true, // Whether realtime update. + itemHeight: null, // The length of the range control edge. + itemWidth: null, // The length of the other side. + hoverLink: true, // Enable hover highlight. + hoverLinkDataSize: null,// The size of hovered data. + hoverLinkOnHandle: null // Whether trigger hoverLink when hover handle. + // If not specified, follow the value of `realtime`. + }, + + /** + * @override + */ + optionUpdated: function (newOption, isInit) { + ContinuousModel.superApply(this, 'optionUpdated', arguments); + + this.resetExtent(); + + this.resetVisual(function (mappingOption) { + mappingOption.mappingMethod = 'linear'; + mappingOption.dataExtent = this.getExtent(); + }); + + this._resetRange(); + }, + + /** + * @protected + * @override + */ + resetItemSize: function () { + ContinuousModel.superApply(this, 'resetItemSize', 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 || range.auto) { + // `range` should always be array (so we dont use other + // value like 'auto') for user-friend. (consider getOption). + dataExtent.auto = 1; + this.option.range = dataExtent; + } + else if (isArray(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); + + each$1(this.stateList, function (state) { + var symbolSize = this.option.controller[state].symbolSize; + if (symbolSize && symbolSize[0] !== symbolSize[1]) { + symbolSize[0] = 0; // For good looking. + } + }, this); + }, + + /** + * @override + */ + setSelected: function (selected) { + this.option.range = selected.slice(); + this._resetRange(); + }, + + /** + * @public + */ + getSelected: function () { + var dataExtent = this.getExtent(); + + var dataInterval = 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; + }, + + /** + * @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'; + }, + + /** + * @params {Array.} range target value: range[0] <= value && value <= range[1] + * @return {Array.} [{seriesId, dataIndices: >}, ...] + */ + findTargetDataIndices: function (range) { + var result = []; + + this.eachTargetSeries(function (seriesModel) { + var dataIndices = []; + var data = seriesModel.getData(); + + data.each(this.getDataDimension(data), function (value, dataIndex) { + range[0] <= value && value <= range[1] && dataIndices.push(dataIndex); + }, this); + + result.push({seriesId: seriesModel.id, dataIndex: dataIndices}); + }, this); + + return result; + }, + + /** + * @implement + */ + getVisualMeta: function (getColorVisual) { + var oVals = getColorStopValues(this, 'outOfRange', this.getExtent()); + var iVals = getColorStopValues(this, 'inRange', this.option.range.slice()); + var stops = []; + + function setStop(value, valueState) { + stops.push({ + value: value, + color: getColorVisual(value, valueState) + }); + } + + // Format to: outOfRange -- inRange -- outOfRange. + var iIdx = 0; + var oIdx = 0; + var iLen = iVals.length; + var oLen = oVals.length; + + for (; oIdx < oLen && (!iVals.length || oVals[oIdx] <= iVals[0]); oIdx++) { + // If oVal[oIdx] === iVals[iIdx], oVal[oIdx] should be ignored. + if (oVals[oIdx] < iVals[iIdx]) { + setStop(oVals[oIdx], 'outOfRange'); + } + } + for (var first = 1; iIdx < iLen; iIdx++, first = 0) { + // If range is full, value beyond min, max will be clamped. + // make a singularity + first && stops.length && setStop(iVals[iIdx], 'outOfRange'); + setStop(iVals[iIdx], 'inRange'); + } + for (var first = 1; oIdx < oLen; oIdx++) { + if (!iVals.length || iVals[iVals.length - 1] < oVals[oIdx]) { + // make a singularity + if (first) { + stops.length && setStop(stops[stops.length - 1].value, 'outOfRange'); + first = 0; + } + setStop(oVals[oIdx], 'outOfRange'); + } + } + + var stopsLen = stops.length; + + return { + stops: stops, + outerColors: [ + stopsLen ? stops[0].color : 'transparent', + stopsLen ? stops[stopsLen - 1].color : 'transparent' + ] + }; + } + +}); + +function getColorStopValues(visualMapModel, valueState, dataExtent) { + if (dataExtent[0] === dataExtent[1]) { + return dataExtent.slice(); + } + + // When using colorHue mapping, it is not linear color any more. + // Moreover, canvas gradient seems not to be accurate linear. + // FIXME + // Should be arbitrary value 100? or based on pixel size? + var count = 200; + var step = (dataExtent[1] - dataExtent[0]) / count; + + var value = dataExtent[0]; + var stopValues = []; + for (var i = 0; i <= count && value < dataExtent[1]; i++) { + stopValues.push(value); + value += step; + } + stopValues.push(dataExtent[1]); + + return stopValues; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 VisualMapView = 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; + }, + + /** + * @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 = normalizeCssArray$1(visualMapModel.get('padding') || 0); + var rect = group.getBoundingRect(); + + group.add(new 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} targetValue can be Infinity or -Infinity + * @param {string=} visualCluster Only can be 'color' 'opacity' 'symbol' 'symbolSize' + * @param {Object} [opts] + * @param {string=} [opts.forceState] Specify state, instead of using getValueState method. + * @param {string=} [opts.convertOpacityToAlpha=false] For color gradient in controller widget. + * @return {*} Visual value. + */ + getControllerVisual: function (targetValue, visualCluster, opts) { + opts = opts || {}; + + var forceState = opts.forceState; + var visualMapModel = this.visualMapModel; + var visualObj = {}; + + // Default values. + if (visualCluster === 'symbol') { + visualObj.symbol = visualMapModel.get('itemSymbol'); + } + if (visualCluster === 'color') { + var defaultColor = visualMapModel.get('contentColor'); + visualObj.color = defaultColor; + } + + function getter(key) { + return visualObj[key]; + } + + function setter(key, value) { + visualObj[key] = value; + } + + var mappings = visualMapModel.controllerVisuals[ + forceState || visualMapModel.getValueState(targetValue) + ]; + var visualTypes = VisualMapping.prepareVisualTypes(mappings); + + each$1(visualTypes, function (type) { + var visualMapping = mappings[type]; + if (opts.convertOpacityToAlpha && type === 'opacity') { + type = 'colorAlpha'; + visualMapping = mappings.__alphaForOpacity; + } + if (VisualMapping.dependsOn(type, visualCluster)) { + visualMapping && visualMapping.applyVisual( + targetValue, getter, setter + ); + } + }); + + return visualObj[visualCluster]; + }, + + /** + * @protected + */ + positionGroup: function (group) { + var model = this.visualMapModel; + var api = this.api; + + positionElement( + group, + model.getBoxLayoutParams(), + {width: api.getWidth(), height: api.getHeight()} + ); + }, + + /** + * @protected + * @abstract + */ + doRender: noop + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * @param {module:echarts/component/visualMap/VisualMapModel} visualMapModel\ + * @param {module:echarts/ExtensionAPI} api + * @param {Array.} itemSize always [short, long] + * @return {string} 'left' or 'right' or 'top' or 'bottom' + */ +function getItemAlign(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 = 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 + ]; +} + +/** + * Prepare dataIndex for outside usage, where dataIndex means rawIndex, and + * dataIndexInside means filtered index. + */ +function convertDataIndex(batch) { + each$1(batch || [], function (batchItem) { + if (batch.dataIndex != null) { + batch.dataIndexInside = batch.dataIndex; + batch.dataIndex = null; + } + }); + return batch; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 linearMap$3 = linearMap; +var each$26 = each$1; +var mathMin$7 = Math.min; +var mathMax$7 = Math.max; + +// Arbitrary value +var HOVER_LINK_SIZE = 12; +var HOVER_LINK_OUT = 6; + +// 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 ContinuousView = VisualMapView.extend({ + + type: 'visualMap.continuous', + + /** + * @override + */ + init: function () { + + ContinuousView.superApply(this, 'init', arguments); + + /** + * @private + */ + this._shapes = {}; + + /** + * @private + */ + this._dataInterval = []; + + /** + * @private + */ + this._handleEnds = []; + + /** + * @private + */ + this._orient; + + /** + * @private + */ + this._useHandle; + + /** + * @private + */ + this._hoverLinkDataIndices = []; + + /** + * @private + */ + this._dragging; + + /** + * @private + */ + this._hovering; + }, + + /** + * @protected + * @override + */ + doRender: function (visualMapModel, ecModel, api, payload) { + if (!payload || payload.type !== 'selectDataRange' || payload.from !== this.uid) { + this._buildView(); + } + }, + + /** + * @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._enableHoverLinkToSeries(); + this._enableHoverLinkFromSeries(); + + 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 Text({ + style: { + x: position[0], + y: position[1], + textVerticalAlign: orient === 'horizontal' ? 'middle' : align, + textAlign: orient === 'horizontal' ? align : 'center', + text: text, + textFont: textStyleModel.getFont(), + textFill: 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 = getItemAlign(visualMapModel, this.api, itemSize); + var barGroup = shapes.barGroup = this._createBarGroup(itemAlign); + + // Bar + barGroup.add(shapes.outOfRange = createPolygon()); + barGroup.add(shapes.inRange = createPolygon( + null, + useHandle ? getCursor$1(this._orient) : null, + bind(this._dragHandle, this, 'all', false), + bind(this._dragHandle, this, 'all', true) + )); + + var textRect = visualMapModel.textStyleModel.getTextRect('国'); + var textSize = mathMax$7(textRect.width, textRect.height); + + // Handle + if (useHandle) { + shapes.handleThumbs = []; + shapes.handleLabels = []; + shapes.handleLabelPoints = []; + + this._createHandle(barGroup, 0, itemSize, textSize, orient, itemAlign); + this._createHandle(barGroup, 1, itemSize, textSize, orient, itemAlign); + } + + this._createIndicator(barGroup, itemSize, textSize, orient); + + targetGroup.add(barGroup); + }, + + /** + * @private + */ + _createHandle: function (barGroup, handleIndex, itemSize, textSize, orient) { + var onDrift = bind(this._dragHandle, this, handleIndex, false); + var onDragEnd = bind(this._dragHandle, this, handleIndex, true); + var handleThumb = createPolygon( + createHandlePoints(handleIndex, textSize), + getCursor$1(this._orient), + onDrift, + onDragEnd + ); + handleThumb.position[0] = itemSize[0]; + barGroup.add(handleThumb); + + // Text is always horizontal layout but should not be effected by + // transform (orient/inverse). So label is built separately but not + // use zrender/graphic/helper/RectText, and is located based on view + // group (according to handleLabelPoint) but not barGroup. + var textStyleModel = this.visualMapModel.textStyleModel; + var handleLabel = new Text({ + draggable: true, + drift: onDrift, + onmousemove: function (e) { + // Fot mobile devicem, prevent screen slider on the button. + stop(e.event); + }, + ondragend: onDragEnd, + style: { + x: 0, y: 0, text: '', + textFont: textStyleModel.getFont(), + textFill: textStyleModel.getTextColor() + } + }); + this.group.add(handleLabel); + + var handleLabelPoint = [ + orient === 'horizontal' + ? textSize / 2 + : textSize * 1.5, + orient === 'horizontal' + ? (handleIndex === 0 ? -(textSize * 1.5) : (textSize * 1.5)) + : (handleIndex === 0 ? -textSize / 2 : textSize / 2) + ]; + + var shapes = this._shapes; + shapes.handleThumbs[handleIndex] = handleThumb; + shapes.handleLabelPoints[handleIndex] = handleLabelPoint; + shapes.handleLabels[handleIndex] = handleLabel; + }, + + /** + * @private + */ + _createIndicator: function (barGroup, itemSize, textSize, orient) { + var indicator = createPolygon([[0, 0]], 'move'); + indicator.position[0] = itemSize[0]; + indicator.attr({invisible: true, silent: true}); + barGroup.add(indicator); + + var textStyleModel = this.visualMapModel.textStyleModel; + var indicatorLabel = new Text({ + silent: true, + invisible: true, + style: { + x: 0, y: 0, text: '', + textFont: textStyleModel.getFont(), + textFill: textStyleModel.getTextColor() + } + }); + this.group.add(indicatorLabel); + + var indicatorLabelPoint = [ + orient === 'horizontal' ? textSize / 2 : HOVER_LINK_OUT + 3, + 0 + ]; + + var shapes = this._shapes; + shapes.indicator = indicator; + shapes.indicatorLabel = indicatorLabel; + shapes.indicatorLabelPoint = indicatorLabelPoint; + }, + + /** + * @private + */ + _dragHandle: function (handleIndex, isEnd, dx, dy) { + if (!this._useHandle) { + return; + } + + this._dragging = !isEnd; + + if (!isEnd) { + // Transform dx, dy to bar coordination. + var vertex = this._applyTransform([dx, dy], this._shapes.barGroup, true); + this._updateInterval(handleIndex, vertex[1]); + + // Considering realtime, update view should be executed + // before dispatch action. + this._updateView(); + } + + // dragEnd do not dispatch action when realtime. + if (isEnd === !this.visualMapModel.get('realtime')) { // jshint ignore:line + this.api.dispatchAction({ + type: 'selectDataRange', + from: this.uid, + visualMapId: this.visualMapModel.id, + selected: this._dataInterval.slice() + }); + } + + if (isEnd) { + !this._hovering && this._clearHoverLinkToSeries(); + } + else if (useHoverLinkOnHandle(this.visualMapModel)) { + this._doHoverLinkToSeries(this._handleEnds[handleIndex], false); + } + }, + + /** + * @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$3(dataInterval[0], dataExtent, sizeExtent, true), + linearMap$3(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; + var sizeExtent = [0, visualMapModel.itemSize[1]]; + + sliderMove( + delta, + handleEnds, + sizeExtent, + handleIndex, + // cross is forbiden + 0 + ); + + var dataExtent = visualMapModel.getExtent(); + // Update data interval. + this._dataInterval = [ + linearMap$3(handleEnds[0], sizeExtent, dataExtent, true), + linearMap$3(handleEnds[1], sizeExtent, dataExtent, true) + ]; + }, + + /** + * @private + */ + _updateView: function (forSketch) { + var visualMapModel = this.visualMapModel; + var dataExtent = visualMapModel.getExtent(); + var shapes = this._shapes; + + var outOfRangeHandleEnds = [0, visualMapModel.itemSize[1]]; + var inRangeHandleEnds = forSketch ? outOfRangeHandleEnds : this._handleEnds; + + var visualInRange = this._createBarVisual( + this._dataInterval, dataExtent, inRangeHandleEnds, 'inRange' + ); + var visualOutOfRange = this._createBarVisual( + dataExtent, dataExtent, outOfRangeHandleEnds, 'outOfRange' + ); + + shapes.inRange + .setStyle({ + fill: visualInRange.barColor, + opacity: visualInRange.opacity + }) + .setShape('points', visualInRange.barPoints); + shapes.outOfRange + .setStyle({ + fill: visualOutOfRange.barColor, + opacity: visualOutOfRange.opacity + }) + .setShape('points', visualOutOfRange.barPoints); + + this._updateHandle(inRangeHandleEnds, visualInRange); + }, + + /** + * @private + */ + _createBarVisual: function (dataInterval, dataExtent, handleEnds, forceState) { + var opts = { + forceState: forceState, + convertOpacityToAlpha: true + }; + var colorStops = this._makeColorGradient(dataInterval, opts); + + var symbolSizes = [ + this.getControllerVisual(dataInterval[0], 'symbolSize', opts), + this.getControllerVisual(dataInterval[1], 'symbolSize', opts) + ]; + var barPoints = this._createBarPoints(handleEnds, symbolSizes); + + return { + barColor: new LinearGradient(0, 0, 0, 1, colorStops), + barPoints: barPoints, + handlesColor: [ + colorStops[0].color, + colorStops[colorStops.length - 1].color + ] + }; + }, + + /** + * @private + */ + _makeColorGradient: function (dataInterval, opts) { + // Considering colorHue, which is not linear, so we have to sample + // to calculate gradient color stops, but not only caculate head + // and tail. + var sampleNumber = 100; // Arbitrary value. + var colorStops = []; + var step = (dataInterval[1] - dataInterval[0]) / sampleNumber; + + colorStops.push({ + color: this.getControllerVisual(dataInterval[0], 'color', opts), + offset: 0 + }); + + for (var i = 1; i < sampleNumber; i++) { + var currValue = dataInterval[0] + step * i; + if (currValue > dataInterval[1]) { + break; + } + colorStops.push({ + color: this.getControllerVisual(currValue, 'color', opts), + offset: i / sampleNumber + }); + } + + colorStops.push({ + color: this.getControllerVisual(dataInterval[1], 'color', opts), + offset: 1 + }); + + return colorStops; + }, + + /** + * @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 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 + */ + _updateHandle: function (handleEnds, visualInRange) { + if (!this._useHandle) { + return; + } + + var shapes = this._shapes; + var visualMapModel = this.visualMapModel; + var handleThumbs = shapes.handleThumbs; + var handleLabels = shapes.handleLabels; + + each$26([0, 1], function (handleIndex) { + var handleThumb = handleThumbs[handleIndex]; + handleThumb.setStyle('fill', visualInRange.handlesColor[handleIndex]); + handleThumb.position[1] = handleEnds[handleIndex]; + + // Update handle label position. + var textPoint = applyTransform$1( + shapes.handleLabelPoints[handleIndex], + getTransform(handleThumb, this.group) + ); + handleLabels[handleIndex].setStyle({ + x: textPoint[0], + y: textPoint[1], + text: visualMapModel.formatValueText(this._dataInterval[handleIndex]), + textVerticalAlign: 'middle', + textAlign: this._applyTransform( + this._orient === 'horizontal' + ? (handleIndex === 0 ? 'bottom' : 'top') + : 'left', + shapes.barGroup + ) + }); + }, this); + }, + + /** + * @private + * @param {number} cursorValue + * @param {number} textValue + * @param {string} [rangeSymbol] + * @param {number} [halfHoverLinkSize] + */ + _showIndicator: function (cursorValue, textValue, rangeSymbol, halfHoverLinkSize) { + var visualMapModel = this.visualMapModel; + var dataExtent = visualMapModel.getExtent(); + var itemSize = visualMapModel.itemSize; + var sizeExtent = [0, itemSize[1]]; + var pos = linearMap$3(cursorValue, dataExtent, sizeExtent, true); + + var shapes = this._shapes; + var indicator = shapes.indicator; + if (!indicator) { + return; + } + + indicator.position[1] = pos; + indicator.attr('invisible', false); + indicator.setShape('points', createIndicatorPoints( + !!rangeSymbol, halfHoverLinkSize, pos, itemSize[1] + )); + + var opts = {convertOpacityToAlpha: true}; + var color = this.getControllerVisual(cursorValue, 'color', opts); + indicator.setStyle('fill', color); + + // Update handle label position. + var textPoint = applyTransform$1( + shapes.indicatorLabelPoint, + getTransform(indicator, this.group) + ); + + var indicatorLabel = shapes.indicatorLabel; + indicatorLabel.attr('invisible', false); + var align = this._applyTransform('left', shapes.barGroup); + var orient = this._orient; + indicatorLabel.setStyle({ + text: (rangeSymbol ? rangeSymbol : '') + visualMapModel.formatValueText(textValue), + textVerticalAlign: orient === 'horizontal' ? align : 'middle', + textAlign: orient === 'horizontal' ? 'center' : align, + x: textPoint[0], + y: textPoint[1] + }); + }, + + /** + * @private + */ + _enableHoverLinkToSeries: function () { + var self = this; + this._shapes.barGroup + + .on('mousemove', function (e) { + self._hovering = true; + + if (!self._dragging) { + var itemSize = self.visualMapModel.itemSize; + var pos = self._applyTransform( + [e.offsetX, e.offsetY], self._shapes.barGroup, true, true + ); + // For hover link show when hover handle, which might be + // below or upper than sizeExtent. + pos[1] = mathMin$7(mathMax$7(0, pos[1]), itemSize[1]); + self._doHoverLinkToSeries( + pos[1], + 0 <= pos[0] && pos[0] <= itemSize[0] + ); + } + }) + + .on('mouseout', function () { + // When mouse is out of handle, hoverLink still need + // to be displayed when realtime is set as false. + self._hovering = false; + !self._dragging && self._clearHoverLinkToSeries(); + }); + }, + + /** + * @private + */ + _enableHoverLinkFromSeries: function () { + var zr = this.api.getZr(); + + if (this.visualMapModel.option.hoverLink) { + zr.on('mouseover', this._hoverLinkFromSeriesMouseOver, this); + zr.on('mouseout', this._hideIndicator, this); + } + else { + this._clearHoverLinkFromSeries(); + } + }, + + /** + * @private + */ + _doHoverLinkToSeries: function (cursorPos, hoverOnBar) { + var visualMapModel = this.visualMapModel; + var itemSize = visualMapModel.itemSize; + + if (!visualMapModel.option.hoverLink) { + return; + } + + var sizeExtent = [0, itemSize[1]]; + var dataExtent = visualMapModel.getExtent(); + + // For hover link show when hover handle, which might be below or upper than sizeExtent. + cursorPos = mathMin$7(mathMax$7(sizeExtent[0], cursorPos), sizeExtent[1]); + + var halfHoverLinkSize = getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent); + var hoverRange = [cursorPos - halfHoverLinkSize, cursorPos + halfHoverLinkSize]; + var cursorValue = linearMap$3(cursorPos, sizeExtent, dataExtent, true); + var valueRange = [ + linearMap$3(hoverRange[0], sizeExtent, dataExtent, true), + linearMap$3(hoverRange[1], sizeExtent, dataExtent, true) + ]; + // Consider data range is out of visualMap range, see test/visualMap-continuous.html, + // where china and india has very large population. + hoverRange[0] < sizeExtent[0] && (valueRange[0] = -Infinity); + hoverRange[1] > sizeExtent[1] && (valueRange[1] = Infinity); + + // Do not show indicator when mouse is over handle, + // otherwise labels overlap, especially when dragging. + if (hoverOnBar) { + if (valueRange[0] === -Infinity) { + this._showIndicator(cursorValue, valueRange[1], '< ', halfHoverLinkSize); + } + else if (valueRange[1] === Infinity) { + this._showIndicator(cursorValue, valueRange[0], '> ', halfHoverLinkSize); + } + else { + this._showIndicator(cursorValue, cursorValue, '≈ ', halfHoverLinkSize); + } + } + + // When realtime is set as false, handles, which are in barGroup, + // also trigger hoverLink, which help user to realize where they + // focus on when dragging. (see test/heatmap-large.html) + // When realtime is set as true, highlight will not show when hover + // handle, because the label on handle, which displays a exact value + // but not range, might mislead users. + var oldBatch = this._hoverLinkDataIndices; + var newBatch = []; + if (hoverOnBar || useHoverLinkOnHandle(visualMapModel)) { + newBatch = this._hoverLinkDataIndices = visualMapModel.findTargetDataIndices(valueRange); + } + + var resultBatches = compressBatches(oldBatch, newBatch); + + this._dispatchHighDown('downplay', convertDataIndex(resultBatches[0])); + this._dispatchHighDown('highlight', convertDataIndex(resultBatches[1])); + }, + + /** + * @private + */ + _hoverLinkFromSeriesMouseOver: function (e) { + var el = e.target; + var visualMapModel = this.visualMapModel; + + if (!el || el.dataIndex == null) { + return; + } + + var dataModel = this.ecModel.getSeriesByIndex(el.seriesIndex); + + if (!visualMapModel.isTargetSeries(dataModel)) { + return; + } + + var data = dataModel.getData(el.dataType); + var value = data.get(visualMapModel.getDataDimension(data), el.dataIndex, true); + + if (!isNaN(value)) { + this._showIndicator(value, value); + } + }, + + /** + * @private + */ + _hideIndicator: function () { + var shapes = this._shapes; + shapes.indicator && shapes.indicator.attr('invisible', true); + shapes.indicatorLabel && shapes.indicatorLabel.attr('invisible', true); + }, + + /** + * @private + */ + _clearHoverLinkToSeries: function () { + this._hideIndicator(); + + var indices = this._hoverLinkDataIndices; + this._dispatchHighDown('downplay', convertDataIndex(indices)); + + indices.length = 0; + }, + + /** + * @private + */ + _clearHoverLinkFromSeries: function () { + this._hideIndicator(); + + var zr = this.api.getZr(); + zr.off('mouseover', this._hoverLinkFromSeriesMouseOver); + zr.off('mouseout', this._hideIndicator); + }, + + /** + * @private + */ + _applyTransform: function (vertex, element, inverse, global) { + var transform = getTransform(element, global ? null : this.group); + + return graphic[ + isArray(vertex) ? 'applyTransform' : 'transformDirection' + ](vertex, transform, inverse); + }, + + /** + * @private + */ + _dispatchHighDown: function (type, batch) { + batch && batch.length && this.api.dispatchAction({ + type: type, + batch: batch + }); + }, + + /** + * @override + */ + dispose: function () { + this._clearHoverLinkFromSeries(); + this._clearHoverLinkToSeries(); + }, + + /** + * @override + */ + remove: function () { + this._clearHoverLinkFromSeries(); + this._clearHoverLinkToSeries(); + } + +}); + +function createPolygon(points, cursor, onDrift, onDragEnd) { + return new Polygon({ + shape: {points: points}, + draggable: !!onDrift, + cursor: cursor, + drift: onDrift, + onmousemove: function (e) { + // Fot mobile devicem, prevent screen slider on the button. + stop(e.event); + }, + ondragend: onDragEnd + }); +} + +function createHandlePoints(handleIndex, textSize) { + return handleIndex === 0 + ? [[0, 0], [textSize, 0], [textSize, -textSize]] + : [[0, 0], [textSize, 0], [textSize, textSize]]; +} + +function createIndicatorPoints(isRange, halfHoverLinkSize, pos, extentMax) { + return isRange + ? [ // indicate range + [0, -mathMin$7(halfHoverLinkSize, mathMax$7(pos, 0))], + [HOVER_LINK_OUT, 0], + [0, mathMin$7(halfHoverLinkSize, mathMax$7(extentMax - pos, 0))] + ] + : [ // indicate single value + [0, 0], [5, -5], [5, 5] + ]; +} + +function getHalfHoverLinkSize(visualMapModel, dataExtent, sizeExtent) { + var halfHoverLinkSize = HOVER_LINK_SIZE / 2; + var hoverLinkDataSize = visualMapModel.get('hoverLinkDataSize'); + if (hoverLinkDataSize) { + halfHoverLinkSize = linearMap$3(hoverLinkDataSize, dataExtent, sizeExtent, true) / 2; + } + return halfHoverLinkSize; +} + +function useHoverLinkOnHandle(visualMapModel) { + var hoverLinkOnHandle = visualMapModel.get('hoverLinkOnHandle'); + return !!(hoverLinkOnHandle == null ? visualMapModel.get('realtime') : hoverLinkOnHandle); +} + +function getCursor$1(orient) { + return orient === 'vertical' ? 'ns-resize' : 'ew-resize'; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 actionInfo$2 = { + type: 'selectDataRange', + event: 'dataRangeSelected', + // FIXME use updateView appears wrong + update: 'update' +}; + +registerAction(actionInfo$2, function (payload, ecModel) { + + ecModel.eachComponent({mainType: 'visualMap', query: payload}, function (model) { + model.setSelected(payload.selected); + }); + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * DataZoom component entry + */ + +registerPreprocessor(preprocessor$2); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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. + + minOpen: false, // Whether include values that smaller than `min`. + maxOpen: false, // Whether include values that bigger than `max`. + + align: 'auto', // 'auto', 'left', 'right' + itemWidth: 20, // When put the controller vertically, it is the length of + // horizontal side of each item. Otherwise, vertical side. + itemHeight: 14, // When put the controller vertically, it is the length of + // vertical side of each item. Otherwise, horizontal side. + itemSymbol: 'roundRect', + pieceList: null, // Each item is Object, with some of those attrs: + // {min, max, lt, gt, lte, gte, value, + // color, colorSaturation, colorAlpha, opacity, + // symbol, symbolSize}, which customize the range or visual + // coding of the certain piece. Besides, see "Order Rule". + categories: null, // category names, like: ['some1', 'some2', 'some3']. + // Attr min/max are ignored when categories set. See "Order Rule" + splitNumber: 5, // If set to 5, auto split five pieces equally. + // If set to 0 and component type not set, component type will be + // determined as "continuous". (It is less reasonable but for ec2 + // compatibility, see echarts/component/visualMap/typeDefaulter) + selectedMode: 'multiple', // Can be 'multiple' or 'single'. + itemGap: 10, // The gap between two items, in px. + hoverLink: true, // Enable hover highlight. + + showLabel: null // By default, when text is used, label will hide (the logic + // is remained for compatibility reason) + }, + + /** + * @override + */ + optionUpdated: function (newOption, isInit) { + PiecewiseModel.superApply(this, 'optionUpdated', arguments); + + /** + * The order is always [low, ..., high]. + * [{text: string, interval: Array.}, ...] + * @private + * @type {Array.} + */ + this._pieceList = []; + + this.resetExtent(); + + /** + * 'pieces', 'categories', 'splitNumber' + * @type {string} + */ + var mode = this._mode = this._determineMode(); + + 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 = clone(categories); + } + else { + mappingOption.dataExtent = this.getExtent(); + mappingOption.mappingMethod = 'piecewise'; + mappingOption.pieceList = map(this._pieceList, function (piece) { + var piece = clone(piece); + if (state !== 'inRange') { + // FIXME + // outOfRange do not support special visual in pieces. + piece.visual = null; + } + return piece; + }); + } + }); + }, + + /** + * @protected + * @override + */ + completeVisualOption: function () { + // Consider this case: + // visualMap: { + // pieces: [{symbol: 'circle', lt: 0}, {symbol: 'rect', gte: 0}] + // } + // where no inRange/outOfRange set but only pieces. So we should make + // default inRange/outOfRange for this case, otherwise visuals that only + // appear in `pieces` will not be taken into account in visual encoding. + + var option = this.option; + var visualTypesInPieces = {}; + var visualTypes = VisualMapping.listVisualTypes(); + var isCategory = this.isCategory(); + + each$1(option.pieces, function (piece) { + each$1(visualTypes, function (visualType) { + if (piece.hasOwnProperty(visualType)) { + visualTypesInPieces[visualType] = 1; + } + }); + }); + + each$1(visualTypesInPieces, function (v, visualType) { + var exists = 0; + each$1(this.stateList, function (state) { + exists |= has(option, state, visualType) + || has(option.target, state, visualType); + }, this); + + !exists && each$1(this.stateList, function (state) { + (option[state] || (option[state] = {}))[visualType] = visualDefault.get( + visualType, state === 'inRange' ? 'active' : 'inactive', isCategory + ); + }); + }, this); + + function has(obj, state, visualType) { + return obj && obj[state] && ( + isObject$1(obj[state]) + ? obj[state].hasOwnProperty(visualType) + : obj[state] === visualType // e.g., inRange: 'symbol' + ); + } + + VisualMapModel.prototype.completeVisualOption.apply(this, arguments); + }, + + _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. + each$1(pieceList, function (piece, index) { + var key = this.getSelectedMapKey(piece); + if (!selected.hasOwnProperty(key)) { + selected[key] = true; + } + }, this); + + if (thisOption.selectedMode === 'single') { + // Ensure there is only one selected. + var hasSel = false; + + each$1(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} + */ + _determineMode: 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 = clone(selected); + }, + + /** + * @public + * @override + */ + getValueState: function (value) { + var index = VisualMapping.findPieceIndex(value, this._pieceList); + + return index != null + ? (this.option.selected[this.getSelectedMapKey(this._pieceList[index])] + ? 'inRange' : 'outOfRange' + ) + : 'outOfRange'; + }, + + /** + * @public + * @params {number} pieceIndex piece index in visualMapModel.getPieceList() + * @return {Array.} [{seriesId, dataIndices: >}, ...] + */ + findTargetDataIndices: function (pieceIndex) { + var result = []; + + this.eachTargetSeries(function (seriesModel) { + var dataIndices = []; + var data = seriesModel.getData(); + + data.each(this.getDataDimension(data), function (value, dataIndex) { + // Should always base on model pieceList, because it is order sensitive. + var pIdx = VisualMapping.findPieceIndex(value, this._pieceList); + pIdx === pieceIndex && dataIndices.push(dataIndex); + }, this); + + result.push({seriesId: seriesModel.id, dataIndex: dataIndices}); + }, this); + + return result; + }, + + /** + * @private + * @param {Object} piece piece.value or piece.interval is required. + * @return {number} Can be Infinity or -Infinity + */ + getRepresentValue: function (piece) { + var representValue; + if (this.isCategory()) { + representValue = piece.value; + } + else { + if (piece.value != null) { + representValue = piece.value; + } + else { + var pieceInterval = piece.interval || []; + representValue = (pieceInterval[0] === -Infinity && pieceInterval[1] === Infinity) + ? 0 + : (pieceInterval[0] + pieceInterval[1]) / 2; + } + } + return representValue; + }, + + getVisualMeta: function (getColorVisual) { + // Do not support category. (category axis is ordinal, numerical) + if (this.isCategory()) { + return; + } + + var stops = []; + var outerColors = []; + var visualMapModel = this; + + function setStop(interval, valueState) { + var representValue = visualMapModel.getRepresentValue({interval: interval}); + if (!valueState) { + valueState = visualMapModel.getValueState(representValue); + } + var color = getColorVisual(representValue, valueState); + if (interval[0] === -Infinity) { + outerColors[0] = color; + } + else if (interval[1] === Infinity) { + outerColors[1] = color; + } + else { + stops.push( + {value: interval[0], color: color}, + {value: interval[1], color: color} + ); + } + } + + // Suplement + var pieceList = this._pieceList.slice(); + if (!pieceList.length) { + pieceList.push({interval: [-Infinity, Infinity]}); + } + else { + var edge = pieceList[0].interval[0]; + edge !== -Infinity && pieceList.unshift({interval: [-Infinity, edge]}); + edge = pieceList[pieceList.length - 1].interval[1]; + edge !== Infinity && pieceList.push({interval: [edge, Infinity]}); + } + + var curr = -Infinity; + each$1(pieceList, function (piece) { + var interval = piece.interval; + if (interval) { + // Fulfill gap. + interval[0] > curr && setStop([curr, interval[0]], 'outOfRange'); + setStop(interval.slice()); + curr = interval[1]; + } + }, this); + + return {stops: stops, outerColors: outerColors}; + } + +}); + +/** + * Key is this._mode + * @type {Object} + * @this {module:echarts/component/viusalMap/PiecewiseMode} + */ +var resetMethods = { + + splitNumber: function () { + var thisOption = this.option; + var pieceList = this._pieceList; + var precision = Math.min(thisOption.precision, 20); + 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); + + var index = 0; + + if (thisOption.minOpen) { + pieceList.push({ + index: index++, + interval: [-Infinity, dataExtent[0]], + close: [0, 0] + }); + } + + for ( + var curr = dataExtent[0], len = index + splitNumber; + index < len; + curr += splitStep + ) { + var max = index === splitNumber - 1 ? dataExtent[1] : (curr + splitStep); + + pieceList.push({ + index: index++, + interval: [curr, max], + close: [1, 1] + }); + } + + if (thisOption.maxOpen) { + pieceList.push({ + index: index++, + interval: [dataExtent[1], Infinity], + close: [0, 0] + }); + } + + reformIntervals(pieceList); + + each$1(pieceList, function (piece) { + piece.text = this.formatValueText(piece.interval); + }, this); + }, + + categories: function () { + var thisOption = this.option; + each$1(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; + var pieceList = this._pieceList; + + each$1(thisOption.pieces, function (pieceListItem, index) { + + if (!isObject$1(pieceListItem)) { + pieceListItem = {value: pieceListItem}; + } + + var item = {text: '', index: index}; + + if (pieceListItem.label != null) { + item.text = pieceListItem.label; + } + + if (pieceListItem.hasOwnProperty('value')) { + var value = item.value = pieceListItem.value; + item.interval = [value, value]; + item.close = [1, 1]; + } + else { + // `min` `max` is legacy option. + // `lt` `gt` `lte` `gte` is recommanded. + var interval = item.interval = []; + var close = item.close = [0, 0]; + + var closeList = [1, 0, 1]; + var infinityList = [-Infinity, Infinity]; + + var useMinMax = []; + for (var lg = 0; lg < 2; lg++) { + var names = [['gte', 'gt', 'min'], ['lte', 'lt', 'max']][lg]; + for (var i = 0; i < 3 && interval[lg] == null; i++) { + interval[lg] = pieceListItem[names[i]]; + close[lg] = closeList[i]; + useMinMax[lg] = i === 2; + } + interval[lg] == null && (interval[lg] = infinityList[lg]); + } + useMinMax[0] && interval[1] === Infinity && (close[0] = 0); + useMinMax[1] && interval[0] === -Infinity && (close[1] = 0); + + if (__DEV__) { + if (interval[0] > interval[1]) { + console.warn( + 'Piece ' + index + 'is illegal: ' + interval + + ' lower bound should not greater then uppper bound.' + ); + } + } + + if (interval[0] === interval[1] && close[0] && close[1]) { + // Consider: [{min: 5, max: 5, visual: {...}}, {min: 0, max: 5}], + // we use value to lift the priority when min === max + item.value = interval[0]; + } + } + + item.visual = VisualMapping.retrieveVisuals(pieceListItem); + + pieceList.push(item); + + }, this); + + // See "Order Rule". + normalizeReverse(thisOption, pieceList); + // Only pieces + reformIntervals(pieceList); + + each$1(pieceList, function (piece) { + var close = piece.close; + var edgeSymbols = [['<', '≤'][close[1]], ['>', '≥'][close[0]]]; + piece.text = piece.text || this.formatValueText( + piece.value != null ? piece.value : piece.interval, + false, + edgeSymbols + ); + }, this); + } +}; + +function normalizeReverse(thisOption, pieceList) { + var inverse = thisOption.inverse; + if (thisOption.orient === 'vertical' ? !inverse : inverse) { + pieceList.reverse(); + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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 endsText = viewData.endsText; + var showLabel = retrieve(visualMapModel.get('showLabel', true), !endsText); + + endsText && this._renderEndsText( + thisGroup, endsText[0], itemSize, showLabel, itemAlign + ); + + each$1(viewData.viewPieceList, renderItem, this); + + endsText && this._renderEndsText( + thisGroup, endsText[1], itemSize, showLabel, itemAlign + ); + + box( + visualMapModel.get('orient'), thisGroup, visualMapModel.get('itemGap') + ); + + this.renderBackground(thisGroup); + + this.positionGroup(thisGroup); + + function renderItem(item) { + var piece = item.piece; + + var itemGroup = new Group(); + itemGroup.onclick = bind(this._onItemClick, this, piece); + + this._enableHoverLink(itemGroup, item.indexInModelPieceList); + + var representValue = visualMapModel.getRepresentValue(piece); + + this._createItemSymbol( + itemGroup, representValue, [0, 0, itemSize[0], itemSize[1]] + ); + + if (showLabel) { + var visualState = this.visualMapModel.getValueState(representValue); + + itemGroup.add(new Text({ + style: { + x: itemAlign === 'right' ? -textGap : itemSize[0] + textGap, + y: itemSize[1] / 2, + text: piece.text, + textVerticalAlign: 'middle', + textAlign: itemAlign, + textFont: textFont, + textFill: textFill, + opacity: visualState === 'outOfRange' ? 0.5 : 1 + } + })); + } + + thisGroup.add(itemGroup); + } + }, + + /** + * @private + */ + _enableHoverLink: function (itemGroup, pieceIndex) { + itemGroup + .on('mouseover', bind(onHoverLink, this, 'highlight')) + .on('mouseout', bind(onHoverLink, this, 'downplay')); + + function onHoverLink(method) { + var visualMapModel = this.visualMapModel; + + visualMapModel.option.hoverLink && this.api.dispatchAction({ + type: method, + batch: convertDataIndex( + visualMapModel.findTargetDataIndices(pieceIndex) + ) + }); + } + }, + + /** + * @private + */ + _getItemAlign: function () { + var visualMapModel = this.visualMapModel; + var modelOption = visualMapModel.option; + + if (modelOption.orient === 'vertical') { + return 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, showLabel, itemAlign) { + if (!text) { + return; + } + + var itemGroup = new Group(); + var textStyleModel = this.visualMapModel.textStyleModel; + + itemGroup.add(new Text({ + style: { + x: showLabel ? (itemAlign === 'right' ? itemSize[0] : 0) : itemSize[0] / 2, + y: itemSize[1] / 2, + textVerticalAlign: 'middle', + textAlign: showLabel ? itemAlign : 'center', + text: text, + textFont: textStyleModel.getFont(), + textFill: 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 viewPieceList = map(visualMapModel.getPieceList(), function (piece, index) { + return {piece: piece, indexInModelPieceList: index}; + }); + var endsText = visualMapModel.get('text'); + + // Consider orient and inverse. + var orient = visualMapModel.get('orient'); + var inverse = visualMapModel.get('inverse'); + + // Order of model pieceList is always [low, ..., high] + if (orient === 'horizontal' ? inverse : !inverse) { + viewPieceList.reverse(); + } + // Origin order of endsText is [high, low] + else if (endsText) { + endsText = endsText.slice().reverse(); + } + + return {viewPieceList: viewPieceList, endsText: endsText}; + }, + + /** + * @private + */ + _createItemSymbol: function (group, representValue, shapeParam) { + group.add(createSymbol( + this.getControllerVisual(representValue, 'symbol'), + shapeParam[0], shapeParam[1], shapeParam[2], shapeParam[3], + this.getControllerVisual(representValue, 'color') + )); + }, + + /** + * @private + */ + _onItemClick: function (piece) { + var visualMapModel = this.visualMapModel; + var option = visualMapModel.option; + var selected = clone(option.selected); + var newKey = visualMapModel.getSelectedMapKey(piece); + + if (option.selectedMode === 'single') { + selected[newKey] = true; + each$1(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 + }); + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * DataZoom component entry + */ + +registerPreprocessor(preprocessor$2); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * visualMap component entry + */ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 addCommas$1 = addCommas; +var encodeHTML$1 = encodeHTML; + +function fillLabel(opt) { + defaultEmphasis(opt, 'label', ['show']); +} +var MarkerModel = extendComponentModel({ + + type: 'marker', + + dependencies: ['series', 'grid', 'polar', 'geo'], + + /** + * @overrite + */ + init: function (option, parentModel, ecModel, extraOpt) { + + if (__DEV__) { + if (this.type === 'marker') { + throw new Error('Marker component is abstract component. Use markLine, markPoint, markArea instead.'); + } + } + this.mergeDefaultAndTheme(option, ecModel); + this.mergeOption(option, ecModel, extraOpt.createdBySelf, true); + }, + + /** + * @return {boolean} + */ + isAnimationEnabled: function () { + if (env$1.node) { + return false; + } + + var hostSeries = this.__hostSeries; + return this.getShallow('animation') && hostSeries && hostSeries.isAnimationEnabled(); + }, + + mergeOption: function (newOpt, ecModel, createdBySelf, isInit) { + var MarkerModel = this.constructor; + var modelPropName = this.mainType + 'Model'; + if (!createdBySelf) { + ecModel.eachSeries(function (seriesModel) { + + var markerOpt = seriesModel.get(this.mainType, true); + + var markerModel = seriesModel[modelPropName]; + if (!markerOpt || !markerOpt.data) { + seriesModel[modelPropName] = null; + return; + } + if (!markerModel) { + if (isInit) { + // Default label emphasis `position` and `show` + fillLabel(markerOpt); + } + each$1(markerOpt.data, function (item) { + // FIXME Overwrite fillLabel method ? + if (item instanceof Array) { + fillLabel(item[0]); + fillLabel(item[1]); + } + else { + fillLabel(item); + } + }); + + markerModel = new MarkerModel( + markerOpt, this, ecModel + ); + + extend(markerModel, { + mainType: this.mainType, + // Use the same series index and name + seriesIndex: seriesModel.seriesIndex, + name: seriesModel.name, + createdBySelf: true + }); + + markerModel.__hostSeries = seriesModel; + } + else { + markerModel.mergeOption(markerOpt, ecModel, true); + } + seriesModel[modelPropName] = markerModel; + }, this); + } + }, + + formatTooltip: function (dataIndex) { + var data = this.getData(); + var value = this.getRawValue(dataIndex); + var formattedValue = isArray(value) + ? map(value, addCommas$1).join(', ') : addCommas$1(value); + var name = data.getName(dataIndex); + var html = encodeHTML$1(this.name); + if (value != null || name) { + html += '
'; + } + if (name) { + html += encodeHTML$1(name); + if (value != null) { + html += ' : '; + } + } + if (value != null) { + html += encodeHTML$1(formattedValue); + } + return html; + }, + + getData: function () { + return this._data; + }, + + setData: function (data) { + this._data = data; + } +}); + +mixin(MarkerModel, dataFormatMixin); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +MarkerModel.extend({ + + type: 'markPoint', + + defaultOption: { + zlevel: 0, + z: 5, + symbol: 'pin', + symbolSize: 50, + //symbolRotate: 0, + //symbolOffset: [0, 0] + tooltip: { + trigger: 'item' + }, + label: { + show: true, + position: 'inside' + }, + itemStyle: { + borderWidth: 2 + }, + emphasis: { + label: { + show: true + } + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 indexOf$2 = indexOf; + +function hasXOrY(item) { + return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y))); +} + +function hasXAndY(item) { + return !isNaN(parseFloat(item.x)) && !isNaN(parseFloat(item.y)); +} + +// Make it simple, do not visit all stacked value to count precision. +// function getPrecision(data, valueAxisDim, dataIndex) { +// var precision = -1; +// var stackedDim = data.mapDimension(valueAxisDim); +// do { +// precision = Math.max( +// numberUtil.getPrecision(data.get(stackedDim, dataIndex)), +// precision +// ); +// var stackedOnSeries = data.getCalculationInfo('stackedOnSeries'); +// if (stackedOnSeries) { +// var byValue = data.get(data.getCalculationInfo('stackedByDimension'), dataIndex); +// data = stackedOnSeries.getData(); +// dataIndex = data.indexOf(data.getCalculationInfo('stackedByDimension'), byValue); +// stackedDim = data.getCalculationInfo('stackedDimension'); +// } +// else { +// data = null; +// } +// } while (data); + +// return precision; +// } + +function markerTypeCalculatorWithExtent( + mlType, data, otherDataDim, targetDataDim, otherCoordIndex, targetCoordIndex +) { + var coordArr = []; + + var stacked = isDimensionStacked(data, targetDataDim /*, otherDataDim*/); + var calcDataDim = stacked + ? data.getCalculationInfo('stackResultDimension') + : targetDataDim; + + var value = numCalculate(data, calcDataDim, mlType); + + var dataIndex = data.indicesOfNearest(calcDataDim, value)[0]; + coordArr[otherCoordIndex] = data.get(otherDataDim, dataIndex); + coordArr[targetCoordIndex] = data.get(targetDataDim, dataIndex); + + // Make it simple, do not visit all stacked value to count precision. + var precision = getPrecision(data.get(targetDataDim, dataIndex)); + precision = Math.min(precision, 20); + if (precision >= 0) { + coordArr[targetCoordIndex] = +coordArr[targetCoordIndex].toFixed(precision); + } + + return coordArr; +} + +var curry$6 = curry; +// TODO Specified percent +var markerTypeCalculator = { + /** + * @method + * @param {module:echarts/data/List} data + * @param {string} baseAxisDim + * @param {string} valueAxisDim + */ + min: curry$6(markerTypeCalculatorWithExtent, 'min'), + /** + * @method + * @param {module:echarts/data/List} data + * @param {string} baseAxisDim + * @param {string} valueAxisDim + */ + max: curry$6(markerTypeCalculatorWithExtent, 'max'), + + /** + * @method + * @param {module:echarts/data/List} data + * @param {string} baseAxisDim + * @param {string} valueAxisDim + */ + average: curry$6(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} + */ +function dataTransform(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 + + // parseFloat first because item.x and item.y can be percent string like '20%' + if (item && !hasXAndY(item) && !isArray(item.coord) && coordSys) { + var dims = coordSys.dimensions; + var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); + + // Clone the option + // Transform the properties xAxis, yAxis, radiusAxis, angleAxis, geoCoord to value + item = clone(item); + + if (item.type + && markerTypeCalculator[item.type] + && axisInfo.baseAxis && axisInfo.valueAxis + ) { + var otherCoordIndex = indexOf$2(dims, axisInfo.baseAxis.dim); + var targetCoordIndex = indexOf$2(dims, axisInfo.valueAxis.dim); + + item.coord = markerTypeCalculator[item.type]( + data, axisInfo.baseDataDim, axisInfo.valueDataDim, + otherCoordIndex, targetCoordIndex + ); + // Force to use the value of calculated value. + item.value = item.coord[targetCoordIndex]; + } + else { + // FIXME Only has one of xAxis and yAxis. + var coord = [ + item.xAxis != null ? item.xAxis : item.radiusAxis, + item.yAxis != null ? item.yAxis : item.angleAxis + ]; + // Each coord support max, min, average + for (var i = 0; i < 2; i++) { + if (markerTypeCalculator[coord[i]]) { + coord[i] = numCalculate(data, data.mapDimension(dims[i]), coord[i]); + } + } + item.coord = coord; + } + } + return item; +} + +function getAxisInfo$1(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(dataDimToCoordDim(seriesModel, ret.valueDataDim)); + ret.baseAxis = coordSys.getOtherAxis(ret.valueAxis); + ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); + } + else { + ret.baseAxis = seriesModel.getBaseAxis(); + ret.valueAxis = coordSys.getOtherAxis(ret.baseAxis); + ret.baseDataDim = data.mapDimension(ret.baseAxis.dim); + ret.valueDataDim = data.mapDimension(ret.valueAxis.dim); + } + + return ret; +} + +function dataDimToCoordDim(seriesModel, dataDim) { + var data = seriesModel.getData(); + var dimensions = data.dimensions; + dataDim = data.getDimension(dataDim); + for (var i = 0; i < dimensions.length; i++) { + var dimItem = data.getDimensionInfo(dimensions[i]); + if (dimItem.name === dataDim) { + return dimItem.coordDim; + } + } +} + +/** + * Filter data which is out of coordinateSystem range + * [dataFilter description] + * @param {module:echarts/coord/*} [coordSys] + * @param {Object} item + * @return {boolean} + */ +function dataFilter$1(coordSys, item) { + // Alwalys return true if there is no coordSys + return (coordSys && coordSys.containData && item.coord && !hasXOrY(item)) + ? coordSys.containData(item.coord) : true; +} + +function dimValueGetter(item, dimName, dataIndex, dimIndex) { + // x, y, radius, angle + if (dimIndex < 2) { + return item.coord && item.coord[dimIndex]; + } + return item.value; +} + +function numCalculate(data, valueDataDim, type) { + if (type === 'average') { + var sum = 0; + var count = 0; + data.each(valueDataDim, function (val, idx) { + if (!isNaN(val)) { + sum += val; + count++; + } + }); + return sum / count; + } + else if (type === 'median') { + return data.getMedian(valueDataDim); + } + else { + // max & min + return data.getDataExtent(valueDataDim, true)[type === 'max' ? 1 : 0]; + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 MarkerView = extendComponentView({ + + type: 'marker', + + init: function () { + /** + * Markline grouped by series + * @private + * @type {module:zrender/core/util.HashMap} + */ + this.markerGroupMap = createHashMap(); + }, + + render: function (markerModel, ecModel, api) { + var markerGroupMap = this.markerGroupMap; + markerGroupMap.each(function (item) { + item.__keep = false; + }); + + var markerModelKey = this.type + 'Model'; + ecModel.eachSeries(function (seriesModel) { + var markerModel = seriesModel[markerModelKey]; + markerModel && this.renderSeries(seriesModel, markerModel, ecModel, api); + }, this); + + markerGroupMap.each(function (item) { + !item.__keep && this.group.remove(item.group); + }, this); + }, + + renderSeries: function () {} +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 updateMarkerLayout(mpData, seriesModel, api) { + var coordSys = seriesModel.coordinateSystem; + mpData.each(function (idx) { + var itemModel = mpData.getItemModel(idx); + var point; + var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); + var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } + // 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]); + + } + + // Use x, y if has any + if (!isNaN(xPx)) { + point[0] = xPx; + } + if (!isNaN(yPx)) { + point[1] = yPx; + } + + mpData.setItemLayout(idx, point); + }); +} + +MarkerView.extend({ + + type: 'markPoint', + + // updateLayout: function (markPointModel, ecModel, api) { + // ecModel.eachSeries(function (seriesModel) { + // var mpModel = seriesModel.markPointModel; + // if (mpModel) { + // updateMarkerLayout(mpModel.getData(), seriesModel, api); + // this.markerGroupMap.get(seriesModel.id).updateLayout(mpModel); + // } + // }, this); + // }, + + updateTransform: function (markPointModel, ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + var mpModel = seriesModel.markPointModel; + if (mpModel) { + updateMarkerLayout(mpModel.getData(), seriesModel, api); + this.markerGroupMap.get(seriesModel.id).updateLayout(mpModel); + } + }, this); + }, + + renderSeries: function (seriesModel, mpModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + var seriesId = seriesModel.id; + var seriesData = seriesModel.getData(); + + var symbolDrawMap = this.markerGroupMap; + var symbolDraw = symbolDrawMap.get(seriesId) + || symbolDrawMap.set(seriesId, new SymbolDraw()); + + var mpData = createList$1(coordSys, seriesModel, mpModel); + + // FIXME + 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.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; + + symbolDraw.group.silent = mpModel.get('silent') || seriesModel.get('silent'); + } +}); + +/** + * @inner + * @param {module:echarts/coord/*} [coordSys] + * @param {module:echarts/model/Series} seriesModel + * @param {module:echarts/model/Model} mpModel + */ +function createList$1(coordSys, seriesModel, mpModel) { + var coordDimsInfos; + if (coordSys) { + coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { + var info = seriesModel.getData().getDimensionInfo( + seriesModel.getData().mapDimension(coordDim) + ) || {}; + // In map series data don't have lng and lat dimension. Fallback to same with coordSys + return defaults({name: coordDim}, info); + }); + } + else { + coordDimsInfos =[{ + name: 'value', + type: 'float' + }]; + } + + var mpData = new List(coordDimsInfos, mpModel); + var dataOpt = map(mpModel.get('data'), curry( + dataTransform, seriesModel + )); + if (coordSys) { + dataOpt = filter( + dataOpt, curry(dataFilter$1, coordSys) + ); + } + + mpData.initData(dataOpt, null, + coordSys ? dimValueGetter : function (item) { + return item.value; + } + ); + + return mpData; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// HINT Markpoint can't be used too much +registerPreprocessor(function (opt) { + // Make sure markPoint component is enabled + opt.markPoint = opt.markPoint || {}; +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +MarkerModel.extend({ + + type: 'markLine', + + defaultOption: { + zlevel: 0, + z: 5, + + symbol: ['circle', 'arrow'], + symbolSize: [8, 16], + + //symbolRotate: 0, + + precision: 2, + tooltip: { + trigger: 'item' + }, + label: { + show: true, + position: 'end' + }, + lineStyle: { + type: 'dashed' + }, + emphasis: { + label: { + show: true + }, + lineStyle: { + width: 3 + } + }, + animationEasing: 'linear' + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 markLineTransform = function (seriesModel, coordSys, mlModel, item) { + var data = seriesModel.getData(); + // Special type markLine like 'min', 'max', 'average', 'median' + var mlType = item.type; + + if (!isArray(item) + && ( + mlType === 'min' || mlType === 'max' || mlType === 'average' || mlType === 'median' + // In case + // data: [{ + // yAxis: 10 + // }] + || (item.xAxis != null || item.yAxis != null) + ) + ) { + var valueAxis; + var valueDataDim; + var value; + + if (item.yAxis != null || item.xAxis != null) { + valueDataDim = item.yAxis != null ? 'y' : 'x'; + valueAxis = coordSys.getAxis(valueDataDim); + + value = retrieve(item.yAxis, item.xAxis); + } + else { + var axisInfo = getAxisInfo$1(item, data, coordSys, seriesModel); + valueDataDim = axisInfo.valueDataDim; + valueAxis = axisInfo.valueAxis; + value = numCalculate(data, valueDataDim, mlType); + } + var valueIndex = valueDataDim === 'x' ? 0 : 1; + var baseIndex = 1 - valueIndex; + + var mlFrom = clone(item); + var mlTo = {}; + + mlFrom.type = null; + + mlFrom.coord = []; + mlTo.coord = []; + mlFrom.coord[baseIndex] = -Infinity; + mlTo.coord[baseIndex] = Infinity; + + var precision = mlModel.get('precision'); + if (precision >= 0 && typeof value === 'number') { + value = +value.toFixed(Math.min(precision, 20)); + } + + mlFrom.coord[valueIndex] = mlTo.coord[valueIndex] = 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 = [ + dataTransform(seriesModel, item[0]), + dataTransform(seriesModel, item[1]), + 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 + merge(item[2], item[0]); + merge(item[2], item[1]); + + return item; +}; + +function isInifinity(val) { + return !isNaN(val) && !isFinite(val); +} + +// If a markLine has one dim +function ifMarkLineHasOnlyDim(dimIndex, fromCoord, toCoord, coordSys) { + var otherDimIndex = 1 - dimIndex; + var dimName = coordSys.dimensions[dimIndex]; + return isInifinity(fromCoord[otherDimIndex]) && isInifinity(toCoord[otherDimIndex]) + && fromCoord[dimIndex] === toCoord[dimIndex] && coordSys.getAxis(dimName).containData(fromCoord[dimIndex]); +} + +function markLineFilter(coordSys, item) { + if (coordSys.type === 'cartesian2d') { + var fromCoord = item[0].coord; + var toCoord = item[1].coord; + // In case + // { + // markLine: { + // data: [{ yAxis: 2 }] + // } + // } + if ( + fromCoord && toCoord && + (ifMarkLineHasOnlyDim(1, fromCoord, toCoord, coordSys) + || ifMarkLineHasOnlyDim(0, fromCoord, toCoord, coordSys)) + ) { + return true; + } + } + return dataFilter$1(coordSys, item[0]) + && dataFilter$1(coordSys, item[1]); +} + +function updateSingleMarkerEndLayout( + data, idx, isFrom, seriesModel, api +) { + var coordSys = seriesModel.coordinateSystem; + var itemModel = data.getItemModel(idx); + + var point; + var xPx = parsePercent$1(itemModel.get('x'), api.getWidth()); + var yPx = parsePercent$1(itemModel.get('y'), api.getHeight()); + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } + 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 line to the edge of grid if value on one axis is Inifnity + // In case + // markLine: { + // data: [{ + // yAxis: 2 + // // or + // type: 'average' + // }] + // } + if (coordSys.type === 'cartesian2d') { + var xAxis = coordSys.getAxis('x'); + var yAxis = coordSys.getAxis('y'); + var dims = coordSys.dimensions; + if (isInifinity(data.get(dims[0], idx))) { + point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[isFrom ? 0 : 1]); + } + else if (isInifinity(data.get(dims[1], idx))) { + point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[isFrom ? 0 : 1]); + } + } + + // Use x, y if has any + if (!isNaN(xPx)) { + point[0] = xPx; + } + if (!isNaN(yPx)) { + point[1] = yPx; + } + } + + data.setItemLayout(idx, point); +} + +MarkerView.extend({ + + type: 'markLine', + + // 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) { + // updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api); + // updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api); + // }); + // // Update layout of line + // mlData.each(function (idx) { + // mlData.setItemLayout(idx, [ + // fromData.getItemLayout(idx), + // toData.getItemLayout(idx) + // ]); + // }); + + // this.markerGroupMap.get(seriesModel.id).updateLayout(); + + // } + // }, this); + // }, + + updateTransform: 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) { + updateSingleMarkerEndLayout(fromData, idx, true, seriesModel, api); + updateSingleMarkerEndLayout(toData, idx, false, seriesModel, api); + }); + // Update layout of line + mlData.each(function (idx) { + mlData.setItemLayout(idx, [ + fromData.getItemLayout(idx), + toData.getItemLayout(idx) + ]); + }); + + this.markerGroupMap.get(seriesModel.id).updateLayout(); + + } + }, this); + }, + + renderSeries: function (seriesModel, mlModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + var seriesId = seriesModel.id; + var seriesData = seriesModel.getData(); + + var lineDrawMap = this.markerGroupMap; + var lineDraw = lineDrawMap.get(seriesId) + || lineDrawMap.set(seriesId, new LineDraw()); + this.group.add(lineDraw.group); + + var mlData = createList$2(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 + mlModel.setData(lineData); + + var symbolType = mlModel.get('symbol'); + var symbolSize = mlModel.get('symbolSize'); + if (!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) { + updateDataVisualAndLayout(fromData, idx, true); + updateDataVisualAndLayout(toData, idx, false); + }); + + // Update visual and layout of line + lineData.each(function (idx) { + var lineColor = lineData.getItemModel(idx).get('lineStyle.color'); + lineData.setItemVisual(idx, { + color: lineColor || fromData.getItemVisual(idx, 'color') + }); + lineData.setItemLayout(idx, [ + fromData.getItemLayout(idx), + toData.getItemLayout(idx) + ]); + + lineData.setItemVisual(idx, { + 'fromSymbolSize': fromData.getItemVisual(idx, 'symbolSize'), + 'fromSymbol': fromData.getItemVisual(idx, 'symbol'), + 'toSymbolSize': toData.getItemVisual(idx, 'symbolSize'), + 'toSymbol': toData.getItemVisual(idx, 'symbol') + }); + }); + + lineDraw.updateData(lineData); + + // Set host model for tooltip + // FIXME + mlData.line.eachItemGraphicEl(function (el, idx) { + el.traverse(function (child) { + child.dataModel = mlModel; + }); + }); + + function updateDataVisualAndLayout(data, idx, isFrom) { + var itemModel = data.getItemModel(idx); + + updateSingleMarkerEndLayout( + data, idx, isFrom, 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.color') || seriesData.getVisual('color') + }); + } + + lineDraw.__keep = true; + + lineDraw.group.silent = mlModel.get('silent') || seriesModel.get('silent'); + } +}); + +/** + * @inner + * @param {module:echarts/coord/*} coordSys + * @param {module:echarts/model/Series} seriesModel + * @param {module:echarts/model/Model} mpModel + */ +function createList$2(coordSys, seriesModel, mlModel) { + + var coordDimsInfos; + if (coordSys) { + coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { + var info = seriesModel.getData().getDimensionInfo( + seriesModel.getData().mapDimension(coordDim) + ) || {}; + // In map series data don't have lng and lat dimension. Fallback to same with coordSys + return defaults({name: coordDim}, 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 = map(mlModel.get('data'), curry( + markLineTransform, seriesModel, coordSys, mlModel + )); + if (coordSys) { + optData = filter( + optData, curry(markLineFilter, coordSys) + ); + } + var dimValueGetter$$1 = coordSys ? dimValueGetter : function (item) { + return item.value; + }; + fromData.initData( + map(optData, function (item) { return item[0]; }), + null, dimValueGetter$$1 + ); + toData.initData( + map(optData, function (item) { return item[1]; }), + null, dimValueGetter$$1 + ); + lineData.initData( + map(optData, function (item) { return item[2]; }) + ); + lineData.hasItemOption = true; + + return { + from: fromData, + to: toData, + line: lineData + }; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerPreprocessor(function (opt) { + // Make sure markLine component is enabled + opt.markLine = opt.markLine || {}; +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +MarkerModel.extend({ + + type: 'markArea', + + defaultOption: { + zlevel: 0, + // PENDING + z: 1, + tooltip: { + trigger: 'item' + }, + // markArea should fixed on the coordinate system + animation: false, + label: { + show: true, + position: 'top' + }, + itemStyle: { + // color and borderColor default to use color from series + // color: 'auto' + // borderColor: 'auto' + borderWidth: 0 + }, + + emphasis: { + label: { + show: true, + position: 'top' + } + } + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// TODO Better on polar + +var markAreaTransform = function (seriesModel, coordSys, maModel, item) { + var lt = dataTransform(seriesModel, item[0]); + var rb = dataTransform(seriesModel, item[1]); + var retrieve$$1 = retrieve; + + // FIXME make sure lt is less than rb + var ltCoord = lt.coord; + var rbCoord = rb.coord; + ltCoord[0] = retrieve$$1(ltCoord[0], -Infinity); + ltCoord[1] = retrieve$$1(ltCoord[1], -Infinity); + + rbCoord[0] = retrieve$$1(rbCoord[0], Infinity); + rbCoord[1] = retrieve$$1(rbCoord[1], Infinity); + + // Merge option into one + var result = mergeAll([{}, lt, rb]); + + result.coord = [ + lt.coord, rb.coord + ]; + result.x0 = lt.x; + result.y0 = lt.y; + result.x1 = rb.x; + result.y1 = rb.y; + return result; +}; + +function isInifinity$1(val) { + return !isNaN(val) && !isFinite(val); +} + +// If a markArea has one dim +function ifMarkLineHasOnlyDim$1(dimIndex, fromCoord, toCoord, coordSys) { + var otherDimIndex = 1 - dimIndex; + return isInifinity$1(fromCoord[otherDimIndex]) && isInifinity$1(toCoord[otherDimIndex]); +} + +function markAreaFilter(coordSys, item) { + var fromCoord = item.coord[0]; + var toCoord = item.coord[1]; + if (coordSys.type === 'cartesian2d') { + // In case + // { + // markArea: { + // data: [{ yAxis: 2 }] + // } + // } + if ( + fromCoord && toCoord && + (ifMarkLineHasOnlyDim$1(1, fromCoord, toCoord, coordSys) + || ifMarkLineHasOnlyDim$1(0, fromCoord, toCoord, coordSys)) + ) { + return true; + } + } + return dataFilter$1(coordSys, { + coord: fromCoord, + x: item.x0, + y: item.y0 + }) + || dataFilter$1(coordSys, { + coord: toCoord, + x: item.x1, + y: item.y1 + }); +} + +// dims can be ['x0', 'y0'], ['x1', 'y1'], ['x0', 'y1'], ['x1', 'y0'] +function getSingleMarkerEndPoint(data, idx, dims, seriesModel, api) { + var coordSys = seriesModel.coordinateSystem; + var itemModel = data.getItemModel(idx); + + var point; + var xPx = parsePercent$1(itemModel.get(dims[0]), api.getWidth()); + var yPx = parsePercent$1(itemModel.get(dims[1]), api.getHeight()); + if (!isNaN(xPx) && !isNaN(yPx)) { + point = [xPx, yPx]; + } + else { + // Chart like bar may have there own marker positioning logic + if (seriesModel.getMarkerPosition) { + // Use the getMarkerPoisition + point = seriesModel.getMarkerPosition( + data.getValues(dims, idx) + ); + } + else { + var x = data.get(dims[0], idx); + var y = data.get(dims[1], idx); + var pt = [x, y]; + coordSys.clampData && coordSys.clampData(pt, pt); + point = coordSys.dataToPoint(pt, true); + } + if (coordSys.type === 'cartesian2d') { + var xAxis = coordSys.getAxis('x'); + var yAxis = coordSys.getAxis('y'); + var x = data.get(dims[0], idx); + var y = data.get(dims[1], idx); + if (isInifinity$1(x)) { + point[0] = xAxis.toGlobalCoord(xAxis.getExtent()[dims[0] === 'x0' ? 0 : 1]); + } + else if (isInifinity$1(y)) { + point[1] = yAxis.toGlobalCoord(yAxis.getExtent()[dims[1] === 'y0' ? 0 : 1]); + } + } + + // Use x, y if has any + if (!isNaN(xPx)) { + point[0] = xPx; + } + if (!isNaN(yPx)) { + point[1] = yPx; + } + } + + return point; +} + +var dimPermutations = [['x0', 'y0'], ['x1', 'y0'], ['x1', 'y1'], ['x0', 'y1']]; + +MarkerView.extend({ + + type: 'markArea', + + // updateLayout: function (markAreaModel, ecModel, api) { + // ecModel.eachSeries(function (seriesModel) { + // var maModel = seriesModel.markAreaModel; + // if (maModel) { + // var areaData = maModel.getData(); + // areaData.each(function (idx) { + // var points = zrUtil.map(dimPermutations, function (dim) { + // return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); + // }); + // // Layout + // areaData.setItemLayout(idx, points); + // var el = areaData.getItemGraphicEl(idx); + // el.setShape('points', points); + // }); + // } + // }, this); + // }, + + updateTransform: function (markAreaModel, ecModel, api) { + ecModel.eachSeries(function (seriesModel) { + var maModel = seriesModel.markAreaModel; + if (maModel) { + var areaData = maModel.getData(); + areaData.each(function (idx) { + var points = map(dimPermutations, function (dim) { + return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); + }); + // Layout + areaData.setItemLayout(idx, points); + var el = areaData.getItemGraphicEl(idx); + el.setShape('points', points); + }); + } + }, this); + }, + + renderSeries: function (seriesModel, maModel, ecModel, api) { + var coordSys = seriesModel.coordinateSystem; + var seriesId = seriesModel.id; + var seriesData = seriesModel.getData(); + + var areaGroupMap = this.markerGroupMap; + var polygonGroup = areaGroupMap.get(seriesId) + || areaGroupMap.set(seriesId, {group: new Group()}); + + this.group.add(polygonGroup.group); + polygonGroup.__keep = true; + + var areaData = createList$3(coordSys, seriesModel, maModel); + + // Line data for tooltip and formatter + maModel.setData(areaData); + + // Update visual and layout of line + areaData.each(function (idx) { + // Layout + areaData.setItemLayout(idx, map(dimPermutations, function (dim) { + return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api); + })); + + // Visual + areaData.setItemVisual(idx, { + color: seriesData.getVisual('color') + }); + }); + + + areaData.diff(polygonGroup.__data) + .add(function (idx) { + var polygon = new Polygon({ + shape: { + points: areaData.getItemLayout(idx) + } + }); + areaData.setItemGraphicEl(idx, polygon); + polygonGroup.group.add(polygon); + }) + .update(function (newIdx, oldIdx) { + var polygon = polygonGroup.__data.getItemGraphicEl(oldIdx); + updateProps(polygon, { + shape: { + points: areaData.getItemLayout(newIdx) + } + }, maModel, newIdx); + polygonGroup.group.add(polygon); + areaData.setItemGraphicEl(newIdx, polygon); + }) + .remove(function (idx) { + var polygon = polygonGroup.__data.getItemGraphicEl(idx); + polygonGroup.group.remove(polygon); + }) + .execute(); + + areaData.eachItemGraphicEl(function (polygon, idx) { + var itemModel = areaData.getItemModel(idx); + var labelModel = itemModel.getModel('label'); + var labelHoverModel = itemModel.getModel('emphasis.label'); + var color = areaData.getItemVisual(idx, 'color'); + polygon.useStyle( + defaults( + itemModel.getModel('itemStyle').getItemStyle(), + { + fill: modifyAlpha(color, 0.4), + stroke: color + } + ) + ); + + polygon.hoverStyle = itemModel.getModel('emphasis.itemStyle').getItemStyle(); + + setLabelStyle( + polygon.style, polygon.hoverStyle, labelModel, labelHoverModel, + { + labelFetcher: maModel, + labelDataIndex: idx, + defaultText: areaData.getName(idx) || '', + isRectText: true, + autoColor: color + } + ); + + setHoverStyle(polygon, {}); + + polygon.dataModel = maModel; + }); + + polygonGroup.__data = areaData; + + polygonGroup.group.silent = maModel.get('silent') || seriesModel.get('silent'); + } +}); + +/** + * @inner + * @param {module:echarts/coord/*} coordSys + * @param {module:echarts/model/Series} seriesModel + * @param {module:echarts/model/Model} mpModel + */ +function createList$3(coordSys, seriesModel, maModel) { + + var coordDimsInfos; + var areaData; + var dims = ['x0', 'y0', 'x1', 'y1']; + if (coordSys) { + coordDimsInfos = map(coordSys && coordSys.dimensions, function (coordDim) { + var data = seriesModel.getData(); + var info = data.getDimensionInfo( + data.mapDimension(coordDim) + ) || {}; + // In map series data don't have lng and lat dimension. Fallback to same with coordSys + return defaults({name: coordDim}, info); + }); + areaData = new List(map(dims, function (dim, idx) { + return { + name: dim, + type: coordDimsInfos[idx % 2].type + }; + }), maModel); + } + else { + coordDimsInfos =[{ + name: 'value', + type: 'float' + }]; + areaData = new List(coordDimsInfos, maModel); + } + + var optData = map(maModel.get('data'), curry( + markAreaTransform, seriesModel, coordSys, maModel + )); + if (coordSys) { + optData = filter( + optData, curry(markAreaFilter, coordSys) + ); + } + + var dimValueGetter$$1 = coordSys ? function (item, dimName, dataIndex, dimIndex) { + return item.coord[Math.floor(dimIndex / 2)][dimIndex % 2]; + } : function (item) { + return item.value; + }; + areaData.initData(optData, null, dimValueGetter$$1); + areaData.hasItemOption = true; + return areaData; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +registerPreprocessor(function (opt) { + // Make sure markArea component is enabled + opt.markArea = opt.markArea || {}; +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 preprocessor$3 = function (option) { + var timelineOpt = option && option.timeline; + + if (!isArray(timelineOpt)) { + timelineOpt = timelineOpt ? [timelineOpt] : []; + } + + each$1(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$2(opt, 'controlPosition')) { + var controlStyle = opt.controlStyle || (opt.controlStyle = {}); + if (!has$2(controlStyle, 'position')) { + controlStyle.position = opt.controlPosition; + } + if (controlStyle.position === 'none' && !has$2(controlStyle, 'show')) { + controlStyle.show = false; + delete controlStyle.position; + } + delete opt.controlPosition; + } + + each$1(opt.data || [], function (dataItem) { + if (isObject$1(dataItem) && !isArray(dataItem)) { + if (!has$2(dataItem, 'value') && has$2(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}; + + each$1(label, function (value, name) { + if (!excludeLabelAttr[name] && !has$2(labelNormal, name)) { + labelNormal[name] = value; + } + }); + + if (itemStyleEmphasis.label && !has$2(label, 'emphasis')) { + label.emphasis = itemStyleEmphasis.label; + delete itemStyleEmphasis.label; + } +} + +function has$2(obj, attr) { + return obj.hasOwnProperty(attr); +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +ComponentModel.registerSubTypeDefaulter('timeline', function () { + // Only slider now. + return 'slider'; +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +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); + } + } + + // Set normalized currentIndex to payload. + ecModel.resetOption('timeline'); + + return defaults({ + currentIndex: timelineModel.option.currentIndex + }, payload); + } +); + +registerAction( + + {type: 'timelinePlayChange', event: 'timelinePlayChanged', update: 'update'}, + + function (payload, ecModel) { + var timelineModel = ecModel.getComponent('timeline'); + if (timelineModel && payload.playState != null) { + timelineModel.setPlayState(payload.playState); + } + } +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 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: {}, + label: { + color: '#000' + }, + + data: [] + }, + + /** + * @override + */ + init: function (option, parentModel, ecModel) { + + /** + * @private + * @type {module:echarts/data/List} + */ + this._data; + + /** + * @private + * @type {Array.} + */ + 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 = []; + each$1(dataArr, function (item, index) { + var value = getDataItemValue(item); + var newItem; + + if (isObject$1(item)) { + newItem = clone(item); + newItem.value = index; + } + else { + newItem = index; + } + + idxArr.push(newItem); + + if (!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.} categoreis + */ + getCategories: function () { + if (this.get('axisType') === 'category') { + return this._names.slice(); + } + } + +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 SliderTimelineModel = 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 + show: true, + interval: 'auto', + rotate: 0, + // formatter: null, + // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#304654' + }, + itemStyle: { + color: '#304654', + borderWidth: 1 + }, + + 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 + + color: '#304654', + borderColor: '#304654', + borderWidth: 1 + }, + + emphasis: { + label: { + show: true, + // 其余属性默认使用全局文本样式,详见TEXTSTYLE + color: '#c23531' + }, + + itemStyle: { + color: '#c23531' + }, + + controlStyle: { + color: '#c23531', + borderColor: '#c23531', + borderWidth: 2 + } + }, + data: [] + } + +}); + +mixin(SliderTimelineModel, dataFormatMixin); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 TimelineView = Component.extend({ + type: 'timeline' +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * Extend axis 2d + * @constructor module:echarts/coord/cartesian/Axis2D + * @extends {module:echarts/coord/cartesian/Axis} + * @param {string} dim + * @param {*} scale + * @param {Array.} 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'; + + /** + * Axis model + * @param {module:echarts/component/TimelineModel} + */ + this.model = null; +}; + +TimelineAxis.prototype = { + + constructor: TimelineAxis, + + /** + * @override + */ + getLabelModel: function () { + return this.model.getModel('label'); + }, + + /** + * @override + */ + isHorizontal: function () { + return this.model.get('orient') === 'horizontal'; + } + +}; + +inherits(TimelineAxis, Axis); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 bind$6 = bind; +var each$27 = each$1; + +var PI$4 = Math.PI; + +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:zrender/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); + + timelineModel.formatTooltip = function (dataIndex) { + return encodeHTML(axis.scale.getLabel(dataIndex)); + }; + + each$27( + ['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.position'); + var orient = timelineModel.get('orient'); + var viewRect = getViewRect$4(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]; + } + + 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$4 / 2 + }; + + // Position + var mainLength = orient === 'vertical' ? viewRect.height : viewRect.width; + + var controlModel = timelineModel.getModel('controlStyle'); + var showControl = controlModel.get('show', true); + 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.rotate') || 0; + labelRotation = labelRotation * PI$4 / 180; // To radian. + + var playPosition; + var prevBtnPosition; + var nextBtnPosition; + var axisExtent; + var controlPosition = controlModel.get('position', 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: timelineModel.get('label.align') || labelAlignMap[orient], + labelBaseline: timelineModel.get('label.verticalAlign') + || timelineModel.get('label.baseline') + || 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') { + // transform to horizontal, inverse rotate by left-top point. + var m = create$1(); + var rotateOriginX = viewRect.x; + var rotateOriginY = viewRect.y + viewRect.height; + translate(m, m, [-rotateOriginX, -rotateOriginY]); + rotate(m, m, -PI$4 / 2); + 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.attr('position', mainPosition); + labelGroup.attr('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 = createScaleByModel(timelineModel, axisType); + + // Customize scale. The `tickValue` is `dataIndex`. + scale.getTicks = function () { + return data.mapArray(['value'], function (value) { + return value; + }); + }; + + var dataExtent = data.getDataExtent('value'); + scale.setExtent(dataExtent[0], dataExtent[1]); + scale.niceTicks(); + + var axis = new TimelineAxis('value', scale, layoutInfo.axisExtent, axisType); + axis.model = timelineModel; + + return axis; + }, + + _createGroup: function (name) { + var newGroup = this['_' + name] = new 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 Line({ + shape: { + x1: axisExtent[0], y1: 0, + x2: axisExtent[1], y2: 0 + }, + style: extend( + {lineCap: 'round'}, + timelineModel.getModel('lineStyle').getLineStyle() + ), + silent: true, + z2: 1 + })); + }, + + /** + * @private + */ + _renderAxisTick: function (layoutInfo, group, axis, timelineModel) { + var data = timelineModel.getData(); + // Show all ticks, despite ignoring strategy. + var ticks = axis.scale.getTicks(); + + // The value is dataIndex, see the costomized scale. + each$27(ticks, function (value) { + var tickCoord = axis.dataToCoord(value); + var itemModel = data.getItemModel(value); + var itemStyleModel = itemModel.getModel('itemStyle'); + var hoverStyleModel = itemModel.getModel('emphasis.itemStyle'); + var symbolOpt = { + position: [tickCoord, 0], + onclick: bind$6(this._changeTimeline, this, value) + }; + var el = giveSymbol(itemModel, itemStyleModel, group, symbolOpt); + setHoverStyle(el, hoverStyleModel.getItemStyle()); + + if (itemModel.get('tooltip')) { + el.dataIndex = value; + el.dataModel = timelineModel; + } + else { + el.dataIndex = el.dataModel = null; + } + + }, this); + }, + + /** + * @private + */ + _renderAxisLabel: function (layoutInfo, group, axis, timelineModel) { + var labelModel = axis.getLabelModel(); + + if (!labelModel.get('show')) { + return; + } + + var data = timelineModel.getData(); + var labels = axis.getViewLabels(); + + each$27(labels, function (labelItem) { + // The tickValue is dataIndex, see the costomized scale. + var dataIndex = labelItem.tickValue; + + var itemModel = data.getItemModel(dataIndex); + var normalLabelModel = itemModel.getModel('label'); + var hoverLabelModel = itemModel.getModel('emphasis.label'); + var tickCoord = axis.dataToCoord(labelItem.tickValue); + var textEl = new Text({ + position: [tickCoord, 0], + rotation: layoutInfo.labelRotation - layoutInfo.rotation, + onclick: bind$6(this._changeTimeline, this, dataIndex), + silent: false + }); + setTextStyle(textEl.style, normalLabelModel, { + text: labelItem.formattedLabel, + textAlign: layoutInfo.labelAlign, + textVerticalAlign: layoutInfo.labelBaseline + }); + + group.add(textEl); + setHoverStyle( + textEl, setTextStyle({}, hoverLabelModel) + ); + + }, this); + }, + + /** + * @private + */ + _renderControl: function (layoutInfo, group, axis, timelineModel) { + var controlSize = layoutInfo.controlSize; + var rotation = layoutInfo.rotation; + + var itemStyle = timelineModel.getModel('controlStyle').getItemStyle(); + var hoverStyle = timelineModel.getModel('emphasis.controlStyle').getItemStyle(); + var rect = [0, -controlSize / 2, controlSize, controlSize]; + var playState = timelineModel.getPlayState(); + var inverse = timelineModel.get('inverse', true); + + makeBtn( + layoutInfo.nextBtnPosition, + 'controlStyle.nextIcon', + bind$6(this._changeTimeline, this, inverse ? '-' : '+') + ); + makeBtn( + layoutInfo.prevBtnPosition, + 'controlStyle.prevIcon', + bind$6(this._changeTimeline, this, inverse ? '+' : '-') + ); + makeBtn( + layoutInfo.playPosition, + 'controlStyle.' + (playState ? 'stopIcon' : 'playIcon'), + bind$6(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); + 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$6(me._handlePointerDrag, me); + pointer.ondragend = bind$6(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 = 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$6(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 applyTransform$1(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$4(model, api) { + return getLayoutRect( + model.getBoxLayoutParams(), + { + width: api.getWidth(), + height: api.getHeight() + }, + model.get('padding') + ); +} + +function makeIcon(timelineModel, objPath, rect, opts) { + var icon = makePath( + timelineModel.get(objPath).replace(/^path:\/\//, ''), + clone(opts || {}), + new BoundingRect(rect[0], rect[1], rect[2], rect[3]), + 'center' + ); + + return icon; +} + +/** + * Create symbol or update symbol + * opt: basic position and event handlers + */ +function giveSymbol(hostModel, itemStyleModel, group, opt, symbol, callback) { + var color = itemStyleModel.get('color'); + + if (!symbol) { + var symbolType = hostModel.get('symbol'); + symbol = createSymbol(symbolType, -1, -1, 2, 2, color); + symbol.setStyle('strokeNoScale', true); + group.add(symbol); + callback && callback.onCreate(symbol); + } + else { + symbol.setColor(color); + group.add(symbol); // Group may be new, also need to add. + callback && callback.onUpdate(symbol); + } + + // Style + var itemStyle = itemStyleModel.getItemStyle(['color', 'symbol', 'symbolSize']); + symbol.setStyle(itemStyle); + + // Transform and events. + opt = merge({ + rectHover: true, + z2: 100 + }, opt, true); + + var symbolSize = hostModel.get('symbolSize'); + symbolSize = symbolSize instanceof Array + ? symbolSize.slice() + : [+symbolSize, +symbolSize]; + symbolSize[0] /= 2; + symbolSize[1] /= 2; + opt.scale = symbolSize; + + var symbolOffset = hostModel.get('symbolOffset'); + if (symbolOffset) { + var pos = opt.position = opt.position || [0, 0]; + pos[0] += parsePercent$1(symbolOffset[0], symbolSize[0]); + pos[1] += parsePercent$1(symbolOffset[1], symbolSize[1]); + } + + var symbolRotate = hostModel.get('symbolRotate'); + opt.rotation = (symbolRotate || 0) * Math.PI / 180 || 0; + + symbol.attr(opt); + + // FIXME + // (1) When symbol.style.strokeNoScale is true and updateTransform is not performed, + // getBoundingRect will return wrong result. + // (This is supposed to be resolved in zrender, but it is a little difficult to + // leverage performance and auto updateTransform) + // (2) All of ancesters of symbol do not scale, so we can just updateTransform symbol. + symbol.updateTransform(); + + 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) + ); + } +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * DataZoom component entry + */ + +registerPreprocessor(preprocessor$3); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 ToolboxModel = extendComponentModel({ + + type: 'toolbox', + + layoutMode: { + type: 'box', + ignoreSize: true + }, + + optionUpdated: function () { + ToolboxModel.superApply(this, 'optionUpdated', arguments); + + each$1(this.option.feature, function (featureOpt, featureName) { + var Feature = get$1(featureName); + Feature && merge(featureOpt, Feature.defaultOption); + }); + }, + + defaultOption: { + + show: true, + + z: 6, + + zlevel: 0, + + orient: 'horizontal', + + left: 'right', + + top: 'top', + + // right + // bottom + + backgroundColor: 'transparent', + + borderColor: '#ccc', + + borderRadius: 0, + + borderWidth: 0, + + padding: 5, + + itemSize: 15, + + itemGap: 8, + + showTitle: true, + + iconStyle: { + borderColor: '#666', + color: 'none' + }, + emphasis: { + iconStyle: { + borderColor: '#3E98C5' + } + } + // textStyle: {}, + + // feature + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +extendComponentView({ + + type: 'toolbox', + + render: function (toolboxModel, ecModel, api, payload) { + 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 = []; + each$1(featureOpts, function (opt, name) { + featureNames.push(name); + }); + + (new DataDiffer(this._featureNames || [], featureNames)) + .add(processFeature) + .update(processFeature) + .remove(curry(processFeature, null)) + .execute(); + + // Keep for diff. + this._featureNames = featureNames; + + function processFeature(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 = get$1(featureName); + if (!Feature) { + return; + } + feature = new Feature(featureModel, ecModel, api); + } + features[featureName] = feature; + } + else { + feature = features[oldName]; + // If feature does not exsit. + if (!feature) { + return; + } + feature.model = featureModel; + feature.ecModel = ecModel; + feature.api = api; + } + + 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, payload); + } + } + + function createIconPaths(featureModel, feature, featureName) { + var iconStyleModel = featureModel.getModel('iconStyle'); + var iconStyleEmphasisModel = featureModel.getModel('emphasis.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 = {}; + each$1(icons, function (iconStr, iconName) { + var path = createIcon( + iconStr, + {}, + { + x: -itemSize / 2, + y: -itemSize / 2, + width: itemSize, + height: itemSize + } + ); + path.setStyle(iconStyleModel.getItemStyle()); + path.hoverStyle = iconStyleEmphasisModel.getItemStyle(); + + setHoverStyle(path); + + if (toolboxModel.get('showTitle')) { + path.__title = titles[iconName]; + path.on('mouseover', function () { + // Should not reuse above hoverStyle, which might be modified. + var hoverStyle = iconStyleEmphasisModel.getItemStyle(); + 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', bind( + feature.onclick, feature, ecModel, api, iconName + )); + + iconPaths[iconName] = path; + }); + } + + layout$3(group, toolboxModel, api); + // Render background after group is layout + // FIXME + group.add(makeBackground(group.getBoundingRect(), 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 = getBoundingRect( + titleText, makeFont(hoverStyle) + ); + 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'; + } + } + }); + }, + + updateView: function (toolboxModel, ecModel, api, payload) { + each$1(this._features, function (feature) { + feature.updateView && feature.updateView(feature.model, ecModel, api, payload); + }); + }, + + // updateLayout: function (toolboxModel, ecModel, api, payload) { + // zrUtil.each(this._features, function (feature) { + // feature.updateLayout && feature.updateLayout(feature.model, ecModel, api, payload); + // }); + // }, + + remove: function (ecModel, api) { + each$1(this._features, function (feature) { + feature.remove && feature.remove(ecModel, api); + }); + this.group.removeAll(); + }, + + dispose: function (ecModel, api) { + each$1(this._features, function (feature) { + feature.dispose && feature.dispose(ecModel, api); + }); + } +}); + +function isUserFeatureName(featureName) { + return featureName.indexOf('my') === 0; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 saveAsImageLang = lang.toolbox.saveAsImage; + +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: saveAsImageLang.title, + type: 'png', + // Default use option.backgroundColor + // backgroundColor: '#fff', + name: '', + excludeComponents: ['toolbox'], + pixelRatio: 1, + lang: saveAsImageLang.lang.slice() +}; + +SaveAsImage.prototype.unusable = !env$1.canvasSupported; + +var proto$4 = SaveAsImage.prototype; + +proto$4.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' && !env$1.browser.ie && !env$1.browser.edge) { + var evt = new MouseEvent('click', { + view: window, + bubbles: true, + cancelable: false + }); + $a.dispatchEvent(evt); + } + // IE + else { + if (window.navigator.msSaveOrOpenBlob) { + var bstr = atob(url.split(',')[1]); + var n = bstr.length; + var u8arr = new Uint8Array(n); + while(n--) { + u8arr[n] = bstr.charCodeAt(n); + } + var blob = new Blob([u8arr]); + window.navigator.msSaveOrOpenBlob(blob, title + '.' + type); + } + else { + var lang$$1 = model.get('lang'); + var html = '' + + '' + + '' + + ''; + var tab = window.open(); + tab.document.write(html); + } + } +}; + +register$1( + 'saveAsImage', SaveAsImage +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 magicTypeLang = lang.toolbox.magicType; + +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' + }, + // `line`, `bar`, `stack`, `tiled` + title: clone(magicTypeLang.title), + option: {}, + seriesIndex: {} +}; + +var proto$5 = MagicType.prototype; + +proto$5.getIcons = function () { + var model = this.model; + var availableIcons = model.get('icon'); + var icons = {}; + each$1(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 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 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 merge({ + id: seriesId, + stack: '__ec_magicType_stack__' + }, model.get('option.stack') || {}, true); + } + }, + 'tiled': function (seriesType, seriesId, seriesModel, model) { + if (seriesType === 'line' || seriesType === 'bar') { + return merge({ + id: seriesId, + stack: '' + }, model.get('option.tiled') || {}, true); + } + } +}; + +var radioTypes = [ + ['line', 'bar'], + ['stack', 'tiled'] +]; + +proto$5.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? + defaults(newSeriesOpt, seriesModel.option); + newOption.series.push(newSeriesOpt); + } + // Modify boundaryGap + var coordSys = seriesModel.coordinateSystem; + if (coordSys && coordSys.type === 'cartesian2d' && (type === 'line' || type === 'bar')) { + var categoryAxis = coordSys.getAxesByScale('ordinal')[0]; + if (categoryAxis) { + var axisDim = categoryAxis.dim; + var axisType = axisDim + 'Axis'; + var axisModel = ecModel.queryComponents({ + mainType: axisType, + index: seriesModel.get(name + 'Index'), + id: seriesModel.get(name + 'Id') + })[0]; + var axisIndex = axisModel.componentIndex; + + newOption[axisType] = newOption[axisType] || []; + for (var i = 0; i <= axisIndex; i++) { + newOption[axisType][axisIndex] = newOption[axisType][axisIndex] || {}; + } + newOption[axisType][axisIndex].boundaryGap = type === 'bar' ? true : false; + } + } + }; + + each$1(radioTypes, function (radio) { + if (indexOf(radio, type) >= 0) { + each$1(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 + }); +}; + +registerAction({ + type: 'changeMagicType', + event: 'magicTypeChanged', + update: 'prepareAndUpdate' +}, function (payload, ecModel) { + ecModel.mergeOption(payload.newOption); +}); + +register$1('magicType', MagicType); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 dataViewLang = lang.toolbox.dataView; + +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.} series + * @return {string} + * @inner + */ +function assembleSeriesWithCategoryAxis(series) { + var tables = []; + each$1(series, function (group, key) { + var categoryAxis = group.categoryAxis; + var valueAxis = group.valueAxis; + var valueAxisDim = valueAxis.dim; + + var headers = [' '].concat(map(group.series, function (series) { + return series.name; + })); + var columns = [categoryAxis.model.getCategories()]; + each$1(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.} series + * @return {string} + * @inner + */ +function assembleOtherSeries(series) { + return 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 {Object} + * @inner + */ +function getContentFromModel(ecModel) { + + var result = groupSeries(ecModel); + + return { + value: 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$1(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 {Object} + */ +function parseTSVContents(tsv) { + var tsvLines = tsv.split(/\n+/g); + var headers = trim$1(tsvLines.shift()).split(itemSplitRegex); + + var categories = []; + var series = map(headers, function (header) { + return { + name: header, + data: [] + }; + }); + for (var i = 0; i < tsvLines.length; i++) { + var items = trim$1(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.} + * @inner + */ +function parseListContents(str) { + var lines = str.split(/\n+/g); + var seriesName = trim$1(lines.shift()); + + var data = []; + for (var i = 0; i < lines.length; i++) { + var items = trim$1(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.} blockMetaList + * @return {Object} + * @inner + */ +function parseContents(str, blockMetaList) { + var blocks = str.split(new RegExp('\n*' + BLOCK_SPLITER + '\n*', 'g')); + var newOption = { + series: [] + }; + each$1(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: clone(dataViewLang.title), + lang: clone(dataViewLang.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$$1 = model.get('lang') || []; + header.innerHTML = lang$$1[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:auto;'; + + 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 (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; + } + addEventListener(closeButton, 'click', close); + + 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[1]; + refreshButton.innerHTML = lang$$1[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 + 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 + 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 map(newData, function (newVal, idx) { + var original = originalData && originalData[idx]; + if (isObject$1(original) && !isArray(original)) { + if (isObject$1(newVal) && !isArray(newVal)) { + newVal = newVal.value; + } + // Original data has option + return defaults({ + value: newVal + }, original); + } + else { + return newVal; + } + }); +} + +register$1('dataView', DataView); + +registerAction({ + type: 'changeDataView', + event: 'dataViewChanged', + update: 'prepareAndUpdate' +}, function (payload, ecModel) { + var newSeriesOptList = []; + each$1(payload.newOption.series, function (seriesOpt) { + var seriesModel = ecModel.getSeriesByName(seriesOpt.name)[0]; + if (!seriesModel) { + // New created series + // Geuss the series type + newSeriesOptList.push(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(defaults({ + series: newSeriesOptList + }, payload.newOption)); +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 each$29 = each$1; + +var ATTR$2 = '\0_ec_hist_store'; + +/** + * @param {module:echarts/model/Global} ecModel + * @param {Object} newSnapshot {dataZoomId, batch: [payloadInfo, ...]} + */ +function push(ecModel, newSnapshot) { + var store = giveStore$1(ecModel); + + // If previous dataZoom can not be found, + // complete an range with current range. + each$29(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); +} + +/** + * @param {module:echarts/model/Global} ecModel + * @return {Object} snapshot + */ +function pop(ecModel) { + var store = giveStore$1(ecModel); + var head = store[store.length - 1]; + store.length > 1 && store.pop(); + + // Find top for all dataZoom. + var snapshot = {}; + each$29(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; +} + +/** + * @param {module:echarts/model/Global} ecModel + */ +function clear$1(ecModel) { + ecModel[ATTR$2] = null; +} + +/** + * @param {module:echarts/model/Global} ecModel + * @return {number} records. always >= 1. + */ +function count(ecModel) { + return giveStore$1(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.} + */ +function giveStore$1(ecModel) { + var store = ecModel[ATTR$2]; + if (!store) { + store = ecModel[ATTR$2] = [{}]; + } + return store; +} + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +DataZoomModel.extend({ + type: 'dataZoom.select' +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +DataZoomView.extend({ + type: 'dataZoom.select' +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +/** + * DataZoom component entry + */ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Use dataZoomSelect +var dataZoomLang = lang.toolbox.dataZoom; +var each$28 = each$1; + +// 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, ecModel, api) { + + /** + * @private + * @type {module:echarts/component/helper/BrushController} + */ + (this._brushController = new BrushController(api.getZr())) + .on('brush', bind(this._onBrush, this)) + .mount(); + + /** + * @private + * @type {boolean} + */ + 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' + }, + // `zoom`, `back` + title: clone(dataZoomLang.title) +}; + +var proto$6 = DataZoom.prototype; + +proto$6.render = function (featureModel, ecModel, api, payload) { + this.model = featureModel; + this.ecModel = ecModel; + this.api = api; + + updateZoomBtnStatus(featureModel, ecModel, this, payload, api); + updateBackBtnStatus(featureModel, ecModel); +}; + +proto$6.onclick = function (ecModel, api, type) { + handlers$1[type].call(this); +}; + +proto$6.remove = function (ecModel, api) { + this._brushController.unmount(); +}; + +proto$6.dispose = function (ecModel, api) { + this._brushController.dispose(); +}; + +/** + * @private + */ +var handlers$1 = { + + zoom: function () { + var nextActive = !this._isZoomActive; + + this.api.dispatchAction({ + type: 'takeGlobalCursor', + key: 'dataZoomSelect', + dataZoomSelectActive: nextActive + }); + }, + + back: function () { + this._dispatchZoomAction(pop(this.ecModel)); + } +}; + +/** + * @private + */ +proto$6._onBrush = function (areas, opt) { + if (!opt.isEnd || !areas.length) { + return; + } + var snapshot = {}; + var ecModel = this.ecModel; + + this._brushController.updateCovers([]); // remove cover + + var brushTargetManager = new BrushTargetManager( + retrieveAxisSetting(this.model.option), ecModel, {include: ['grid']} + ); + brushTargetManager.matchOutputRanges(areas, ecModel, function (area, coordRange, coordSys) { + if (coordSys.type !== 'cartesian2d') { + return; + } + + var brushType = area.brushType; + if (brushType === 'rect') { + setBatch('x', coordSys, coordRange[0]); + setBatch('y', coordSys, coordRange[1]); + } + else { + setBatch(({lineX: 'x', lineY: 'y'})[brushType], coordSys, coordRange); + } + }); + + push(ecModel, snapshot); + + this._dispatchZoomAction(snapshot); + + function setBatch(dimName, coordSys, minMax) { + var axis = coordSys.getAxis(dimName); + var axisModel = axis.model; + var dataZoomModel = findDataZoom(dimName, axisModel, ecModel); + + // Restrict range. + var minMaxSpan = dataZoomModel.findRepresentativeAxisProxy(axisModel).getMinMaxSpan(); + if (minMaxSpan.minValueSpan != null || minMaxSpan.maxValueSpan != null) { + minMax = sliderMove( + 0, minMax.slice(), axis.scale.getExtent(), 0, + minMaxSpan.minValueSpan, minMaxSpan.maxValueSpan + ); + } + + dataZoomModel && (snapshot[dataZoomModel.id] = { + dataZoomId: dataZoomModel.id, + startValue: minMax[0], + endValue: minMax[1] + }); + } + + function findDataZoom(dimName, axisModel, ecModel) { + var found; + ecModel.eachComponent({mainType: 'dataZoom', subType: 'select'}, function (dzModel) { + var has = dzModel.getAxisModel(dimName, axisModel.componentIndex); + has && (found = dzModel); + }); + return found; + } +}; + +/** + * @private + */ +proto$6._dispatchZoomAction = function (snapshot) { + var batch = []; + + // Convert from hash map to array. + each$28(snapshot, function (batchItem, dataZoomId) { + batch.push(clone(batchItem)); + }); + + batch.length && this.api.dispatchAction({ + type: 'dataZoom', + from: this.uid, + batch: batch + }); +}; + +function retrieveAxisSetting(option) { + var setting = {}; + // Compatible with previous setting: null => all axis, false => no axis. + each$1(['xAxisIndex', 'yAxisIndex'], function (name) { + setting[name] = option[name]; + setting[name] == null && (setting[name] = 'all'); + (setting[name] === false || setting[name] === 'none') && (setting[name] = []); + }); + return setting; +} + +function updateBackBtnStatus(featureModel, ecModel) { + featureModel.setIconStatus( + 'back', + count(ecModel) > 1 ? 'emphasis' : 'normal' + ); +} + +function updateZoomBtnStatus(featureModel, ecModel, view, payload, api) { + var zoomActive = view._isZoomActive; + + if (payload && payload.type === 'takeGlobalCursor') { + zoomActive = payload.key === 'dataZoomSelect' + ? payload.dataZoomSelectActive : false; + } + + view._isZoomActive = zoomActive; + + featureModel.setIconStatus('zoom', zoomActive ? 'emphasis' : 'normal'); + + var brushTargetManager = new BrushTargetManager( + retrieveAxisSetting(featureModel.option), ecModel, {include: ['grid']} + ); + + view._brushController + .setPanels(brushTargetManager.makePanelOpts(api, function (targetInfo) { + return (targetInfo.xAxisDeclared && !targetInfo.yAxisDeclared) + ? 'lineX' + : (!targetInfo.xAxisDeclared && targetInfo.yAxisDeclared) + ? 'lineY' + : 'rect'; + })) + .enableBrush( + zoomActive + ? { + brushType: 'auto', + brushStyle: { + // FIXME user customized? + lineWidth: 0, + fill: 'rgba(0,0,0,0.2)' + } + } + : false + ); +} + + +register$1('dataZoom', DataZoom); + + +// Create special dataZoom option for select +// FIXME consider the case of merge option, where axes options are not exists. +registerPreprocessor(function (option) { + if (!option) { + return; + } + + var dataZoomOpts = option.dataZoom || (option.dataZoom = []); + if (!isArray(dataZoomOpts)) { + option.dataZoom = dataZoomOpts = [dataZoomOpts]; + } + + var toolboxOpt = option.toolbox; + if (toolboxOpt) { + // Assume there is only one toolbox + if (isArray(toolboxOpt)) { + toolboxOpt = toolboxOpt[0]; + } + + if (toolboxOpt && toolboxOpt.feature) { + var dataZoomOpt = toolboxOpt.feature.dataZoom; + // FIXME: If add dataZoom when setOption in merge mode, + // no axis info to be added. See `test/dataZoom-extreme.html` + addForAxis('xAxis', dataZoomOpt); + addForAxis('yAxis', dataZoomOpt); + } + } + + function addForAxis(axisName, dataZoomOpt) { + if (!dataZoomOpt) { + return; + } + + // Try not to modify model, because it is not merged yet. + var axisIndicesName = axisName + 'Index'; + var givenAxisIndices = dataZoomOpt[axisIndicesName]; + if (givenAxisIndices != null + && givenAxisIndices != 'all' + && !isArray(givenAxisIndices) + ) { + givenAxisIndices = (givenAxisIndices === false || givenAxisIndices === 'none') ? [] : [givenAxisIndices]; + } + + forEachComponent(axisName, function (axisOpt, axisIndex) { + if (givenAxisIndices != null + && givenAxisIndices != 'all' + && 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 (!isArray(opts)) { + opts = opts ? [opts] : []; + } + each$28(opts, cb); + } +}); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 restoreLang = lang.toolbox.restore; + +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: restoreLang.title +}; + +var proto$7 = Restore.prototype; + +proto$7.onclick = function (ecModel, api, type) { + clear$1(ecModel); + + api.dispatchAction({ + type: 'restore', + from: this.uid + }); +}; + +register$1('restore', Restore); + +registerAction( + {type: 'restore', event: 'restore', update: 'prepareAndUpdate'}, + function (payload, ecModel) { + ecModel.resetOption('recreate'); + } +); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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 urn = 'urn:schemas-microsoft-com:vml'; +var win = typeof window === 'undefined' ? null : window; + +var vmlInited = false; + +var doc = win && win.document; + +function createNode(tagName) { + return doCreateNode(tagName); +} + +// Avoid assign to an exported variable, for transforming to cjs. +var doCreateNode; + +if (doc && !env$1.canvasSupported) { + try { + !doc.namespaces.zrvml && doc.namespaces.add('zrvml', urn); + doCreateNode = function (tagName) { + return doc.createElement(''); + }; + } + catch (e) { + doCreateNode = function (tagName) { + return doc.createElement('<' + tagName + ' xmlns="' + urn + '" class="zrvml">'); + }; + } +} + +// From raphael +function initVML() { + if (vmlInited || !doc) { + 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)'); + } +} + +// http://www.w3.org/TR/NOTE-VML +// TODO Use proxy like svg instead of overwrite brush methods + +var CMD$3 = PathProxy.CMD; +var round$3 = Math.round; +var sqrt = Math.sqrt; +var abs$1 = Math.abs; +var cos = Math.cos; +var sin = Math.sin; +var mathMax$8 = Math.max; + +if (!env$1.canvasSupported) { + + var comma = ','; + var imageTransformPrefix = 'progid:DXImageTransform.Microsoft'; + + var Z = 21600; + var Z2 = Z / 2; + + var ZLEVEL_BASE = 100000; + var Z_BASE$1 = 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, '&').replace(/"/g, '"'); + }; + + 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$1 + z2; + }; + + var parsePercent$3 = 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 = 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 = 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$$1 = 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$$1[0] * Z; + height /= scale$$1[1] * Z; + var dimension = mathMax$8(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$$1 = stops.length; + // Color and alpha list of first and last stop + var colorAndAlphaList = []; + var colors = []; + for (var i = 0; i < length$$1; i++) { + var stop = stops[i]; + var colorAndAlpha = getColorAndAlpha(stop.color); + colors.push(stop.offset * expansion + shift + ' ' + colorAndAlpha[0]); + if (i === 0 || i === length$$1 - 1) { + colorAndAlphaList.push(colorAndAlpha); + } + } + + if (length$$1 >= 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 = createNode(type); + } + + isFill ? updateFillNode(el, style, zrEl) : updateStrokeNode(el, style); + append(vmlEl, el); + } + else { + vmlEl[isFill ? 'filled' : 'stroked'] = 'false'; + remove(vmlEl, el); + } + }; + + var points$3 = [[], [], []]; + var pathDataToString = function (path, m) { + var M = CMD$3.M; + var C = CMD$3.C; + var L = CMD$3.L; + var A = CMD$3.A; + var Q = CMD$3.Q; + + var str = []; + var nPoint; + var cmdStr; + var cmd; + var i; + var xi; + var yi; + var data = path.data; + var dataLength = path.len(); + for (i = 0; i < dataLength;) { + cmd = data[i++]; + cmdStr = ''; + nPoint = 0; + switch (cmd) { + case M: + cmdStr = ' m '; + nPoint = 1; + xi = data[i++]; + yi = data[i++]; + points$3[0][0] = xi; + points$3[0][1] = yi; + break; + case L: + cmdStr = ' l '; + nPoint = 1; + xi = data[i++]; + yi = data[i++]; + points$3[0][0] = xi; + points$3[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$3[0][0] = x1; + points$3[0][1] = y1; + points$3[1][0] = x2; + points$3[1][1] = y2; + points$3[2][0] = x3; + points$3[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 '; + if (Math.abs(x0 - x1) < 1e-4) { + // IE won't render arches drawn counter clockwise if x0 == x1. + if (Math.abs(endAngle - startAngle) > 1e-2) { + // Offset x0 by 1/80 of a pixel. Use something + // that can be represented in binary + if (clockwise) { + x0 += 270 / Z; + } + } + else { + // Avoid case draw full circle + if (Math.abs(y0 - cy) < 1e-4) { + if ((clockwise && x0 < cx) || (!clockwise && x0 > cx)) { + y1 -= 270 / Z; + } + else { + y1 += 270 / Z; + } + } + else if ((clockwise && y0 < cy) || (!clockwise && y0 > cy)) { + x1 += 270 / Z; + } + else { + x1 -= 270 / Z; + } + } + } + str.push( + type, + round$3(((cx - rx) * sx + x) * Z - Z2), comma, + round$3(((cy - ry) * sy + y) * Z - Z2), comma, + round$3(((cx + rx) * sx + x) * Z - Z2), comma, + round$3(((cy + ry) * sy + y) * Z - Z2), comma, + round$3((x0 * sx + x) * Z - Z2), comma, + round$3((y0 * sy + y) * Z - Z2), comma, + round$3((x1 * sx + x) * Z - Z2), comma, + round$3((y1 * sy + y) * Z - Z2) + ); + + xi = x1; + yi = y1; + break; + case CMD$3.R: + var p0 = points$3[0]; + var p1 = points$3[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$3(p0[0] * Z - Z2); + p1[0] = round$3(p1[0] * Z - Z2); + p0[1] = round$3(p0[1] * Z - Z2); + p1[1] = round$3(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$3.Z: + // FIXME Update xi, yi + str.push(' x '); + } + + if (nPoint > 0) { + str.push(cmdStr); + for (var k = 0; k < nPoint; k++) { + var p = points$3[k]; + + m && applyTransform(p, p, m); + // 不 round 会非常慢 + str.push( + round$3(p[0] * Z - Z2), comma, round$3(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 = 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$1(det)); + } + strokeEl.weight = lineWidth + 'px'; + } + + var path = this.path || (this.path = new PathProxy()); + if (this.__dirtyPath) { + path.beginPath(); + this.buildPath(path, this.shape); + path.toStatic(); + this.__dirtyPath = false; + } + + vmlEl.path = pathDataToString(path, this.transform); + + vmlEl.style.zIndex = getZIndex(this.zlevel, this.z, this.z2); + + // Append to root + append(vmlRoot, vmlEl); + + // Text + if (style.text != null) { + this.drawRectText(vmlRoot, this.getBoundingRect()); + } + else { + this.removeRectText(vmlRoot); + } + }; + + 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 = 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$8(p0[0], p1[0], p2[0], p3[0]); + var maxY = mathMax$8(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$3(x * scaleX + m[4]), comma, + 'Dy=', round$3(y * scaleY + m[5])); + + vmlElStyle.padding = '0 ' + round$3(maxX) + 'px ' + round$3(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$3(x) + 'px'; + vmlElStyle.top = round$3(y) + 'px'; + } + + var imageEl = this._imageEl; + var cropEl = this._cropEl; + + if (!imageEl) { + imageEl = 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$3(scaleX * ow * dw / sw) + 'px'; + imageELStyle.height = round$3(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$3(scaleX * ow * dw / sw) + 'px'; + imageELStyle.height = round$3(scaleY * oh * dh / sh) + 'px'; + } + + if (! cropEl) { + cropEl = doc.createElement('div'); + cropEl.style.overflow = 'hidden'; + this._cropEl = cropEl; + } + var cropElStyle = cropEl.style; + cropElStyle.width = round$3((dw + sx * dw / sw) * scaleX); + cropElStyle.height = round$3((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$3(scaleX * dw) + 'px'; + imageELStyle.height = round$3(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$3(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 != null) { + 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 + $override$1('measureText', function (text, textFont) { + var doc$$1 = doc; + if (!textMeasureEl) { + textMeasureEl = doc$$1.createElement('div'); + textMeasureEl.style.cssText = 'position:absolute;top:-20000px;left:0;' + + 'padding:0;margin:0;border:none;white-space:pre;'; + 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$$1.createTextNode(text)); + return { + width: textMeasureEl.offsetWidth + }; + }); + + var tmpRect$2 = new BoundingRect(); + + var drawRectText = function (vmlRoot, rect, textRect, fromTextEl) { + + var style = this.style; + + // Optimize, avoid normalize every time. + this.__dirty && normalizeTextStyle(style, true); + + var text = style.text; + // Convert to string + text != null && (text += ''); + if (!text) { + return; + } + + // Convert rich text to plain text. Rich text is not supported in + // IE8-, but tags in rich text template will be removed. + if (style.rich) { + var contentBlock = parseRichText(text, style); + text = []; + for (var i = 0; i < contentBlock.lines.length; i++) { + var tokens = contentBlock.lines[i].tokens; + var textLine = []; + for (var j = 0; j < tokens.length; j++) { + textLine.push(tokens[j].text); + } + text.push(textLine.join('')); + } + text = text.join('\n'); + } + + var x; + var y; + var align = style.textAlign; + var verticalAlign = style.textVerticalAlign; + + var fontStyle = getFontStyle(style.font); + // FIXME encodeHtmlAttribute ? + var font = fontStyle.style + ' ' + fontStyle.variant + ' ' + fontStyle.weight + ' ' + + fontStyle.size + 'px "' + fontStyle.family + '"'; + + textRect = textRect || getBoundingRect(text, font, align, verticalAlign); + + // Transform rect to view space + var m = this.transform; + // Ignore transform for text in other element + if (m && !fromTextEl) { + tmpRect$2.copy(rect); + tmpRect$2.applyTransform(m); + rect = tmpRect$2; + } + + if (!fromTextEl) { + var textPosition = style.textPosition; + var distance$$1 = style.textDistance; + // Text position represented by coord + if (textPosition instanceof Array) { + x = rect.x + parsePercent$3(textPosition[0], rect.width); + y = rect.y + parsePercent$3(textPosition[1], rect.height); + + align = align || 'left'; + } + else { + var res = adjustTextPositionOnRect( + textPosition, rect, distance$$1 + ); + x = res.x; + y = res.y; + + // Default align and baseline when has textPosition + align = align || res.textAlign; + verticalAlign = verticalAlign || res.textVerticalAlign; + } + } + else { + x = rect.x; + y = rect.y; + } + + x = adjustTextX(x, textRect.width, align); + y = adjustTextY(y, textRect.height, verticalAlign); + + // Force baseline 'middle' + y += textRect.height / 2; + + // 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$$1 = createNode; + + var textVmlEl = this._textVmlEl; + var pathEl; + var textPathEl; + var skewEl; + if (!textVmlEl) { + textVmlEl = createNode$$1('line'); + pathEl = createNode$$1('path'); + textPathEl = createNode$$1('textpath'); + skewEl = createNode$$1('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$3(coords[0]) || 0) + ',' + (round$3(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$3(x) + 'px'; + textVmlElStyle.top = round$3(y) + 'px'; + } + + textPathEl.string = encodeHtmlAttribute(text); + // TODO + try { + textPathEl.style.font = font; + } + // Error font format + catch (e) {} + + updateFillAndStroke(textVmlEl, 'fill', { + fill: style.textFill, + opacity: style.opacity + }, this); + updateFillAndStroke(textVmlEl, 'stroke', { + 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$3 = 0; i$3 < list.length; i$3++) { + var proto$8 = list[i$3].prototype; + proto$8.drawRectText = drawRectText; + proto$8.removeRectText = removeRectText; + proto$8.appendRectText = appendRectText; + } + + Text.prototype.brushVML = function (vmlRoot) { + var style = this.style; + if (style.text != null) { + this.drawRectText(vmlRoot, { + x: style.x || 0, y: style.y || 0, + width: 0, height: 0 + }, this.getBoundingRect(), true); + } + else { + this.removeRectText(vmlRoot); + } + }; + + Text.prototype.onRemove = function (vmlRoot) { + this.removeRectText(vmlRoot); + }; + + Text.prototype.onAdd = function (vmlRoot) { + this.appendRectText(vmlRoot); + }; +} + +/** + * VML Painter. + * + * @module zrender/vml/Painter + */ + +function parseInt10$1(val) { + return parseInt(val, 10); +} + +/** + * @alias module:zrender/vml/Painter + */ +function VMLPainter(root, storage) { + + 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 oldDelFromStorage = storage.delFromStorage; + var oldAddToStorage = storage.addToStorage; + storage.delFromStorage = function (el) { + oldDelFromStorage.call(storage, el); + + if (el) { + el.onRemove && el.onRemove(vmlRoot); + } + }; + + storage.addToStorage = function (el) { + // Displayable already has a vml node + el.onAdd && el.onAdd(vmlRoot); + + oldAddToStorage.call(storage, el); + }; + + this._firstPaint = true; +} + +VMLPainter.prototype = { + + constructor: VMLPainter, + + getType: function () { + return 'vml'; + }, + + /** + * @return {HTMLDivElement} + */ + getViewportRoot: function () { + return this._vmlViewport; + }, + + getViewportRootOffset: function () { + var viewportRoot = this.getViewportRoot(); + if (viewportRoot) { + return { + offsetLeft: viewportRoot.offsetLeft || 0, + offsetTop: viewportRoot.offsetTop || 0 + }; + } + }, + + /** + * 刷新 + */ + 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 (width, height) { + var width = width == null ? this._getWidth() : width; + var height = height == null ? this._getHeight() : height; + + 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; + }, + + clear: function () { + if (this._vmlViewport) { + this.root.removeChild(this._vmlViewport); + } + }, + + _getWidth: function () { + var root = this.root; + var stl = root.currentStyle; + + return ((root.clientWidth || parseInt10$1(stl.width)) + - parseInt10$1(stl.paddingLeft) + - parseInt10$1(stl.paddingRight)) | 0; + }, + + _getHeight: function () { + var root = this.root; + var stl = root.currentStyle; + + return ((root.clientHeight || parseInt10$1(stl.height)) + - parseInt10$1(stl.paddingTop) + - parseInt10$1(stl.paddingBottom)) | 0; + } +}; + +// Not supported methods +function createMethodNotSupport(method) { + return function () { + zrLog('In IE8.0 VML mode painter not support method "' + method + '"'); + }; +} + +// Unsupported methods +each$1([ + 'getLayer', 'insertLayer', 'eachLayer', 'eachBuiltinLayer', 'eachOtherLayer', 'getLayers', + 'modLayer', 'delLayer', 'clearLayer', 'toDataURL', 'pathToImage' +], function (name) { + VMLPainter.prototype[name] = createMethodNotSupport(name); +}); + +registerPainter('vml', VMLPainter); + +var svgURI = 'http://www.w3.org/2000/svg'; + +function createElement(name) { + return document.createElementNS(svgURI, name); +} + +// TODO +// 1. shadow +// 2. Image: sx, sy, sw, sh + +var CMD$4 = PathProxy.CMD; +var arrayJoin = Array.prototype.join; + +var NONE = 'none'; +var mathRound = Math.round; +var mathSin$3 = Math.sin; +var mathCos$3 = Math.cos; +var PI$5 = Math.PI; +var PI2$7 = Math.PI * 2; +var degree = 180 / PI$5; + +var EPSILON$4 = 1e-4; + +function round4(val) { + return mathRound(val * 1e4) / 1e4; +} + +function isAroundZero$1(val) { + return val < EPSILON$4 && val > -EPSILON$4; +} + +function pathHasFill(style, isText) { + var fill = isText ? style.textFill : style.fill; + return fill != null && fill !== NONE; +} + +function pathHasStroke(style, isText) { + var stroke = isText ? style.textStroke : style.stroke; + return stroke != null && stroke !== NONE; +} + +function setTransform(svgEl, m) { + if (m) { + attr(svgEl, 'transform', 'matrix(' + arrayJoin.call(m, ',') + ')'); + } +} + +function attr(el, key, val) { + if (!val || val.type !== 'linear' && val.type !== 'radial') { + // Don't set attribute for gradient, since it need new dom nodes + if (typeof val === 'string' && val.indexOf('NaN') > -1) { + console.log(val); + } + el.setAttribute(key, val); + } +} + +function attrXLink(el, key, val) { + el.setAttributeNS('http://www.w3.org/1999/xlink', key, val); +} + +function bindStyle(svgEl, style, isText, el) { + if (pathHasFill(style, isText)) { + var fill = isText ? style.textFill : style.fill; + fill = fill === 'transparent' ? NONE : fill; + + /** + * FIXME: + * This is a temporary fix for Chrome's clipping bug + * that happens when a clip-path is referring another one. + * This fix should be used before Chrome's bug is fixed. + * For an element that has clip-path, and fill is none, + * set it to be "rgba(0, 0, 0, 0.002)" will hide the element. + * Otherwise, it will show black fill color. + * 0.002 is used because this won't work for alpha values smaller + * than 0.002. + * + * See + * https://bugs.chromium.org/p/chromium/issues/detail?id=659790 + * for more information. + */ + if (svgEl.getAttribute('clip-path') !== 'none' && fill === NONE) { + fill = 'rgba(0, 0, 0, 0.002)'; + } + + attr(svgEl, 'fill', fill); + attr(svgEl, 'fill-opacity', style.fillOpacity != null ? style.fillOpacity * style.opacity : style.opacity); + } + else { + attr(svgEl, 'fill', NONE); + } + + if (pathHasStroke(style, isText)) { + var stroke = isText ? style.textStroke : style.stroke; + stroke = stroke === 'transparent' ? NONE : stroke; + attr(svgEl, 'stroke', stroke); + var strokeWidth = isText + ? style.textStrokeWidth + : style.lineWidth; + var strokeScale = !isText && style.strokeNoScale + ? el.getLineScale() + : 1; + attr(svgEl, 'stroke-width', strokeWidth / strokeScale); + // stroke then fill for text; fill then stroke for others + attr(svgEl, 'paint-order', isText ? 'stroke' : 'fill'); + attr(svgEl, 'stroke-opacity', style.strokeOpacity != null ? style.strokeOpacity : style.opacity); + var lineDash = style.lineDash; + if (lineDash) { + attr(svgEl, 'stroke-dasharray', style.lineDash.join(',')); + attr(svgEl, 'stroke-dashoffset', mathRound(style.lineDashOffset || 0)); + } + else { + attr(svgEl, 'stroke-dasharray', ''); + } + + // PENDING + style.lineCap && attr(svgEl, 'stroke-linecap', style.lineCap); + style.lineJoin && attr(svgEl, 'stroke-linejoin', style.lineJoin); + style.miterLimit && attr(svgEl, 'stroke-miterlimit', style.miterLimit); + } + else { + attr(svgEl, 'stroke', NONE); + } +} + +/*************************************************** + * PATH + **************************************************/ +function pathDataToString$1(path) { + var str = []; + var data = path.data; + var dataLength = path.len(); + for (var i = 0; i < dataLength;) { + var cmd = data[i++]; + var cmdStr = ''; + var nData = 0; + switch (cmd) { + case CMD$4.M: + cmdStr = 'M'; + nData = 2; + break; + case CMD$4.L: + cmdStr = 'L'; + nData = 2; + break; + case CMD$4.Q: + cmdStr = 'Q'; + nData = 4; + break; + case CMD$4.C: + cmdStr = 'C'; + nData = 6; + break; + case CMD$4.A: + var cx = data[i++]; + var cy = data[i++]; + var rx = data[i++]; + var ry = data[i++]; + var theta = data[i++]; + var dTheta = data[i++]; + var psi = data[i++]; + var clockwise = data[i++]; + + var dThetaPositive = Math.abs(dTheta); + var isCircle = isAroundZero$1(dThetaPositive - PI2$7) + && !isAroundZero$1(dThetaPositive); + + var large = false; + if (dThetaPositive >= PI2$7) { + large = true; + } + else if (isAroundZero$1(dThetaPositive)) { + large = false; + } + else { + large = (dTheta > -PI$5 && dTheta < 0 || dTheta > PI$5) + === !!clockwise; + } + + var x0 = round4(cx + rx * mathCos$3(theta)); + var y0 = round4(cy + ry * mathSin$3(theta)); + + // It will not draw if start point and end point are exactly the same + // We need to shift the end point with a small value + // FIXME A better way to draw circle ? + if (isCircle) { + if (clockwise) { + dTheta = PI2$7 - 1e-4; + } + else { + dTheta = -PI2$7 + 1e-4; + } + + large = true; + + if (i === 9) { + // Move to (x0, y0) only when CMD.A comes at the + // first position of a shape. + // For instance, when drawing a ring, CMD.A comes + // after CMD.M, so it's unnecessary to move to + // (x0, y0). + str.push('M', x0, y0); + } + } + + var x = round4(cx + rx * mathCos$3(theta + dTheta)); + var y = round4(cy + ry * mathSin$3(theta + dTheta)); + + // FIXME Ellipse + str.push('A', round4(rx), round4(ry), + mathRound(psi * degree), +large, +clockwise, x, y); + break; + case CMD$4.Z: + cmdStr = 'Z'; + break; + case CMD$4.R: + var x = round4(data[i++]); + var y = round4(data[i++]); + var w = round4(data[i++]); + var h = round4(data[i++]); + str.push( + 'M', x, y, + 'L', x + w, y, + 'L', x + w, y + h, + 'L', x, y + h, + 'L', x, y + ); + break; + } + cmdStr && str.push(cmdStr); + for (var j = 0; j < nData; j++) { + // PENDING With scale + str.push(round4(data[i++])); + } + } + return str.join(' '); +} + +var svgPath = {}; +svgPath.brush = function (el) { + var style = el.style; + + var svgEl = el.__svgEl; + if (!svgEl) { + svgEl = createElement('path'); + el.__svgEl = svgEl; + } + + if (!el.path) { + el.createPathProxy(); + } + var path = el.path; + + if (el.__dirtyPath) { + path.beginPath(); + el.buildPath(path, el.shape); + el.__dirtyPath = false; + + var pathStr = pathDataToString$1(path); + if (pathStr.indexOf('NaN') < 0) { + // Ignore illegal path, which may happen such in out-of-range + // data in Calendar series. + attr(svgEl, 'd', pathStr); + } + } + + bindStyle(svgEl, style, false, el); + setTransform(svgEl, el.transform); + + if (style.text != null) { + svgTextDrawRectText(el, el.getBoundingRect()); + } +}; + +/*************************************************** + * IMAGE + **************************************************/ +var svgImage = {}; +svgImage.brush = function (el) { + var style = el.style; + var image = style.image; + + if (image instanceof HTMLImageElement) { + var src = image.src; + image = src; + } + if (! image) { + return; + } + + var x = style.x || 0; + var y = style.y || 0; + + var dw = style.width; + var dh = style.height; + + var svgEl = el.__svgEl; + if (! svgEl) { + svgEl = createElement('image'); + el.__svgEl = svgEl; + } + + if (image !== el.__imageSrc) { + attrXLink(svgEl, 'href', image); + // Caching image src + el.__imageSrc = image; + } + + attr(svgEl, 'width', dw); + attr(svgEl, 'height', dh); + + attr(svgEl, 'x', x); + attr(svgEl, 'y', y); + + setTransform(svgEl, el.transform); + + if (style.text != null) { + svgTextDrawRectText(el, el.getBoundingRect()); + } +}; + +/*************************************************** + * TEXT + **************************************************/ +var svgText = {}; +var tmpRect$3 = new BoundingRect(); + +var svgTextDrawRectText = function (el, rect, textRect) { + var style = el.style; + + el.__dirty && normalizeTextStyle(style, true); + + var text = style.text; + // Convert to string + if (text == null) { + // Draw no text only when text is set to null, but not '' + return; + } + else { + text += ''; + } + + var textSvgEl = el.__textSvgEl; + if (! textSvgEl) { + textSvgEl = createElement('text'); + el.__textSvgEl = textSvgEl; + } + + var x; + var y; + var textPosition = style.textPosition; + var distance = style.textDistance; + var align = style.textAlign || 'left'; + + if (typeof style.fontSize === 'number') { + style.fontSize += 'px'; + } + var font = style.font + || [ + style.fontStyle || '', + style.fontWeight || '', + style.fontSize || '', + style.fontFamily || '' + ].join(' ') + || DEFAULT_FONT; + + var verticalAlign = getVerticalAlignForSvg(style.textVerticalAlign); + + textRect = getBoundingRect(text, font, align, + verticalAlign); + + var lineHeight = textRect.lineHeight; + // Text position represented by coord + if (textPosition instanceof Array) { + x = rect.x + textPosition[0]; + y = rect.y + textPosition[1]; + } + else { + var newPos = adjustTextPositionOnRect( + textPosition, rect, distance + ); + x = newPos.x; + y = newPos.y; + verticalAlign = getVerticalAlignForSvg(newPos.textVerticalAlign); + align = newPos.textAlign; + } + + attr(textSvgEl, 'alignment-baseline', verticalAlign); + + if (font) { + textSvgEl.style.font = font; + } + + var textPadding = style.textPadding; + + // Make baseline top + attr(textSvgEl, 'x', x); + attr(textSvgEl, 'y', y); + + bindStyle(textSvgEl, style, true, el); + if (el instanceof Text || el.style.transformText) { + // Transform text with element + setTransform(textSvgEl, el.transform); + } + else { + if (el.transform) { + tmpRect$3.copy(rect); + tmpRect$3.applyTransform(el.transform); + rect = tmpRect$3; + } + else { + var pos = el.transformCoordToGlobal(rect.x, rect.y); + rect.x = pos[0]; + rect.y = pos[1]; + el.transform = identity(create$1()); + } + + // Text rotation, but no element transform + var origin = style.textOrigin; + if (origin === 'center') { + x = textRect.width / 2 + x; + y = textRect.height / 2 + y; + } + else if (origin) { + x = origin[0] + x; + y = origin[1] + y; + } + var rotate$$1 = -style.textRotation || 0; + var transform = create$1(); + // Apply textRotate to element matrix + rotate(transform, transform, rotate$$1); + + var pos = [el.transform[4], el.transform[5]]; + translate(transform, transform, pos); + setTransform(textSvgEl, transform); + } + + var textLines = text.split('\n'); + var nTextLines = textLines.length; + var textAnchor = align; + // PENDING + if (textAnchor === 'left') { + textAnchor = 'start'; + textPadding && (x += textPadding[3]); + } + else if (textAnchor === 'right') { + textAnchor = 'end'; + textPadding && (x -= textPadding[1]); + } + else if (textAnchor === 'center') { + textAnchor = 'middle'; + textPadding && (x += (textPadding[3] - textPadding[1]) / 2); + } + + var dy = 0; + if (verticalAlign === 'after-edge') { + dy = -textRect.height + lineHeight; + textPadding && (dy -= textPadding[2]); + } + else if (verticalAlign === 'middle') { + dy = (-textRect.height + lineHeight) / 2; + textPadding && (y += (textPadding[0] - textPadding[2]) / 2); + } + else { + textPadding && (dy += textPadding[0]); + } + + // Font may affect position of each tspan elements + if (el.__text !== text || el.__textFont !== font) { + var tspanList = el.__tspanList || []; + el.__tspanList = tspanList; + for (var i = 0; i < nTextLines; i++) { + // Using cached tspan elements + var tspan = tspanList[i]; + if (! tspan) { + tspan = tspanList[i] = createElement('tspan'); + textSvgEl.appendChild(tspan); + attr(tspan, 'alignment-baseline', verticalAlign); + attr(tspan, 'text-anchor', textAnchor); + } + else { + tspan.innerHTML = ''; + } + attr(tspan, 'x', x); + attr(tspan, 'y', y + i * lineHeight + dy); + tspan.appendChild(document.createTextNode(textLines[i])); + } + // Remove unsed tspan elements + for (; i < tspanList.length; i++) { + textSvgEl.removeChild(tspanList[i]); + } + tspanList.length = nTextLines; + + el.__text = text; + el.__textFont = font; + } + else if (el.__tspanList.length) { + // Update span x and y + var len = el.__tspanList.length; + for (var i = 0; i < len; ++i) { + var tspan = el.__tspanList[i]; + if (tspan) { + attr(tspan, 'x', x); + attr(tspan, 'y', y + i * lineHeight + dy); + } + } + } +}; + +function getVerticalAlignForSvg(verticalAlign) { + if (verticalAlign === 'middle') { + return 'middle'; + } + else if (verticalAlign === 'bottom') { + return 'after-edge'; + } + else { + return 'hanging'; + } +} + +svgText.drawRectText = svgTextDrawRectText; + +svgText.brush = function (el) { + var style = el.style; + if (style.text != null) { + // 强制设置 textPosition + style.textPosition = [0, 0]; + svgTextDrawRectText(el, { + x: style.x || 0, y: style.y || 0, + width: 0, height: 0 + }, el.getBoundingRect()); + } +}; + +// Myers' Diff Algorithm +// Modified from https://github.com/kpdecker/jsdiff/blob/master/src/diff/base.js + +function Diff() {} + +Diff.prototype = { + diff: function (oldArr, newArr, equals) { + if (!equals) { + equals = function (a, b) { + return a === b; + }; + } + this.equals = equals; + + var self = this; + + oldArr = oldArr.slice(); + newArr = newArr.slice(); + // Allow subclasses to massage the input prior to running + var newLen = newArr.length; + var oldLen = oldArr.length; + var editLength = 1; + var maxEditLength = newLen + oldLen; + var bestPath = [{ newPos: -1, components: [] }]; + + // Seed editLength = 0, i.e. the content starts with the same values + var oldPos = this.extractCommon(bestPath[0], newArr, oldArr, 0); + if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { + var indices = []; + for (var i = 0; i < newArr.length; i++) { + indices.push(i); + } + // Identity per the equality and tokenizer + return [{ + indices: indices, count: newArr.length + }]; + } + + // Main worker method. checks all permutations of a given edit length for acceptance. + function execEditLength() { + for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { + var basePath; + var addPath = bestPath[diagonalPath - 1]; + var removePath = bestPath[diagonalPath + 1]; + var oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; + if (addPath) { + // No one else is going to attempt to use this value, clear it + bestPath[diagonalPath - 1] = undefined; + } + + var canAdd = addPath && addPath.newPos + 1 < newLen; + var canRemove = removePath && 0 <= oldPos && oldPos < oldLen; + if (!canAdd && !canRemove) { + // If this path is a terminal then prune + bestPath[diagonalPath] = undefined; + continue; + } + + // Select the diagonal that we want to branch from. We select the prior + // path whose position in the new string is the farthest from the origin + // and does not pass the bounds of the diff graph + if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) { + basePath = clonePath(removePath); + self.pushComponent(basePath.components, undefined, true); + } + else { + basePath = addPath; // No need to clone, we've pulled it from the list + basePath.newPos++; + self.pushComponent(basePath.components, true, undefined); + } + + oldPos = self.extractCommon(basePath, newArr, oldArr, diagonalPath); + + // If we have hit the end of both strings, then we are done + if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) { + return buildValues(self, basePath.components, newArr, oldArr); + } + else { + // Otherwise track this path as a potential candidate and continue. + bestPath[diagonalPath] = basePath; + } + } + + editLength++; + } + + while (editLength <= maxEditLength) { + var ret = execEditLength(); + if (ret) { + return ret; + } + } + }, + + pushComponent: function (components, added, removed) { + var last = components[components.length - 1]; + if (last && last.added === added && last.removed === removed) { + // We need to clone here as the component clone operation is just + // as shallow array clone + components[components.length - 1] = {count: last.count + 1, added: added, removed: removed }; + } + else { + components.push({count: 1, added: added, removed: removed }); + } + }, + extractCommon: function (basePath, newArr, oldArr, diagonalPath) { + var newLen = newArr.length; + var oldLen = oldArr.length; + var newPos = basePath.newPos; + var oldPos = newPos - diagonalPath; + var commonCount = 0; + + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newArr[newPos + 1], oldArr[oldPos + 1])) { + newPos++; + oldPos++; + commonCount++; + } + + if (commonCount) { + basePath.components.push({count: commonCount}); + } + + basePath.newPos = newPos; + return oldPos; + }, + tokenize: function (value) { + return value.slice(); + }, + join: function (value) { + return value.slice(); + } +}; + +function buildValues(diff, components, newArr, oldArr) { + var componentPos = 0; + var componentLen = components.length; + var newPos = 0; + var oldPos = 0; + + for (; componentPos < componentLen; componentPos++) { + var component = components[componentPos]; + if (!component.removed) { + var indices = []; + for (var i = newPos; i < newPos + component.count; i++) { + indices.push(i); + } + component.indices = indices; + newPos += component.count; + // Common case + if (!component.added) { + oldPos += component.count; + } + } + else { + var indices = []; + for (var i = oldPos; i < oldPos + component.count; i++) { + indices.push(i); + } + component.indices = indices; + oldPos += component.count; + } + } + + return components; +} + +function clonePath(path) { + return { newPos: path.newPos, components: path.components.slice(0) }; +} + +var arrayDiff = new Diff(); + +var arrayDiff$1 = function (oldArr, newArr, callback) { + return arrayDiff.diff(oldArr, newArr, callback); +}; + +/** + * @file Manages elements that can be defined in in SVG, + * e.g., gradients, clip path, etc. + * @author Zhang Wenli + */ + +var MARK_UNUSED = '0'; +var MARK_USED = '1'; + +/** + * Manages elements that can be defined in in SVG, + * e.g., gradients, clip path, etc. + * + * @class + * @param {number} zrId zrender instance id + * @param {SVGElement} svgRoot root of SVG document + * @param {string|string[]} tagNames possible tag names + * @param {string} markLabel label name to make if the element + * is used + */ +function Definable( + zrId, + svgRoot, + tagNames, + markLabel, + domName +) { + this._zrId = zrId; + this._svgRoot = svgRoot; + this._tagNames = typeof tagNames === 'string' ? [tagNames] : tagNames; + this._markLabel = markLabel; + this._domName = domName || '_dom'; + + this.nextId = 0; +} + + +Definable.prototype.createElement = createElement; + + +/** + * Get the tag for svgRoot; optionally creates one if not exists. + * + * @param {boolean} isForceCreating if need to create when not exists + * @return {SVGDefsElement} SVG element, null if it doesn't + * exist and isForceCreating is false + */ +Definable.prototype.getDefs = function (isForceCreating) { + var svgRoot = this._svgRoot; + var defs = this._svgRoot.getElementsByTagName('defs'); + if (defs.length === 0) { + // Not exist + if (isForceCreating) { + defs = svgRoot.insertBefore( + this.createElement('defs'), // Create new tag + svgRoot.firstChild // Insert in the front of svg + ); + if (!defs.contains) { + // IE doesn't support contains method + defs.contains = function (el) { + var children = defs.children; + if (!children) { + return false; + } + for (var i = children.length - 1; i >= 0; --i) { + if (children[i] === el) { + return true; + } + } + return false; + }; + } + return defs; + } + else { + return null; + } + } + else { + return defs[0]; + } +}; + + +/** + * Update DOM element if necessary. + * + * @param {Object|string} element style element. e.g., for gradient, + * it may be '#ccc' or {type: 'linear', ...} + * @param {Function|undefined} onUpdate update callback + */ +Definable.prototype.update = function (element, onUpdate) { + if (!element) { + return; + } + + var defs = this.getDefs(false); + if (element[this._domName] && defs.contains(element[this._domName])) { + // Update DOM + if (typeof onUpdate === 'function') { + onUpdate(element); + } + } + else { + // No previous dom, create new + var dom = this.add(element); + if (dom) { + element[this._domName] = dom; + } + } +}; + + +/** + * Add gradient dom to defs + * + * @param {SVGElement} dom DOM to be added to + */ +Definable.prototype.addDom = function (dom) { + var defs = this.getDefs(true); + defs.appendChild(dom); +}; + + +/** + * Remove DOM of a given element. + * + * @param {SVGElement} element element to remove dom + */ +Definable.prototype.removeDom = function (element) { + var defs = this.getDefs(false); + if (defs && element[this._domName]) { + defs.removeChild(element[this._domName]); + element[this._domName] = null; + } +}; + + +/** + * Get DOMs of this element. + * + * @return {HTMLDomElement} doms of this defineable elements in + */ +Definable.prototype.getDoms = function () { + var defs = this.getDefs(false); + if (!defs) { + // No dom when defs is not defined + return []; + } + + var doms = []; + each$1(this._tagNames, function (tagName) { + var tags = defs.getElementsByTagName(tagName); + // Note that tags is HTMLCollection, which is array-like + // rather than real array. + // So `doms.concat(tags)` add tags as one object. + doms = doms.concat([].slice.call(tags)); + }); + + return doms; +}; + + +/** + * Mark DOMs to be unused before painting, and clear unused ones at the end + * of the painting. + */ +Definable.prototype.markAllUnused = function () { + var doms = this.getDoms(); + var that = this; + each$1(doms, function (dom) { + dom[that._markLabel] = MARK_UNUSED; + }); +}; + + +/** + * Mark a single DOM to be used. + * + * @param {SVGElement} dom DOM to mark + */ +Definable.prototype.markUsed = function (dom) { + if (dom) { + dom[this._markLabel] = MARK_USED; + } +}; + + +/** + * Remove unused DOMs defined in + */ +Definable.prototype.removeUnused = function () { + var defs = this.getDefs(false); + if (!defs) { + // Nothing to remove + return; + } + + var doms = this.getDoms(); + var that = this; + each$1(doms, function (dom) { + if (dom[that._markLabel] !== MARK_USED) { + // Remove gradient + defs.removeChild(dom); + } + }); +}; + + +/** + * Get SVG proxy. + * + * @param {Displayable} displayable displayable element + * @return {Path|Image|Text} svg proxy of given element + */ +Definable.prototype.getSvgProxy = function (displayable) { + if (displayable instanceof Path) { + return svgPath; + } + else if (displayable instanceof ZImage) { + return svgImage; + } + else if (displayable instanceof Text) { + return svgText; + } + else { + return svgPath; + } +}; + + +/** + * Get text SVG element. + * + * @param {Displayable} displayable displayable element + * @return {SVGElement} SVG element of text + */ +Definable.prototype.getTextSvgElement = function (displayable) { + return displayable.__textSvgEl; +}; + + +/** + * Get SVG element. + * + * @param {Displayable} displayable displayable element + * @return {SVGElement} SVG element + */ +Definable.prototype.getSvgElement = function (displayable) { + return displayable.__svgEl; +}; + +/** + * @file Manages SVG gradient elements. + * @author Zhang Wenli + */ + +/** + * Manages SVG gradient elements. + * + * @class + * @extends Definable + * @param {number} zrId zrender instance id + * @param {SVGElement} svgRoot root of SVG document + */ +function GradientManager(zrId, svgRoot) { + Definable.call( + this, + zrId, + svgRoot, + ['linearGradient', 'radialGradient'], + '__gradient_in_use__' + ); +} + + +inherits(GradientManager, Definable); + + +/** + * Create new gradient DOM for fill or stroke if not exist, + * but will not update gradient if exists. + * + * @param {SvgElement} svgElement SVG element to paint + * @param {Displayable} displayable zrender displayable element + */ +GradientManager.prototype.addWithoutUpdate = function ( + svgElement, + displayable +) { + if (displayable && displayable.style) { + var that = this; + each$1(['fill', 'stroke'], function (fillOrStroke) { + if (displayable.style[fillOrStroke] + && (displayable.style[fillOrStroke].type === 'linear' + || displayable.style[fillOrStroke].type === 'radial') + ) { + var gradient = displayable.style[fillOrStroke]; + var defs = that.getDefs(true); + + // Create dom in if not exists + var dom; + if (gradient._dom) { + // Gradient exists + dom = gradient._dom; + if (!defs.contains(gradient._dom)) { + // _dom is no longer in defs, recreate + that.addDom(dom); + } + } + else { + // New dom + dom = that.add(gradient); + } + + that.markUsed(displayable); + + var id = dom.getAttribute('id'); + svgElement.setAttribute(fillOrStroke, 'url(#' + id + ')'); + } + }); + } +}; + + +/** + * Add a new gradient tag in + * + * @param {Gradient} gradient zr gradient instance + * @return {SVGLinearGradientElement | SVGRadialGradientElement} + * created DOM + */ +GradientManager.prototype.add = function (gradient) { + var dom; + if (gradient.type === 'linear') { + dom = this.createElement('linearGradient'); + } + else if (gradient.type === 'radial') { + dom = this.createElement('radialGradient'); + } + else { + zrLog('Illegal gradient type.'); + return null; + } + + // Set dom id with gradient id, since each gradient instance + // will have no more than one dom element. + // id may exists before for those dirty elements, in which case + // id should remain the same, and other attributes should be + // updated. + gradient.id = gradient.id || this.nextId++; + dom.setAttribute('id', 'zr' + this._zrId + + '-gradient-' + gradient.id); + + this.updateDom(gradient, dom); + this.addDom(dom); + + return dom; +}; + + +/** + * Update gradient. + * + * @param {Gradient} gradient zr gradient instance + */ +GradientManager.prototype.update = function (gradient) { + var that = this; + Definable.prototype.update.call(this, gradient, function () { + var type = gradient.type; + var tagName = gradient._dom.tagName; + if (type === 'linear' && tagName === 'linearGradient' + || type === 'radial' && tagName === 'radialGradient' + ) { + // Gradient type is not changed, update gradient + that.updateDom(gradient, gradient._dom); + } + else { + // Remove and re-create if type is changed + that.removeDom(gradient); + that.add(gradient); + } + }); +}; + + +/** + * Update gradient dom + * + * @param {Gradient} gradient zr gradient instance + * @param {SVGLinearGradientElement | SVGRadialGradientElement} dom + * DOM to update + */ +GradientManager.prototype.updateDom = function (gradient, dom) { + if (gradient.type === 'linear') { + dom.setAttribute('x1', gradient.x); + dom.setAttribute('y1', gradient.y); + dom.setAttribute('x2', gradient.x2); + dom.setAttribute('y2', gradient.y2); + } + else if (gradient.type === 'radial') { + dom.setAttribute('cx', gradient.x); + dom.setAttribute('cy', gradient.y); + dom.setAttribute('r', gradient.r); + } + else { + zrLog('Illegal gradient type.'); + return; + } + + if (gradient.global) { + // x1, x2, y1, y2 in range of 0 to canvas width or height + dom.setAttribute('gradientUnits', 'userSpaceOnUse'); + } + else { + // x1, x2, y1, y2 in range of 0 to 1 + dom.setAttribute('gradientUnits', 'objectBoundingBox'); + } + + // Remove color stops if exists + dom.innerHTML = ''; + + // Add color stops + var colors = gradient.colorStops; + for (var i = 0, len = colors.length; i < len; ++i) { + var stop = this.createElement('stop'); + stop.setAttribute('offset', colors[i].offset * 100 + '%'); + stop.setAttribute('stop-color', colors[i].color); + dom.appendChild(stop); + } + + // Store dom element in gradient, to avoid creating multiple + // dom instances for the same gradient element + gradient._dom = dom; +}; + +/** + * Mark a single gradient to be used + * + * @param {Displayable} displayable displayable element + */ +GradientManager.prototype.markUsed = function (displayable) { + if (displayable.style) { + var gradient = displayable.style.fill; + if (gradient && gradient._dom) { + Definable.prototype.markUsed.call(this, gradient._dom); + } + + gradient = displayable.style.stroke; + if (gradient && gradient._dom) { + Definable.prototype.markUsed.call(this, gradient._dom); + } + } +}; + +/** + * @file Manages SVG clipPath elements. + * @author Zhang Wenli + */ + +/** + * Manages SVG clipPath elements. + * + * @class + * @extends Definable + * @param {number} zrId zrender instance id + * @param {SVGElement} svgRoot root of SVG document + */ +function ClippathManager(zrId, svgRoot) { + Definable.call(this, zrId, svgRoot, 'clipPath', '__clippath_in_use__'); +} + + +inherits(ClippathManager, Definable); + + +/** + * Update clipPath. + * + * @param {Displayable} displayable displayable element + */ +ClippathManager.prototype.update = function (displayable) { + var svgEl = this.getSvgElement(displayable); + if (svgEl) { + this.updateDom(svgEl, displayable.__clipPaths, false); + } + + var textEl = this.getTextSvgElement(displayable); + if (textEl) { + // Make another clipPath for text, since it's transform + // matrix is not the same with svgElement + this.updateDom(textEl, displayable.__clipPaths, true); + } + + this.markUsed(displayable); +}; + + +/** + * Create an SVGElement of displayable and create a of its + * clipPath + * + * @param {Displayable} parentEl parent element + * @param {ClipPath[]} clipPaths clipPaths of parent element + * @param {boolean} isText if parent element is Text + */ +ClippathManager.prototype.updateDom = function ( + parentEl, + clipPaths, + isText +) { + if (clipPaths && clipPaths.length > 0) { + // Has clipPath, create with the first clipPath + var defs = this.getDefs(true); + var clipPath = clipPaths[0]; + var clipPathEl; + var id; + + var dom = isText ? '_textDom' : '_dom'; + + if (clipPath[dom]) { + // Use a dom that is already in + id = clipPath[dom].getAttribute('id'); + clipPathEl = clipPath[dom]; + + // Use a dom that is already in + if (!defs.contains(clipPathEl)) { + // This happens when set old clipPath that has + // been previously removed + defs.appendChild(clipPathEl); + } + } + else { + // New + id = 'zr' + this._zrId + '-clip-' + this.nextId; + ++this.nextId; + clipPathEl = this.createElement('clipPath'); + clipPathEl.setAttribute('id', id); + defs.appendChild(clipPathEl); + + clipPath[dom] = clipPathEl; + } + + // Build path and add to + var svgProxy = this.getSvgProxy(clipPath); + if (clipPath.transform + && clipPath.parent.invTransform + && !isText + ) { + /** + * If a clipPath has a parent with transform, the transform + * of parent should not be considered when setting transform + * of clipPath. So we need to transform back from parent's + * transform, which is done by multiplying parent's inverse + * transform. + */ + // Store old transform + var transform = Array.prototype.slice.call( + clipPath.transform + ); + + // Transform back from parent, and brush path + mul$1( + clipPath.transform, + clipPath.parent.invTransform, + clipPath.transform + ); + svgProxy.brush(clipPath); + + // Set back transform of clipPath + clipPath.transform = transform; + } + else { + svgProxy.brush(clipPath); + } + + var pathEl = this.getSvgElement(clipPath); + + clipPathEl.innerHTML = ''; + /** + * Use `cloneNode()` here to appendChild to multiple parents, + * which may happend when Text and other shapes are using the same + * clipPath. Since Text will create an extra clipPath DOM due to + * different transform rules. + */ + clipPathEl.appendChild(pathEl.cloneNode()); + + parentEl.setAttribute('clip-path', 'url(#' + id + ')'); + + if (clipPaths.length > 1) { + // Make the other clipPaths recursively + this.updateDom(clipPathEl, clipPaths.slice(1), isText); + } + } + else { + // No clipPath + if (parentEl) { + parentEl.setAttribute('clip-path', 'none'); + } + } +}; + +/** + * Mark a single clipPath to be used + * + * @param {Displayable} displayable displayable element + */ +ClippathManager.prototype.markUsed = function (displayable) { + var that = this; + if (displayable.__clipPaths && displayable.__clipPaths.length > 0) { + each$1(displayable.__clipPaths, function (clipPath) { + if (clipPath._dom) { + Definable.prototype.markUsed.call(that, clipPath._dom); + } + if (clipPath._textDom) { + Definable.prototype.markUsed.call(that, clipPath._textDom); + } + }); + } +}; + +/** + * @file Manages SVG shadow elements. + * @author Zhang Wenli + */ + +/** + * Manages SVG shadow elements. + * + * @class + * @extends Definable + * @param {number} zrId zrender instance id + * @param {SVGElement} svgRoot root of SVG document + */ +function ShadowManager(zrId, svgRoot) { + Definable.call( + this, + zrId, + svgRoot, + ['filter'], + '__filter_in_use__', + '_shadowDom' + ); +} + + +inherits(ShadowManager, Definable); + + +/** + * Create new shadow DOM for fill or stroke if not exist, + * but will not update shadow if exists. + * + * @param {SvgElement} svgElement SVG element to paint + * @param {Displayable} displayable zrender displayable element + */ +ShadowManager.prototype.addWithoutUpdate = function ( + svgElement, + displayable +) { + if (displayable && hasShadow(displayable.style)) { + var style = displayable.style; + + // Create dom in if not exists + var dom; + if (style._shadowDom) { + // Gradient exists + dom = style._shadowDom; + + var defs = this.getDefs(true); + if (!defs.contains(style._shadowDom)) { + // _shadowDom is no longer in defs, recreate + this.addDom(dom); + } + } + else { + // New dom + dom = this.add(displayable); + } + + this.markUsed(displayable); + + var id = dom.getAttribute('id'); + svgElement.style.filter = 'url(#' + id + ')'; + } +}; + + +/** + * Add a new shadow tag in + * + * @param {Displayable} displayable zrender displayable element + * @return {SVGFilterElement} created DOM + */ +ShadowManager.prototype.add = function (displayable) { + var dom = this.createElement('filter'); + var style = displayable.style; + + // Set dom id with shadow id, since each shadow instance + // will have no more than one dom element. + // id may exists before for those dirty elements, in which case + // id should remain the same, and other attributes should be + // updated. + style._shadowDomId = style._shadowDomId || this.nextId++; + dom.setAttribute('id', 'zr' + this._zrId + + '-shadow-' + style._shadowDomId); + + this.updateDom(displayable, dom); + this.addDom(dom); + + return dom; +}; + + +/** + * Update shadow. + * + * @param {Displayable} displayable zrender displayable element + */ +ShadowManager.prototype.update = function (svgElement, displayable) { + var style = displayable.style; + if (hasShadow(style)) { + var that = this; + Definable.prototype.update.call(this, displayable, function (style) { + that.updateDom(displayable, style._shadowDom); + }); + } + else { + // Remove shadow + this.remove(svgElement, style); + } +}; + + +/** + * Remove DOM and clear parent filter + */ +ShadowManager.prototype.remove = function (svgElement, style) { + if (style._shadowDomId != null) { + this.removeDom(style); + svgElement.style.filter = ''; + } +}; + + +/** + * Update shadow dom + * + * @param {Displayable} displayable zrender displayable element + * @param {SVGFilterElement} dom DOM to update + */ +ShadowManager.prototype.updateDom = function (displayable, dom) { + var domChild = dom.getElementsByTagName('feDropShadow'); + if (domChild.length === 0) { + domChild = this.createElement('feDropShadow'); + } + else { + domChild = domChild[0]; + } + + var style = displayable.style; + var scaleX = displayable.scale ? (displayable.scale[0] || 1) : 1; + var scaleY = displayable.scale ? (displayable.scale[1] || 1) : 1; + + // TODO: textBoxShadowBlur is not supported yet + var offsetX, offsetY, blur, color; + if (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY) { + offsetX = style.shadowOffsetX || 0; + offsetY = style.shadowOffsetY || 0; + blur = style.shadowBlur; + color = style.shadowColor; + } + else if (style.textShadowBlur) { + offsetX = style.textShadowOffsetX || 0; + offsetY = style.textShadowOffsetY || 0; + blur = style.textShadowBlur; + color = style.textShadowColor; + } + else { + // Remove shadow + this.removeDom(dom, style); + return; + } + + domChild.setAttribute('dx', offsetX / scaleX); + domChild.setAttribute('dy', offsetY / scaleY); + domChild.setAttribute('flood-color', color); + + // Divide by two here so that it looks the same as in canvas + // See: https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-shadowblur + var stdDx = blur / 2 / scaleX; + var stdDy = blur / 2 / scaleY; + var stdDeviation = stdDx + ' ' + stdDy; + domChild.setAttribute('stdDeviation', stdDeviation); + + // Fix filter clipping problem + dom.setAttribute('x', '-100%'); + dom.setAttribute('y', '-100%'); + dom.setAttribute('width', Math.ceil(blur / 2 * 200) + '%'); + dom.setAttribute('height', Math.ceil(blur / 2 * 200) + '%'); + + dom.appendChild(domChild); + + // Store dom element in shadow, to avoid creating multiple + // dom instances for the same shadow element + style._shadowDom = dom; +}; + +/** + * Mark a single shadow to be used + * + * @param {Displayable} displayable displayable element + */ +ShadowManager.prototype.markUsed = function (displayable) { + var style = displayable.style; + if (style && style._shadowDom) { + Definable.prototype.markUsed.call(this, style._shadowDom); + } +}; + +function hasShadow(style) { + // TODO: textBoxShadowBlur is not supported yet + return style + && (style.shadowBlur || style.shadowOffsetX || style.shadowOffsetY + || style.textShadowBlur || style.textShadowOffsetX + || style.textShadowOffsetY); +} + +/** + * SVG Painter + * @module zrender/svg/Painter + */ + +function parseInt10$2(val) { + return parseInt(val, 10); +} + +function getSvgProxy(el) { + if (el instanceof Path) { + return svgPath; + } + else if (el instanceof ZImage) { + return svgImage; + } + else if (el instanceof Text) { + return svgText; + } + else { + return svgPath; + } +} + +function checkParentAvailable(parent, child) { + return child && parent && child.parentNode !== parent; +} + +function insertAfter(parent, child, prevSibling) { + if (checkParentAvailable(parent, child) && prevSibling) { + var nextSibling = prevSibling.nextSibling; + nextSibling ? parent.insertBefore(child, nextSibling) + : parent.appendChild(child); + } +} + +function prepend(parent, child) { + if (checkParentAvailable(parent, child)) { + var firstChild = parent.firstChild; + firstChild ? parent.insertBefore(child, firstChild) + : parent.appendChild(child); + } +} + +function remove$1(parent, child) { + if (child && parent && child.parentNode === parent) { + parent.removeChild(child); + } +} + +function getTextSvgElement(displayable) { + return displayable.__textSvgEl; +} + +function getSvgElement(displayable) { + return displayable.__svgEl; +} + +/** + * @alias module:zrender/svg/Painter + * @constructor + * @param {HTMLElement} root 绘图容器 + * @param {module:zrender/Storage} storage + * @param {Object} opts + */ +var SVGPainter = function (root, storage, opts, zrId) { + + this.root = root; + this.storage = storage; + this._opts = opts = extend({}, opts || {}); + + var svgRoot = createElement('svg'); + svgRoot.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); + svgRoot.setAttribute('version', '1.1'); + svgRoot.setAttribute('baseProfile', 'full'); + svgRoot.style.cssText = 'user-select:none;position:absolute;left:0;top:0;'; + + this.gradientManager = new GradientManager(zrId, svgRoot); + this.clipPathManager = new ClippathManager(zrId, svgRoot); + this.shadowManager = new ShadowManager(zrId, svgRoot); + + var viewport = document.createElement('div'); + viewport.style.cssText = 'overflow:hidden;position:relative'; + + this._svgRoot = svgRoot; + this._viewport = viewport; + + root.appendChild(viewport); + viewport.appendChild(svgRoot); + + this.resize(opts.width, opts.height); + + this._visibleList = []; +}; + +SVGPainter.prototype = { + + constructor: SVGPainter, + + getType: function () { + return 'svg'; + }, + + getViewportRoot: function () { + return this._viewport; + }, + + getViewportRootOffset: function () { + var viewportRoot = this.getViewportRoot(); + if (viewportRoot) { + return { + offsetLeft: viewportRoot.offsetLeft || 0, + offsetTop: viewportRoot.offsetTop || 0 + }; + } + }, + + refresh: function () { + + var list = this.storage.getDisplayList(true); + + this._paintList(list); + }, + + setBackgroundColor: function (backgroundColor) { + // TODO gradient + this._viewport.style.background = backgroundColor; + }, + + _paintList: function (list) { + this.gradientManager.markAllUnused(); + this.clipPathManager.markAllUnused(); + this.shadowManager.markAllUnused(); + + var svgRoot = this._svgRoot; + var visibleList = this._visibleList; + var listLen = list.length; + + var newVisibleList = []; + var i; + for (i = 0; i < listLen; i++) { + var displayable = list[i]; + var svgProxy = getSvgProxy(displayable); + var svgElement = getSvgElement(displayable) + || getTextSvgElement(displayable); + if (!displayable.invisible) { + if (displayable.__dirty) { + svgProxy && svgProxy.brush(displayable); + + // Update clipPath + this.clipPathManager.update(displayable); + + // Update gradient and shadow + if (displayable.style) { + this.gradientManager + .update(displayable.style.fill); + this.gradientManager + .update(displayable.style.stroke); + + this.shadowManager + .update(svgElement, displayable); + } + + displayable.__dirty = false; + } + newVisibleList.push(displayable); + } + } + + var diff = arrayDiff$1(visibleList, newVisibleList); + var prevSvgElement; + + // First do remove, in case element moved to the head and do remove + // after add + for (i = 0; i < diff.length; i++) { + var item = diff[i]; + if (item.removed) { + for (var k = 0; k < item.count; k++) { + var displayable = visibleList[item.indices[k]]; + var svgElement = getSvgElement(displayable); + var textSvgElement = getTextSvgElement(displayable); + remove$1(svgRoot, svgElement); + remove$1(svgRoot, textSvgElement); + } + } + } + for (i = 0; i < diff.length; i++) { + var item = diff[i]; + if (item.added) { + for (var k = 0; k < item.count; k++) { + var displayable = newVisibleList[item.indices[k]]; + var svgElement = getSvgElement(displayable); + var textSvgElement = getTextSvgElement(displayable); + prevSvgElement + ? insertAfter(svgRoot, svgElement, prevSvgElement) + : prepend(svgRoot, svgElement); + if (svgElement) { + insertAfter(svgRoot, textSvgElement, svgElement); + } + else if (prevSvgElement) { + insertAfter( + svgRoot, textSvgElement, prevSvgElement + ); + } + else { + prepend(svgRoot, textSvgElement); + } + // Insert text + insertAfter(svgRoot, textSvgElement, svgElement); + prevSvgElement = textSvgElement || svgElement + || prevSvgElement; + + this.gradientManager + .addWithoutUpdate(svgElement, displayable); + this.shadowManager + .addWithoutUpdate(prevSvgElement, displayable); + this.clipPathManager.markUsed(displayable); + } + } + else if (!item.removed) { + for (var k = 0; k < item.count; k++) { + var displayable = newVisibleList[item.indices[k]]; + prevSvgElement + = svgElement + = getTextSvgElement(displayable) + || getSvgElement(displayable) + || prevSvgElement; + + this.gradientManager.markUsed(displayable); + this.gradientManager + .addWithoutUpdate(svgElement, displayable); + + this.shadowManager.markUsed(displayable); + this.shadowManager + .addWithoutUpdate(svgElement, displayable); + + this.clipPathManager.markUsed(displayable); + } + } + } + + this.gradientManager.removeUnused(); + this.clipPathManager.removeUnused(); + this.shadowManager.removeUnused(); + + this._visibleList = newVisibleList; + }, + + _getDefs: function (isForceCreating) { + var svgRoot = this._svgRoot; + var defs = this._svgRoot.getElementsByTagName('defs'); + if (defs.length === 0) { + // Not exist + if (isForceCreating) { + var defs = svgRoot.insertBefore( + createElement('defs'), // Create new tag + svgRoot.firstChild // Insert in the front of svg + ); + if (!defs.contains) { + // IE doesn't support contains method + defs.contains = function (el) { + var children = defs.children; + if (!children) { + return false; + } + for (var i = children.length - 1; i >= 0; --i) { + if (children[i] === el) { + return true; + } + } + return false; + }; + } + return defs; + } + else { + return null; + } + } + else { + return defs[0]; + } + }, + + resize: function (width, height) { + var viewport = this._viewport; + // FIXME Why ? + viewport.style.display = 'none'; + + // Save input w/h + var opts = this._opts; + width != null && (opts.width = width); + height != null && (opts.height = height); + + width = this._getSize(0); + height = this._getSize(1); + + viewport.style.display = ''; + + if (this._width !== width || this._height !== height) { + this._width = width; + this._height = height; + + var viewportStyle = viewport.style; + viewportStyle.width = width + 'px'; + viewportStyle.height = height + 'px'; + + var svgRoot = this._svgRoot; + // Set width by 'svgRoot.width = width' is invalid + svgRoot.setAttribute('width', width); + svgRoot.setAttribute('height', height); + } + }, + + /** + * 获取绘图区域宽度 + */ + getWidth: function () { + return this._width; + }, + + /** + * 获取绘图区域高度 + */ + getHeight: function () { + return this._height; + }, + + _getSize: function (whIdx) { + var opts = this._opts; + var wh = ['width', 'height'][whIdx]; + var cwh = ['clientWidth', 'clientHeight'][whIdx]; + var plt = ['paddingLeft', 'paddingTop'][whIdx]; + var prb = ['paddingRight', 'paddingBottom'][whIdx]; + + if (opts[wh] != null && opts[wh] !== 'auto') { + return parseFloat(opts[wh]); + } + + var root = this.root; + // IE8 does not support getComputedStyle, but it use VML. + var stl = document.defaultView.getComputedStyle(root); + + return ( + (root[cwh] || parseInt10$2(stl[wh]) || parseInt10$2(root.style[wh])) + - (parseInt10$2(stl[plt]) || 0) + - (parseInt10$2(stl[prb]) || 0) + ) | 0; + }, + + dispose: function () { + this.root.innerHTML = ''; + + this._svgRoot + = this._viewport + = this.storage + = null; + }, + + clear: function () { + if (this._viewport) { + this.root.removeChild(this._viewport); + } + }, + + pathToDataUrl: function () { + this.refresh(); + var html = this._svgRoot.outerHTML; + return 'data:image/svg+xml;charset=UTF-8,' + html; + } +}; + +// Not supported methods +function createMethodNotSupport$1(method) { + return function () { + zrLog('In SVG mode painter not support method "' + method + '"'); + }; +} + +// Unsuppoted methods +each$1([ + 'getLayer', 'insertLayer', 'eachLayer', 'eachBuiltinLayer', + 'eachOtherLayer', 'getLayers', 'modLayer', 'delLayer', 'clearLayer', + 'toDataURL', 'pathToImage' +], function (name) { + SVGPainter.prototype[name] = createMethodNotSupport$1(name); +}); + +registerPainter('svg', SVGPainter); + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +*/ + +// Import all charts and components + +exports.version = version; +exports.dependencies = dependencies; +exports.PRIORITY = PRIORITY; +exports.init = init; +exports.connect = connect; +exports.disConnect = disConnect; +exports.disconnect = disconnect; +exports.dispose = dispose; +exports.getInstanceByDom = getInstanceByDom; +exports.getInstanceById = getInstanceById; +exports.registerTheme = registerTheme; +exports.registerPreprocessor = registerPreprocessor; +exports.registerProcessor = registerProcessor; +exports.registerPostUpdate = registerPostUpdate; +exports.registerAction = registerAction; +exports.registerCoordinateSystem = registerCoordinateSystem; +exports.getCoordinateSystemDimensions = getCoordinateSystemDimensions; +exports.registerLayout = registerLayout; +exports.registerVisual = registerVisual; +exports.registerLoading = registerLoading; +exports.extendComponentModel = extendComponentModel; +exports.extendComponentView = extendComponentView; +exports.extendSeriesModel = extendSeriesModel; +exports.extendChartView = extendChartView; +exports.setCanvasCreator = setCanvasCreator; +exports.registerMap = registerMap; +exports.getMap = getMap; +exports.dataTool = dataTool; +exports.zrender = zrender; +exports.number = number; +exports.format = format; +exports.throttle = throttle; +exports.helper = helper; +exports.matrix = matrix; +exports.vector = vector; +exports.color = color; +exports.parseGeoJSON = parseGeoJson$1; +exports.parseGeoJson = parseGeoJson; +exports.util = ecUtil; +exports.graphic = graphic$1; +exports.List = List; +exports.Model = Model; +exports.Axis = Axis; +exports.env = env$1; + +}))); +//# sourceMappingURL=echarts.js.map diff --git a/src/main/resources/com/fr/plugin/web/js/water.js b/src/main/resources/com/fr/plugin/web/js/water.js new file mode 100644 index 0000000..c118222 --- /dev/null +++ b/src/main/resources/com/fr/plugin/web/js/water.js @@ -0,0 +1,15 @@ +// 前端图表对象 +demoWrapper = ExtendedChart.extend({ + _init:function (dom, option) { + debugger + var chart = echarts.init(dom); + var option1 = { + series: [{ + type: 'liquidFill', + data: option.value + }] + }; + chart.setOption(option1); + return chart; + } +}); \ No newline at end of file